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

Unified Diff: content/gpu/gpu_main.cc

Issue 2629983002: Fix the MessageLoop type in case more than one ozone platform is built (Closed)
Patch Set: addressed sadrul's remarks. Created 3 years, 10 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
Index: content/gpu/gpu_main.cc
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index 54791f60a1c8d8591c74e856c0562fd20a2d0d16..506fe89c18d2b55fa8d2a8d5224150288402bf22 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -81,6 +81,10 @@
#include "content/common/sandbox_mac.h"
#endif
+#if defined(USE_OZONE)
+#include "ui/ozone/public/ozone_platform.h"
+#endif
+
#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
#include "media/gpu/vaapi_wrapper.h"
#endif
@@ -218,13 +222,12 @@ int GpuMain(const MainFunctionParams& parameters) {
// and https://crbug.com/326995.
main_message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI));
event_source = ui::PlatformEventSource::CreateDefault();
-#elif defined(USE_OZONE) && defined(OZONE_X11)
- // If we might be running Ozone X11 we need a UI loop to grab Expose events.
- // See GLSurfaceGLX and https://crbug.com/326995.
- main_message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI));
#elif defined(USE_OZONE)
- main_message_loop.reset(
- new base::MessageLoop(base::MessageLoop::TYPE_DEFAULT));
+ // The MessageLoop type required depends on the Ozone platform selected at
+ // runtime.
+ ui::OzonePlatform::CreateInstance();
+ main_message_loop.reset(new base::MessageLoop(
+ ui::OzonePlatform::GetInstance()->GetMessageLoopTypeForGpu()));
#elif defined(OS_LINUX)
#error "Unsupported Linux platform."
#elif defined(OS_MACOSX)

Powered by Google App Engine
This is Rietveld 408576698