|
40 | 40 | #include "gpu/ipc/service/gpu_memory_buffer_factory.h"
|
41 | 41 | #include "gpu/ipc/service/gpu_watchdog_thread.h"
|
42 | 42 | #include "ui/events/platform/platform_event_source.h"
|
43 |
| -#include "ui/gfx/switches.h" |
44 | 43 | #include "ui/gl/gl_context.h"
|
45 | 44 | #include "ui/gl/gl_implementation.h"
|
46 | 45 | #include "ui/gl/gl_surface.h"
|
@@ -201,39 +200,35 @@ int GpuMain(const MainFunctionParams& parameters) {
|
201 | 200 | // TODO(ericrk): Revisit this once we assess its impact on crbug.com/662802
|
202 | 201 | // and crbug.com/609252.
|
203 | 202 | std::unique_ptr<base::MessageLoop> main_message_loop;
|
204 |
| - if (command_line.HasSwitch(switches::kHeadless)) { |
205 |
| - main_message_loop.reset( |
206 |
| - new base::MessageLoop(base::MessageLoop::TYPE_DEFAULT)); |
207 |
| - } else { |
| 203 | + |
208 | 204 | #if defined(OS_WIN)
|
209 |
| - // OK to use default non-UI message loop because all GPU windows run on |
210 |
| - // dedicated thread. |
211 |
| - main_message_loop.reset( |
212 |
| - new base::MessageLoop(base::MessageLoop::TYPE_DEFAULT)); |
| 205 | + // OK to use default non-UI message loop because all GPU windows run on |
| 206 | + // dedicated thread. |
| 207 | + main_message_loop.reset( |
| 208 | + new base::MessageLoop(base::MessageLoop::TYPE_DEFAULT)); |
213 | 209 | #elif defined(USE_X11)
|
214 |
| - // We need a UI loop so that we can grab the Expose events. See GLSurfaceGLX |
215 |
| - // and https://crbug.com/326995. |
216 |
| - main_message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); |
217 |
| - std::unique_ptr<ui::PlatformEventSource> event_source = |
218 |
| - ui::PlatformEventSource::CreateDefault(); |
| 210 | + // We need a UI loop so that we can grab the Expose events. See GLSurfaceGLX |
| 211 | + // and https://crbug.com/326995. |
| 212 | + main_message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); |
| 213 | + std::unique_ptr<ui::PlatformEventSource> event_source = |
| 214 | + ui::PlatformEventSource::CreateDefault(); |
219 | 215 | #elif defined(USE_OZONE) && defined(OZONE_X11)
|
220 |
| - // If we might be running Ozone X11 we need a UI loop to grab Expose events. |
221 |
| - // See GLSurfaceGLX and https://crbug.com/326995. |
222 |
| - main_message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); |
| 216 | + // If we might be running Ozone X11 we need a UI loop to grab Expose events. |
| 217 | + // See GLSurfaceGLX and https://crbug.com/326995. |
| 218 | + main_message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); |
223 | 219 | #elif defined(USE_OZONE)
|
224 |
| - main_message_loop.reset( |
225 |
| - new base::MessageLoop(base::MessageLoop::TYPE_DEFAULT)); |
| 220 | + main_message_loop.reset( |
| 221 | + new base::MessageLoop(base::MessageLoop::TYPE_DEFAULT)); |
226 | 222 | #elif defined(OS_LINUX)
|
227 | 223 | #error "Unsupported Linux platform."
|
228 | 224 | #elif defined(OS_MACOSX)
|
229 |
| - // This is necessary for CoreAnimation layers hosted in the GPU process to |
230 |
| - // be drawn. See http://crbug.com/312462. |
231 |
| - std::unique_ptr<base::MessagePump> pump(new base::MessagePumpCFRunLoop()); |
232 |
| - main_message_loop.reset(new base::MessageLoop(std::move(pump))); |
| 225 | + // This is necessary for CoreAnimation layers hosted in the GPU process to be |
| 226 | + // drawn. See http://crbug.com/312462. |
| 227 | + std::unique_ptr<base::MessagePump> pump(new base::MessagePumpCFRunLoop()); |
| 228 | + main_message_loop.reset(new base::MessageLoop(std::move(pump))); |
233 | 229 | #else
|
234 |
| - main_message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_IO)); |
| 230 | + main_message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_IO)); |
235 | 231 | #endif
|
236 |
| - } |
237 | 232 |
|
238 | 233 | base::PlatformThread::SetName("CrGpuMain");
|
239 | 234 |
|
|
0 commit comments