| OLD | NEW |
| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 bool dead_on_arrival = false; | 53 bool dead_on_arrival = false; |
| 54 | 54 |
| 55 // Load the GL implementation and locate the bindings before starting the GPU | 55 // Load the GL implementation and locate the bindings before starting the GPU |
| 56 // watchdog because this can take a lot of time and the GPU watchdog might | 56 // watchdog because this can take a lot of time and the GPU watchdog might |
| 57 // terminate the GPU process. | 57 // terminate the GPU process. |
| 58 if (!gfx::GLSurface::InitializeOneOff()) { | 58 if (!gfx::GLSurface::InitializeOneOff()) { |
| 59 LOG(INFO) << "GLContext::InitializeOneOff failed"; | 59 LOG(INFO) << "GLContext::InitializeOneOff failed"; |
| 60 dead_on_arrival = true; | 60 dead_on_arrival = true; |
| 61 } | 61 } |
| 62 | 62 |
| 63 base::win::ScopedCOMInitializer com_initializer; |
| 64 |
| 63 #if defined(OS_WIN) | 65 #if defined(OS_WIN) |
| 64 sandbox::TargetServices* target_services = | 66 sandbox::TargetServices* target_services = |
| 65 parameters.sandbox_info_.TargetServices(); | 67 parameters.sandbox_info_.TargetServices(); |
| 66 // For windows, if the target_services interface is not zero, the process | 68 // For windows, if the target_services interface is not zero, the process |
| 67 // is sandboxed and we must call LowerToken() before rendering untrusted | 69 // is sandboxed and we must call LowerToken() before rendering untrusted |
| 68 // content. | 70 // content. |
| 69 if (target_services) | 71 if (target_services) |
| 70 target_services->LowerToken(); | 72 target_services->LowerToken(); |
| 71 #endif | 73 #endif |
| 72 | 74 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 96 // able to load a DLL. | 98 // able to load a DLL. |
| 97 SetErrorMode( | 99 SetErrorMode( |
| 98 SEM_FAILCRITICALERRORS | | 100 SEM_FAILCRITICALERRORS | |
| 99 SEM_NOGPFAULTERRORBOX | | 101 SEM_NOGPFAULTERRORBOX | |
| 100 SEM_NOOPENFILEERRORBOX); | 102 SEM_NOOPENFILEERRORBOX); |
| 101 #elif defined(USE_X11) | 103 #elif defined(USE_X11) |
| 102 ui::SetDefaultX11ErrorHandlers(); | 104 ui::SetDefaultX11ErrorHandlers(); |
| 103 #endif | 105 #endif |
| 104 } | 106 } |
| 105 | 107 |
| 106 base::win::ScopedCOMInitializer com_initializer; | |
| 107 | |
| 108 GpuProcess gpu_process; | 108 GpuProcess gpu_process; |
| 109 | 109 |
| 110 GpuChildThread* child_thread = new GpuChildThread(dead_on_arrival); | 110 GpuChildThread* child_thread = new GpuChildThread(dead_on_arrival); |
| 111 | 111 |
| 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 } |
| OLD | NEW |