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

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

Issue 8414020: Expose the sandbox related code through the content API. I did a bit of cleanup while I was doing... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 18 matching lines...) Expand all
29 #endif 29 #endif
30 30
31 #if defined(USE_X11) 31 #if defined(USE_X11)
32 #include "ui/base/x/x11_util.h" 32 #include "ui/base/x/x11_util.h"
33 #endif 33 #endif
34 34
35 // Main function for starting the Gpu process. 35 // Main function for starting the Gpu process.
36 int GpuMain(const MainFunctionParams& parameters) { 36 int GpuMain(const MainFunctionParams& parameters) {
37 base::Time start_time = base::Time::Now(); 37 base::Time start_time = base::Time::Now();
38 38
39 const CommandLine& command_line = parameters.command_line_; 39 const CommandLine& command_line = parameters.command_line;
40 if (command_line.HasSwitch(switches::kGpuStartupDialog)) { 40 if (command_line.HasSwitch(switches::kGpuStartupDialog)) {
41 ChildProcess::WaitForDebugger("Gpu"); 41 ChildProcess::WaitForDebugger("Gpu");
42 } 42 }
43 43
44 if (!command_line.HasSwitch(switches::kSingleProcess)) { 44 if (!command_line.HasSwitch(switches::kSingleProcess)) {
45 #if defined(OS_WIN) 45 #if defined(OS_WIN)
46 // Prevent Windows from displaying a modal dialog on failures like not being 46 // Prevent Windows from displaying a modal dialog on failures like not being
47 // able to load a DLL. 47 // able to load a DLL.
48 SetErrorMode( 48 SetErrorMode(
49 SEM_FAILCRITICALERRORS | 49 SEM_FAILCRITICALERRORS |
(...skipping 20 matching lines...) Expand all
70 // terminate the GPU process. 70 // terminate the GPU process.
71 if (!gfx::GLSurface::InitializeOneOff()) { 71 if (!gfx::GLSurface::InitializeOneOff()) {
72 LOG(INFO) << "gfx::GLSurface::InitializeOneOff failed"; 72 LOG(INFO) << "gfx::GLSurface::InitializeOneOff failed";
73 dead_on_arrival = true; 73 dead_on_arrival = true;
74 } 74 }
75 75
76 base::win::ScopedCOMInitializer com_initializer; 76 base::win::ScopedCOMInitializer com_initializer;
77 77
78 #if defined(OS_WIN) 78 #if defined(OS_WIN)
79 sandbox::TargetServices* target_services = 79 sandbox::TargetServices* target_services =
80 parameters.sandbox_info_.TargetServices(); 80 parameters.sandbox_info->target_services;
81 // For windows, if the target_services interface is not zero, the process 81 // For windows, if the target_services interface is not zero, the process
82 // is sandboxed and we must call LowerToken() before rendering untrusted 82 // is sandboxed and we must call LowerToken() before rendering untrusted
83 // content. 83 // content.
84 if (target_services) 84 if (target_services)
85 target_services->LowerToken(); 85 target_services->LowerToken();
86 #endif 86 #endif
87 87
88 #if defined(OS_MACOSX) 88 #if defined(OS_MACOSX)
89 chrome_application_mac::RegisterCrApp(); 89 chrome_application_mac::RegisterCrApp();
90 #endif 90 #endif
(...skipping 21 matching lines...) Expand all
112 child_thread->Init(start_time); 112 child_thread->Init(start_time);
113 113
114 gpu_process.set_main_thread(child_thread); 114 gpu_process.set_main_thread(child_thread);
115 115
116 main_message_loop.Run(); 116 main_message_loop.Run();
117 117
118 child_thread->StopWatchdog(); 118 child_thread->StopWatchdog();
119 119
120 return 0; 120 return 0;
121 } 121 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698