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 "app/win/scoped_com_initializer.h" |
11 #include "base/environment.h" | 12 #include "base/environment.h" |
12 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
13 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
14 #include "base/threading/platform_thread.h" | 15 #include "base/threading/platform_thread.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/content_switches.h" | 17 #include "content/common/content_switches.h" |
18 #include "content/common/gpu/gpu_config.h" | 18 #include "content/common/gpu/gpu_config.h" |
19 #include "content/common/main_function_params.h" | 19 #include "content/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 | 22 |
23 #if defined(OS_MACOSX) | 23 #if defined(OS_MACOSX) |
24 #include "content/common/chrome_application_mac.h" | 24 #include "content/common/chrome_application_mac.h" |
25 #endif | 25 #endif |
(...skipping 24 matching lines...) Expand all Loading... |
50 // able to load a DLL. | 50 // able to load a DLL. |
51 SetErrorMode( | 51 SetErrorMode( |
52 SEM_FAILCRITICALERRORS | | 52 SEM_FAILCRITICALERRORS | |
53 SEM_NOGPFAULTERRORBOX | | 53 SEM_NOGPFAULTERRORBOX | |
54 SEM_NOOPENFILEERRORBOX); | 54 SEM_NOOPENFILEERRORBOX); |
55 #elif defined(USE_X11) | 55 #elif defined(USE_X11) |
56 ui::SetDefaultX11ErrorHandlers(); | 56 ui::SetDefaultX11ErrorHandlers(); |
57 #endif | 57 #endif |
58 } | 58 } |
59 | 59 |
60 base::win::ScopedCOMInitializer com_initializer; | 60 app::win::ScopedCOMInitializer com_initializer; |
61 | 61 |
62 // We can not tolerate early returns from this code, because the | 62 // We can not tolerate early returns from this code, because the |
63 // detection of early return of a child process is implemented using | 63 // detection of early return of a child process is implemented using |
64 // an IPC channel error. If the IPC channel is not fully set up | 64 // an IPC channel error. If the IPC channel is not fully set up |
65 // between the browser and GPU process, and the GPU process crashes | 65 // between the browser and GPU process, and the GPU process crashes |
66 // or exits early, the browser process will never detect it. For | 66 // or exits early, the browser process will never detect it. For |
67 // this reason we defer all work related to the GPU until receiving | 67 // this reason we defer all work related to the GPU until receiving |
68 // the GpuMsg_Initialize message from the browser. | 68 // the GpuMsg_Initialize message from the browser. |
69 GpuProcess gpu_process; | 69 GpuProcess gpu_process; |
70 | 70 |
71 GpuChildThread* child_thread = | 71 GpuChildThread* child_thread = |
72 #if defined(OS_WIN) | 72 #if defined(OS_WIN) |
73 new GpuChildThread(parameters.sandbox_info_.TargetServices()); | 73 new GpuChildThread(parameters.sandbox_info_.TargetServices()); |
74 #else | 74 #else |
75 new GpuChildThread; | 75 new GpuChildThread; |
76 #endif | 76 #endif |
77 | 77 |
78 child_thread->Init(start_time); | 78 child_thread->Init(start_time); |
79 | 79 |
80 gpu_process.set_main_thread(child_thread); | 80 gpu_process.set_main_thread(child_thread); |
81 | 81 |
82 main_message_loop.Run(); | 82 main_message_loop.Run(); |
83 | 83 |
84 child_thread->StopWatchdog(); | 84 child_thread->StopWatchdog(); |
85 | 85 |
86 return 0; | 86 return 0; |
87 } | 87 } |
OLD | NEW |