| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "app/app_switches.h" | 7 #include "app/app_switches.h" |
| 8 #include "app/gfx/gl/gl_context.h" | 8 #include "app/gfx/gl/gl_context.h" |
| 9 #include "app/gfx/gl/gl_implementation.h" | 9 #include "app/gfx/gl/gl_implementation.h" |
| 10 #include "base/environment.h" | 10 #include "base/environment.h" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "chrome/common/chrome_constants.h" | 14 #include "chrome/common/chrome_constants.h" |
| 15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
| 16 #include "chrome/common/env_vars.h" | 16 #include "chrome/common/env_vars.h" |
| 17 #include "chrome/common/main_function_params.h" | 17 #include "chrome/common/main_function_params.h" |
| 18 #include "chrome/gpu/gpu_config.h" | 18 #include "chrome/gpu/gpu_config.h" |
| 19 #include "chrome/gpu/gpu_process.h" | 19 #include "chrome/gpu/gpu_process.h" |
| 20 #include "chrome/gpu/gpu_thread.h" | 20 #include "chrome/gpu/gpu_thread.h" |
| 21 #include "chrome/gpu/gpu_watchdog_thread.h" | 21 #include "chrome/gpu/gpu_watchdog_thread.h" |
| 22 | 22 |
| 23 #if defined(USE_LINUX_BREAKPAD) | 23 #if defined(USE_LINUX_BREAKPAD) |
| 24 #include "chrome/app/breakpad_linux.h" | 24 #include "chrome/app/breakpad_linux.h" |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 #if defined(OS_MACOSX) | 27 #if defined(OS_MACOSX) |
| 28 #include "chrome/common/chrome_application_mac.h" |
| 28 #include "chrome/common/sandbox_mac.h" | 29 #include "chrome/common/sandbox_mac.h" |
| 29 #endif | 30 #endif |
| 30 | 31 |
| 31 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
| 32 #include "app/win_util.h" | 33 #include "app/win_util.h" |
| 33 #endif | 34 #endif |
| 34 | 35 |
| 35 #if defined(USE_X11) | 36 #if defined(USE_X11) |
| 36 #include "gfx/gtk_util.h" | 37 #include "gfx/gtk_util.h" |
| 37 #endif | 38 #endif |
| (...skipping 30 matching lines...) Expand all Loading... |
| 68 // process name that shows up in "ps" etc. for the GPU process show as | 69 // process name that shows up in "ps" etc. for the GPU process show as |
| 69 // "exe" instead of "chrome" or something reasonable. Try to fix it. | 70 // "exe" instead of "chrome" or something reasonable. Try to fix it. |
| 70 CommandLine::SetProcTitle(); | 71 CommandLine::SetProcTitle(); |
| 71 #endif | 72 #endif |
| 72 | 73 |
| 73 const CommandLine& command_line = parameters.command_line_; | 74 const CommandLine& command_line = parameters.command_line_; |
| 74 if (command_line.HasSwitch(switches::kGpuStartupDialog)) { | 75 if (command_line.HasSwitch(switches::kGpuStartupDialog)) { |
| 75 ChildProcess::WaitForDebugger(L"Gpu"); | 76 ChildProcess::WaitForDebugger(L"Gpu"); |
| 76 } | 77 } |
| 77 | 78 |
| 79 #if defined(OS_MACOSX) |
| 80 chrome_application_mac::RegisterCrApp(); |
| 81 #endif |
| 82 |
| 78 MessageLoop main_message_loop(MessageLoop::TYPE_UI); | 83 MessageLoop main_message_loop(MessageLoop::TYPE_UI); |
| 79 PlatformThread::SetName("CrGpuMain"); | 84 PlatformThread::SetName("CrGpuMain"); |
| 80 | 85 |
| 81 #if defined(OS_WIN) | 86 #if defined(OS_WIN) |
| 82 win_util::ScopedCOMInitializer com_initializer; | 87 win_util::ScopedCOMInitializer com_initializer; |
| 83 #endif | 88 #endif |
| 84 | 89 |
| 85 #if defined(USE_X11) | 90 #if defined(USE_X11) |
| 86 // The X11 port of the command buffer code assumes it can access the X | 91 // The X11 port of the command buffer code assumes it can access the X |
| 87 // display via the macro GDK_DISPLAY(), which implies that Gtk has been | 92 // display via the macro GDK_DISPLAY(), which implies that Gtk has been |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 watchdog_thread->Start(); | 156 watchdog_thread->Start(); |
| 152 } | 157 } |
| 153 | 158 |
| 154 main_message_loop.Run(); | 159 main_message_loop.Run(); |
| 155 | 160 |
| 156 if (enable_watchdog) | 161 if (enable_watchdog) |
| 157 watchdog_thread->Stop(); | 162 watchdog_thread->Stop(); |
| 158 | 163 |
| 159 return 0; | 164 return 0; |
| 160 } | 165 } |
| OLD | NEW |