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

Unified Diff: content/gpu/gpu_main.cc

Issue 279163005: Change the GPU process to use a CFRunLoop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/message_loop/message_pump_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/gpu/gpu_main.cc
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index 0dac81d459486c2f04a8a862b9afedc92e47e284..46549d1dfdaa07a6f0d6786d54c9f07853e451ef 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -51,6 +51,10 @@
#include "content/public/common/sandbox_init.h"
#endif
+#if defined(OS_MACOSX)
+#include "base/message_loop/message_pump_mac.h"
+#endif
+
const int kGpuTimeout = 10000;
namespace content {
@@ -129,8 +133,8 @@ int GpuMain(const MainFunctionParams& parameters) {
// GpuMsg_Initialize message from the browser.
bool dead_on_arrival = false;
- base::MessageLoop::Type message_loop_type = base::MessageLoop::TYPE_IO;
#if defined(OS_WIN)
+ base::MessageLoop::Type message_loop_type = base::MessageLoop::TYPE_IO;
// Unless we're running on desktop GL, we don't need a UI message
// loop, so avoid its use to work around apparent problems with some
// third-party software.
@@ -139,11 +143,18 @@ int GpuMain(const MainFunctionParams& parameters) {
gfx::kGLImplementationDesktopName) {
message_loop_type = base::MessageLoop::TYPE_UI;
}
+ base::MessageLoop main_message_loop(message_loop_type);
#elif defined(OS_LINUX)
- message_loop_type = base::MessageLoop::TYPE_DEFAULT;
+ base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT);
+#elif defined(OS_MACOSX)
+ // This is necessary for CoreAnimation layers hosted in the GPU process to be
+ // drawn. See http://crbug.com/312462.
+ scoped_ptr<base::MessagePump> pump(new base::MessagePumpCFRunLoop());
+ base::MessageLoop main_message_loop(pump.Pass());
+#else
+ base::MessageLoop main_message_loop(base::MessageLoop::TYPE_IO);
#endif
- base::MessageLoop main_message_loop(message_loop_type);
base::PlatformThread::SetName("CrGpuMain");
// In addition to disabling the watchdog if the command line switch is
« no previous file with comments | « base/message_loop/message_pump_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698