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

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 kbr's feedback 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
« no previous file with comments | « content/gpu/BUILD.gn ('k') | services/ui/gpu/gpu_main.cc » ('j') | 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 54791f60a1c8d8591c74e856c0562fd20a2d0d16..923b1fdded34df046ffb4c60acfcf4de20e72847 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,11 @@ 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.
+ main_message_loop.reset(new base::MessageLoop(
+ ui::OzonePlatform::EnsureInstance()->GetMessageLoopTypeForGpu()));
#elif defined(OS_LINUX)
#error "Unsupported Linux platform."
#elif defined(OS_MACOSX)
« no previous file with comments | « content/gpu/BUILD.gn ('k') | services/ui/gpu/gpu_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698