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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
7 #include "chrome/common/chrome_constants.h" | 7 #include "chrome/common/chrome_constants.h" |
8 #include "chrome/common/chrome_switches.h" | |
8 #include "chrome/common/main_function_params.h" | 9 #include "chrome/common/main_function_params.h" |
9 #include "chrome/gpu/gpu_config.h" | 10 #include "chrome/gpu/gpu_config.h" |
10 #include "chrome/gpu/gpu_process.h" | 11 #include "chrome/gpu/gpu_process.h" |
11 #include "chrome/gpu/gpu_thread.h" | 12 #include "chrome/gpu/gpu_thread.h" |
12 | 13 |
13 #if defined(USE_LINUX_BREAKPAD) | 14 #if defined(USE_LINUX_BREAKPAD) |
14 #include "chrome/app/breakpad_linux.h" | 15 #include "chrome/app/breakpad_linux.h" |
15 #endif | 16 #endif |
16 | 17 |
17 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
18 #include "app/win_util.h" | 19 #include "app/win_util.h" |
19 #elif defined(GPU_USE_GLX) | 20 #elif defined(GPU_USE_GLX) |
20 #include <dlfcn.h> | 21 #include <dlfcn.h> |
21 #include <GL/glxew.h> | 22 #include <GL/glxew.h> |
22 #endif | 23 #endif |
23 | 24 |
24 // Main function for starting the Gpu process. | 25 // Main function for starting the Gpu process. |
25 int GpuMain(const MainFunctionParams& parameters) { | 26 int GpuMain(const MainFunctionParams& parameters) { |
26 #if defined(USE_LINUX_BREAKPAD) | 27 #if defined(USE_LINUX_BREAKPAD) |
27 // Needs to be called after we have chrome::DIR_USER_DATA. | 28 // Needs to be called after we have chrome::DIR_USER_DATA. |
28 InitCrashReporter(); | 29 InitCrashReporter(); |
29 #endif | 30 #endif |
30 | 31 |
32 const CommandLine& command_line = parameters.command_line_; | |
33 if (command_line.HasSwitch(switches::kGpuStartupDialog)) { | |
34 ChildProcess::WaitForDebugger(L"Gpu"); | |
brettw
2010/03/22 22:14:41
This doesn't seem right. We have "startup dialog"
| |
35 } | |
36 | |
31 MessageLoop main_message_loop(MessageLoop::TYPE_UI); | 37 MessageLoop main_message_loop(MessageLoop::TYPE_UI); |
32 std::wstring app_name = chrome::kBrowserAppName; | 38 std::wstring app_name = chrome::kBrowserAppName; |
33 PlatformThread::SetName(WideToASCII(app_name + L"_GpuMain").c_str()); | 39 PlatformThread::SetName(WideToASCII(app_name + L"_GpuMain").c_str()); |
34 | 40 |
35 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
36 win_util::ScopedCOMInitializer com_initializer; | 42 win_util::ScopedCOMInitializer com_initializer; |
37 #elif defined(GPU_USE_GLX) | 43 #elif defined(GPU_USE_GLX) |
38 dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL); | 44 dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL); |
39 glxewInit(); | 45 glxewInit(); |
40 #endif | 46 #endif |
41 | 47 |
42 GpuProcess gpu_process; | 48 GpuProcess gpu_process; |
43 gpu_process.set_main_thread(new GpuThread()); | 49 gpu_process.set_main_thread(new GpuThread()); |
44 | 50 |
45 main_message_loop.Run(); | 51 main_message_loop.Run(); |
46 | 52 |
47 return 0; | 53 return 0; |
48 } | 54 } |
49 | 55 |
OLD | NEW |