| 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 "base/threading/platform_thread.h" |
| 13 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 14 #include "chrome/common/chrome_constants.h" | 15 #include "chrome/common/chrome_constants.h" |
| 15 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
| 16 #include "chrome/common/env_vars.h" | 17 #include "chrome/common/env_vars.h" |
| 17 #include "chrome/common/main_function_params.h" | 18 #include "chrome/common/main_function_params.h" |
| 18 #include "chrome/gpu/gpu_config.h" | 19 #include "chrome/gpu/gpu_config.h" |
| 19 #include "chrome/gpu/gpu_process.h" | 20 #include "chrome/gpu/gpu_process.h" |
| 20 #include "chrome/gpu/gpu_thread.h" | 21 #include "chrome/gpu/gpu_thread.h" |
| 21 #include "chrome/gpu/gpu_watchdog_thread.h" | 22 #include "chrome/gpu/gpu_watchdog_thread.h" |
| 22 | 23 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 const CommandLine& command_line = parameters.command_line_; | 68 const CommandLine& command_line = parameters.command_line_; |
| 68 if (command_line.HasSwitch(switches::kGpuStartupDialog)) { | 69 if (command_line.HasSwitch(switches::kGpuStartupDialog)) { |
| 69 ChildProcess::WaitForDebugger(L"Gpu"); | 70 ChildProcess::WaitForDebugger(L"Gpu"); |
| 70 } | 71 } |
| 71 | 72 |
| 72 #if defined(OS_MACOSX) | 73 #if defined(OS_MACOSX) |
| 73 chrome_application_mac::RegisterCrApp(); | 74 chrome_application_mac::RegisterCrApp(); |
| 74 #endif | 75 #endif |
| 75 | 76 |
| 76 MessageLoop main_message_loop(MessageLoop::TYPE_UI); | 77 MessageLoop main_message_loop(MessageLoop::TYPE_UI); |
| 77 PlatformThread::SetName("CrGpuMain"); | 78 base::PlatformThread::SetName("CrGpuMain"); |
| 78 | 79 |
| 79 #if defined(OS_WIN) | 80 #if defined(OS_WIN) |
| 80 win_util::ScopedCOMInitializer com_initializer; | 81 win_util::ScopedCOMInitializer com_initializer; |
| 81 #endif | 82 #endif |
| 82 | 83 |
| 83 #if defined(USE_X11) | 84 #if defined(USE_X11) |
| 84 // The X11 port of the command buffer code assumes it can access the X | 85 // The X11 port of the command buffer code assumes it can access the X |
| 85 // display via the macro GDK_DISPLAY(), which implies that Gtk has been | 86 // display via the macro GDK_DISPLAY(), which implies that Gtk has been |
| 86 // initialized. This code was taken from PluginThread. TODO(kbr): | 87 // initialized. This code was taken from PluginThread. TODO(kbr): |
| 87 // rethink whether initializing Gtk is really necessary or whether we | 88 // rethink whether initializing Gtk is really necessary or whether we |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 watchdog_thread->Start(); | 150 watchdog_thread->Start(); |
| 150 } | 151 } |
| 151 | 152 |
| 152 main_message_loop.Run(); | 153 main_message_loop.Run(); |
| 153 | 154 |
| 154 if (enable_watchdog) | 155 if (enable_watchdog) |
| 155 watchdog_thread->Stop(); | 156 watchdog_thread->Stop(); |
| 156 | 157 |
| 157 return 0; | 158 return 0; |
| 158 } | 159 } |
| OLD | NEW |