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

Unified Diff: ui/aura/env.cc

Issue 1825733003: Stop chrome from initializing ozone inside mash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unused with #ifdef. Created 4 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/env.cc
diff --git a/ui/aura/env.cc b/ui/aura/env.cc
index 29e3964d0c26c5d2f750c8e9b250c953ba11ccfb..7e82d4e13cdba8de340959236efcea0cff0e1c4d 100644
--- a/ui/aura/env.cc
+++ b/ui/aura/env.cc
@@ -4,6 +4,7 @@
#include "ui/aura/env.h"
+#include "base/command_line.h"
#include "base/lazy_instance.h"
#include "base/threading/thread_local.h"
#include "ui/aura/env_observer.h"
@@ -23,6 +24,14 @@ namespace {
base::LazyInstance<base::ThreadLocalPointer<Env> >::Leaky lazy_tls_ptr =
LAZY_INSTANCE_INITIALIZER;
+#if defined(USE_OZONE)
+// Returns true if running inside of mus. Checks for mojo specific flag.
+bool RunningInsideMus() {
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ "primordial-pipe-token");
+}
+#endif
+
} // namespace
////////////////////////////////////////////////////////////////////////////////
@@ -88,8 +97,10 @@ void Env::Init(bool create_event_source) {
return;
#if defined(USE_OZONE)
// The ozone platform can provide its own event source. So initialize the
- // platform before creating the default event source.
- ui::OzonePlatform::InitializeForUI();
+ // platform before creating the default event source. If running inside mus
+ // let the mus process initialize ozone instead.
+ if (!RunningInsideMus())
+ ui::OzonePlatform::InitializeForUI();
#endif
if (!ui::PlatformEventSource::GetInstance())
event_source_ = ui::PlatformEventSource::CreateDefault();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698