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) && defined(NDEBUG) |
| 148 // On Chrome OS and when not on a debug build, initialize |
| 149 // the GPU process' sandbox only on Intel GPUs. |
| 150 do_init_sandbox = gpu_info.gpu.vendor_id == 0x8086; // Intel GPU. |
| 151 #endif |
| 152 |
| 153 if (do_init_sandbox) { |
| 154 content::InitializeSandbox(); |
| 155 } |
146 } | 156 } |
147 #endif | 157 #endif |
148 | 158 |
149 { | 159 { |
150 TRACE_EVENT0("gpu", "Initialize COM"); | 160 TRACE_EVENT0("gpu", "Initialize COM"); |
151 base::win::ScopedCOMInitializer com_initializer; | 161 base::win::ScopedCOMInitializer com_initializer; |
152 } | 162 } |
153 | 163 |
154 #if defined(OS_WIN) | 164 #if defined(OS_WIN) |
155 { | 165 { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 214 |
205 { | 215 { |
206 TRACE_EVENT0("gpu", "Run Message Loop"); | 216 TRACE_EVENT0("gpu", "Run Message Loop"); |
207 main_message_loop.Run(); | 217 main_message_loop.Run(); |
208 } | 218 } |
209 | 219 |
210 child_thread->StopWatchdog(); | 220 child_thread->StopWatchdog(); |
211 | 221 |
212 return 0; | 222 return 0; |
213 } | 223 } |
OLD | NEW |