OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // will need to tear down this process. However, we can not do so | 100 // will need to tear down this process. However, we can not do so |
101 // safely until the IPC channel is set up, because the detection of | 101 // safely until the IPC channel is set up, because the detection of |
102 // early return of a child process is implemented using an IPC | 102 // early return of a child process is implemented using an IPC |
103 // channel error. If the IPC channel is not fully set up between the | 103 // channel error. If the IPC channel is not fully set up between the |
104 // browser and GPU process, and the GPU process crashes or exits | 104 // browser and GPU process, and the GPU process crashes or exits |
105 // early, the browser process will never detect it. For this reason | 105 // early, the browser process will never detect it. For this reason |
106 // we defer tearing down the GPU process until receiving the | 106 // we defer tearing down the GPU process until receiving the |
107 // GpuMsg_Initialize message from the browser. | 107 // GpuMsg_Initialize message from the browser. |
108 bool dead_on_arrival = false; | 108 bool dead_on_arrival = false; |
109 | 109 |
110 MessageLoop::Type message_loop_type = MessageLoop::TYPE_IO; | 110 base::MessageLoop::Type message_loop_type = base::MessageLoop::TYPE_IO; |
111 #if defined(OS_WIN) | 111 #if defined(OS_WIN) |
112 // Unless we're running on desktop GL, we don't need a UI message | 112 // Unless we're running on desktop GL, we don't need a UI message |
113 // loop, so avoid its use to work around apparent problems with some | 113 // loop, so avoid its use to work around apparent problems with some |
114 // third-party software. | 114 // third-party software. |
115 if (command_line.HasSwitch(switches::kUseGL) && | 115 if (command_line.HasSwitch(switches::kUseGL) && |
116 command_line.GetSwitchValueASCII(switches::kUseGL) == | 116 command_line.GetSwitchValueASCII(switches::kUseGL) == |
117 gfx::kGLImplementationDesktopName) { | 117 gfx::kGLImplementationDesktopName) { |
118 message_loop_type = MessageLoop::TYPE_UI; | 118 message_loop_type = base::MessageLoop::TYPE_UI; |
119 } | 119 } |
120 #elif defined(OS_LINUX) | 120 #elif defined(OS_LINUX) |
121 message_loop_type = MessageLoop::TYPE_DEFAULT; | 121 message_loop_type = base::MessageLoop::TYPE_DEFAULT; |
122 #endif | 122 #endif |
123 | 123 |
124 MessageLoop main_message_loop(message_loop_type); | 124 base::MessageLoop main_message_loop(message_loop_type); |
125 base::PlatformThread::SetName("CrGpuMain"); | 125 base::PlatformThread::SetName("CrGpuMain"); |
126 | 126 |
127 // In addition to disabling the watchdog if the command line switch is | 127 // In addition to disabling the watchdog if the command line switch is |
128 // present, disable the watchdog on valgrind because the code is expected | 128 // present, disable the watchdog on valgrind because the code is expected |
129 // to run slowly in that case. | 129 // to run slowly in that case. |
130 bool enable_watchdog = | 130 bool enable_watchdog = |
131 !CommandLine::ForCurrentProcess()->HasSwitch( | 131 !CommandLine::ForCurrentProcess()->HasSwitch( |
132 switches::kDisableGpuWatchdog) && | 132 switches::kDisableGpuWatchdog) && |
133 !RunningOnValgrind(); | 133 !RunningOnValgrind(); |
134 | 134 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 return true; | 390 return true; |
391 } | 391 } |
392 | 392 |
393 return false; | 393 return false; |
394 } | 394 } |
395 #endif // defined(OS_WIN) | 395 #endif // defined(OS_WIN) |
396 | 396 |
397 } // namespace. | 397 } // namespace. |
398 | 398 |
399 } // namespace content | 399 } // namespace content |
OLD | NEW |