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

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 moar sadrul/kylechar'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
Index: content/gpu/gpu_main.cc
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index 54791f60a1c8d8591c74e856c0562fd20a2d0d16..105ada872b9be99bb1e8291c46e60228f59c446c 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,13 @@ 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));
+ // Create the OzonePlatform instance without doing any initialization.
+ // This is needed so that we can inquery a MessageLoopType, which varies
fwang 2017/02/07 17:03:46 inquire?
kylechar 2017/02/07 17:41:46 Maybe replace the last sentence with something lik
tonikitoo 2017/02/07 19:36:41 Done.
+ // depending on the runtime platform selection.
+ 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)
« no previous file with comments | « content/gpu/BUILD.gn ('k') | services/ui/gpu/gpu_main.cc » ('j') | services/ui/gpu/gpu_main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698