summaryrefslogtreecommitdiffstats
path: root/ui/aura
diff options
context:
space:
mode:
authorkylechar <kylechar@chromium.org>2016-03-23 11:56:35 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-23 18:57:49 +0000
commit4ed171b7b7cf88fea577208abbe901a125f675dc (patch)
tree3f6644583fdf741f20476e2462a9453889fc4ef2 /ui/aura
parenta1107b7873a0b930ff197da68c3eaacd751839d5 (diff)
downloadchromium_src-4ed171b7b7cf88fea577208abbe901a125f675dc.zip
chromium_src-4ed171b7b7cf88fea577208abbe901a125f675dc.tar.gz
chromium_src-4ed171b7b7cf88fea577208abbe901a125f675dc.tar.bz2
Stop chrome from initializing ozone inside mash.
The chrome UI process normally initializes ozone. When running inside mash the mus prcoess owns ozone instead. Add a check for a flag that signals chrome is running inside mash and don't initialize ozone in that case. BUG=592756 Review URL: https://codereview.chromium.org/1825733003 Cr-Commit-Position: refs/heads/master@{#382894}
Diffstat (limited to 'ui/aura')
-rw-r--r--ui/aura/env.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/ui/aura/env.cc b/ui/aura/env.cc
index 29e3964..7e82d4e 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();