| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 TRACE_EVENT0("gpu", "Initialize sandbox"); | 151 TRACE_EVENT0("gpu", "Initialize sandbox"); |
| 152 bool do_init_sandbox = true; | 152 bool do_init_sandbox = true; |
| 153 | 153 |
| 154 #if defined(OS_CHROMEOS) && defined(NDEBUG) | 154 #if defined(OS_CHROMEOS) && defined(NDEBUG) |
| 155 // On Chrome OS and when not on a debug build, initialize | 155 // On Chrome OS and when not on a debug build, initialize |
| 156 // the GPU process' sandbox only for Intel GPUs. | 156 // the GPU process' sandbox only for Intel GPUs. |
| 157 do_init_sandbox = gpu_info.gpu.vendor_id == 0x8086; // Intel GPU. | 157 do_init_sandbox = gpu_info.gpu.vendor_id == 0x8086; // Intel GPU. |
| 158 #endif | 158 #endif |
| 159 | 159 |
| 160 if (do_init_sandbox) { | 160 if (do_init_sandbox) { |
| 161 content::InitializeSandbox(); | 161 gpu_info.sandboxed = content::InitializeSandbox(); |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 #endif | 164 #endif |
| 165 | 165 |
| 166 #if defined(OS_WIN) | 166 #if defined(OS_WIN) |
| 167 { | 167 { |
| 168 TRACE_EVENT0("gpu", "Lower token"); | 168 TRACE_EVENT0("gpu", "Lower token"); |
| 169 // For windows, if the target_services interface is not zero, the process | 169 // For windows, if the target_services interface is not zero, the process |
| 170 // is sandboxed and we must call LowerToken() before rendering untrusted | 170 // is sandboxed and we must call LowerToken() before rendering untrusted |
| 171 // content. | 171 // content. |
| 172 sandbox::TargetServices* target_services = | 172 sandbox::TargetServices* target_services = |
| 173 parameters.sandbox_info->target_services; | 173 parameters.sandbox_info->target_services; |
| 174 if (target_services) | 174 if (target_services) { |
| 175 target_services->LowerToken(); | 175 target_services->LowerToken(); |
| 176 gpu_info.sandboxed = true; |
| 177 } |
| 176 } | 178 } |
| 177 #endif | 179 #endif |
| 178 | 180 |
| 179 MessageLoop::Type message_loop_type = MessageLoop::TYPE_IO; | 181 MessageLoop::Type message_loop_type = MessageLoop::TYPE_IO; |
| 180 #if defined(OS_WIN) | 182 #if defined(OS_WIN) |
| 181 // Unless we're running on desktop GL, we don't need a UI message | 183 // Unless we're running on desktop GL, we don't need a UI message |
| 182 // loop, so avoid its use to work around apparent problems with some | 184 // loop, so avoid its use to work around apparent problems with some |
| 183 // third-party software. | 185 // third-party software. |
| 184 if (command_line.HasSwitch(switches::kUseGL) && | 186 if (command_line.HasSwitch(switches::kUseGL) && |
| 185 command_line.GetSwitchValueASCII(switches::kUseGL) == | 187 command_line.GetSwitchValueASCII(switches::kUseGL) == |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 } | 298 } |
| 297 | 299 |
| 298 void CollectGraphicsInfo(content::GPUInfo* gpu_info) { | 300 void CollectGraphicsInfo(content::GPUInfo* gpu_info) { |
| 299 if (!gpu_info_collector::CollectGraphicsInfo(gpu_info)) | 301 if (!gpu_info_collector::CollectGraphicsInfo(gpu_info)) |
| 300 VLOG(1) << "gpu_info_collector::CollectGraphicsInfo failed"; | 302 VLOG(1) << "gpu_info_collector::CollectGraphicsInfo failed"; |
| 301 content::GetContentClient()->SetGpuInfo(*gpu_info); | 303 content::GetContentClient()->SetGpuInfo(*gpu_info); |
| 302 } | 304 } |
| 303 | 305 |
| 304 } // namespace. | 306 } // namespace. |
| 305 | 307 |
| OLD | NEW |