OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
132 { | 132 { |
133 TRACE_EVENT0("gpu", "Warm up HMAC"); | 133 TRACE_EVENT0("gpu", "Warm up HMAC"); |
134 // Warm up the crypto subsystem, which needs to done pre-sandbox on all | 134 // Warm up the crypto subsystem, which needs to done pre-sandbox on all |
135 // platforms. | 135 // platforms. |
136 crypto::HMAC hmac(crypto::HMAC::SHA256); | 136 crypto::HMAC hmac(crypto::HMAC::SHA256); |
137 unsigned char key = '\0'; | 137 unsigned char key = '\0'; |
138 bool ret = hmac.Init(&key, sizeof(key)); | 138 bool ret = hmac.Init(&key, sizeof(key)); |
139 (void) ret; | 139 (void) ret; |
140 } | 140 } |
141 | 141 |
142 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 142 #if defined(OS_LINUX) |
143 { | 143 { |
144 TRACE_EVENT0("gpu", "Initialize sandbox"); | 144 TRACE_EVENT0("gpu", "Initialize sandbox"); |
145 content::InitializeSandbox(); | 145 bool do_init_sandbox = true; |
146 | |
147 #if defined(OS_CHROMEOS) | |
Chris Evans
2012/06/08 07:13:57
I think we can have the best of two worlds:
- neve
Jorge Lucangeli Obes
2012/06/11 20:23:04
Done.
| |
148 // On Chrome OS, initialize the GPU process' sandbox only on Intel GPUs. | |
149 do_init_sandbox = gpu_info.gpu.vendor_id == 0x8086; // Intel GPU. | |
150 #endif | |
151 | |
152 if (do_init_sandbox) { | |
153 content::InitializeSandbox(); | |
154 } | |
146 } | 155 } |
147 #endif | 156 #endif |
148 | 157 |
149 { | 158 { |
150 TRACE_EVENT0("gpu", "Initialize COM"); | 159 TRACE_EVENT0("gpu", "Initialize COM"); |
151 base::win::ScopedCOMInitializer com_initializer; | 160 base::win::ScopedCOMInitializer com_initializer; |
152 } | 161 } |
153 | 162 |
154 #if defined(OS_WIN) | 163 #if defined(OS_WIN) |
155 { | 164 { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
204 | 213 |
205 { | 214 { |
206 TRACE_EVENT0("gpu", "Run Message Loop"); | 215 TRACE_EVENT0("gpu", "Run Message Loop"); |
207 main_message_loop.Run(); | 216 main_message_loop.Run(); |
208 } | 217 } |
209 | 218 |
210 child_thread->StopWatchdog(); | 219 child_thread->StopWatchdog(); |
211 | 220 |
212 return 0; | 221 return 0; |
213 } | 222 } |
OLD | NEW |