Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: content/gpu/gpu_main.cc

Issue 10915189: Show gpu process sandbox status in the about:gpu page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed .gitmodules. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/gpu/gpu_messages.h ('k') | content/public/common/gpu_info.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_messages.h ('k') | content/public/common/gpu_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698