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

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

Issue 1194673004: 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: Fix the crash reported in bug 501602. The patch description has been updated with comments about th… 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
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;
163 // Use a UI message loop because ANGLE and the desktop GL platform can 164 // Use a UI message loop because ANGLE and the desktop GL platform can
164 // create child windows to render to. 165 // create child windows to render to.
165 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); 166 // TODO(ananta) : Recent changes to the UI message pump class on Windows
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);
166 #elif defined(OS_LINUX) && defined(USE_X11) 179 #elif defined(OS_LINUX) && defined(USE_X11)
167 // We need a UI loop so that we can grab the Expose events. See GLSurfaceGLX 180 // We need a UI loop so that we can grab the Expose events. See GLSurfaceGLX
168 // and https://crbug.com/326995. 181 // and https://crbug.com/326995.
169 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); 182 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI);
170 scoped_ptr<ui::PlatformEventSource> event_source = 183 scoped_ptr<ui::PlatformEventSource> event_source =
171 ui::PlatformEventSource::CreateDefault(); 184 ui::PlatformEventSource::CreateDefault();
172 #elif defined(OS_LINUX) 185 #elif defined(OS_LINUX)
173 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT); 186 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT);
174 #elif defined(OS_MACOSX) 187 #elif defined(OS_MACOSX)
175 // This is necessary for CoreAnimation layers hosted in the GPU process to be 188 // 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
539 return true; 552 return true;
540 } 553 }
541 554
542 return false; 555 return false;
543 } 556 }
544 #endif // defined(OS_WIN) 557 #endif // defined(OS_WIN)
545 558
546 } // namespace. 559 } // namespace.
547 560
548 } // namespace content 561 } // namespace content
OLDNEW
« base/message_loop/message_pump_win.cc ('K') | « 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