Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: content/gpu/gpu_main.cc

Issue 1181263008: Revert of Don't peek messages in the MessagePumpForUI class when we receive our kMsgHaveWork message (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/message_loop/message_pump_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <dwmapi.h> 8 #include <dwmapi.h>
9 #include <windows.h> 9 #include <windows.h>
10 #endif 10 #endif
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 // safely until the IPC channel is set up, because the detection of 153 // safely until the IPC channel is set up, because the detection of
154 // early return of a child process is implemented using an IPC 154 // early return of a child process is implemented using an IPC
155 // channel error. If the IPC channel is not fully set up between the 155 // channel error. If the IPC channel is not fully set up between the
156 // browser and GPU process, and the GPU process crashes or exits 156 // browser and GPU process, and the GPU process crashes or exits
157 // early, the browser process will never detect it. For this reason 157 // early, the browser process will never detect it. For this reason
158 // we defer tearing down the GPU process until receiving the 158 // we defer tearing down the GPU process until receiving the
159 // GpuMsg_Initialize message from the browser. 159 // GpuMsg_Initialize message from the browser.
160 bool dead_on_arrival = false; 160 bool dead_on_arrival = false;
161 161
162 #if defined(OS_WIN) 162 #if defined(OS_WIN)
163 base::MessageLoop::Type loop_type = base::MessageLoop::TYPE_IO;
164 // Use a UI message loop because ANGLE and the desktop GL platform can 163 // Use a UI message loop because ANGLE and the desktop GL platform can
165 // create child windows to render to. 164 // create child windows to render to.
166 // TODO(ananta) : Recent changes to the UI message pump class on Windows 165 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI);
167 // will cause delays in tasks getting processed in the GPU process which
168 // will show up on the bots in webgl conformance tests, perf tests etc.
169 // It will be great if we can work around the issues with desktop GL and
170 // avoid creating a child window in the GPU process which requires a UI
171 // message pump.
172 if ((command_line.HasSwitch(switches::kUseGL) &&
173 command_line.GetSwitchValueASCII(switches::kUseGL) == "desktop") ||
174 (command_line.HasSwitch(switches::kUseANGLE) &&
175 command_line.GetSwitchValueASCII(switches::kUseANGLE) == "gl")) {
176 loop_type = base::MessageLoop::TYPE_UI;
177 }
178 base::MessageLoop main_message_loop(loop_type);
179 #elif defined(OS_LINUX) && defined(USE_X11) 166 #elif defined(OS_LINUX) && defined(USE_X11)
180 // We need a UI loop so that we can grab the Expose events. See GLSurfaceGLX 167 // We need a UI loop so that we can grab the Expose events. See GLSurfaceGLX
181 // and https://crbug.com/326995. 168 // and https://crbug.com/326995.
182 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); 169 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI);
183 scoped_ptr<ui::PlatformEventSource> event_source = 170 scoped_ptr<ui::PlatformEventSource> event_source =
184 ui::PlatformEventSource::CreateDefault(); 171 ui::PlatformEventSource::CreateDefault();
185 #elif defined(OS_LINUX) 172 #elif defined(OS_LINUX)
186 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT); 173 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT);
187 #elif defined(OS_MACOSX) 174 #elif defined(OS_MACOSX)
188 // This is necessary for CoreAnimation layers hosted in the GPU process to be 175 // This is necessary for CoreAnimation layers hosted in the GPU process to be
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 return true; 539 return true;
553 } 540 }
554 541
555 return false; 542 return false;
556 } 543 }
557 #endif // defined(OS_WIN) 544 #endif // defined(OS_WIN)
558 545
559 } // namespace. 546 } // namespace.
560 547
561 } // namespace content 548 } // namespace content
OLDNEW
« no previous file with comments | « base/message_loop/message_pump_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698