Index: ui/aura/env.cc |
diff --git a/ui/aura/env.cc b/ui/aura/env.cc |
index 058d94a05eef060058198e95c95a5f4d34ea1b5c..7a58b9125b61ddf5a40c786b23686d96ec51519b 100644 |
--- a/ui/aura/env.cc |
+++ b/ui/aura/env.cc |
@@ -24,12 +24,6 @@ namespace { |
base::LazyInstance<base::ThreadLocalPointer<Env> >::Leaky lazy_tls_ptr = |
LAZY_INSTANCE_INITIALIZER; |
-// Returns true if running inside of mus. Checks for mojo specific flag. |
-bool RunningInsideMus() { |
- return base::CommandLine::ForCurrentProcess()->HasSwitch( |
- "primordial-pipe-token"); |
-} |
- |
} // namespace |
//////////////////////////////////////////////////////////////////////////////// |
@@ -42,10 +36,11 @@ Env::~Env() { |
} |
// static |
-std::unique_ptr<Env> Env::CreateInstance() { |
+std::unique_ptr<Env> Env::CreateInstance(bool running_inside_mus, |
+ bool in_process_gpu) { |
DCHECK(!lazy_tls_ptr.Pointer()->Get()); |
std::unique_ptr<Env> env(new Env()); |
- env->Init(); |
+ env->Init(running_inside_mus, in_process_gpu); |
return env; |
} |
@@ -87,14 +82,16 @@ Env::Env() |
lazy_tls_ptr.Pointer()->Set(this); |
} |
-void Env::Init() { |
- if (RunningInsideMus()) |
+void Env::Init(bool running_inside_mus, bool in_process_gpu) { |
+ if (running_inside_mus) |
return; |
#if defined(USE_OZONE) |
// The ozone platform can provide its own event source. So initialize the |
// platform before creating the default event source. If running inside mus |
// let the mus process initialize ozone instead. |
- ui::OzonePlatform::InitializeForUI(); |
+ ui::OzonePlatform::InitParams ozoneInitParams; |
+ ozoneInitParams.single_process = in_process_gpu; |
+ ui::OzonePlatform::InitializeForUI(ozoneInitParams); |
#endif |
if (!ui::PlatformEventSource::GetInstance()) |
event_source_ = ui::PlatformEventSource::CreateDefault(); |