| 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 |
| 11 #include "base/environment.h" | 11 #include "base/environment.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
| 14 #include "base/threading/platform_thread.h" | 14 #include "base/threading/platform_thread.h" |
| 15 #include "base/win/scoped_com_initializer.h" | 15 #include "base/win/scoped_com_initializer.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "content/common/gpu/gpu_config.h" | 17 #include "content/common/gpu/gpu_config.h" |
| 18 #include "content/common/main_function_params.h" | |
| 19 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
| 19 #include "content/public/common/main_function_params.h" |
| 20 #include "content/gpu/gpu_child_thread.h" | 20 #include "content/gpu/gpu_child_thread.h" |
| 21 #include "content/gpu/gpu_process.h" | 21 #include "content/gpu/gpu_process.h" |
| 22 #include "ui/gfx/gl/gl_surface.h" | 22 #include "ui/gfx/gl/gl_surface.h" |
| 23 #include "ui/gfx/gl/gl_switches.h" | 23 #include "ui/gfx/gl/gl_switches.h" |
| 24 | 24 |
| 25 #if defined(OS_MACOSX) | 25 #if defined(OS_MACOSX) |
| 26 #include "content/common/chrome_application_mac.h" | 26 #include "content/common/chrome_application_mac.h" |
| 27 #elif defined(OS_WIN) | 27 #elif defined(OS_WIN) |
| 28 #include "sandbox/src/sandbox.h" | 28 #include "sandbox/src/sandbox.h" |
| 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 content::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 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |