Commit d586e7bf authored by Mohsen Izadi's avatar Mohsen Izadi Committed by Commit Bot

Enable out-of-process viz service only when necessary

Viz process that can be run using service manager is only used when mash
is run in multi-process mode with out-of-process viz (i.e. when both
Mash and MashOopViz features or on). Currently, service manager uses
aura::Env mode (MUS vs LOCAL) to allow this which is wrong. Also, a
recent change (r611340) causes service manager to run before aura::Env
is created which breaks things further. This CL checks Mash and
MashOopViz features to allow out-of-process viz.

BUG=912218

Change-Id: Ib828acefd07abcb9ab134c9ed866fc3d4792de40
Reviewed-on: https://chromium-review.googlesource.com/c/1373883Reviewed-by: default avatarKen Rockot <rockot@google.com>
Commit-Queue: Mohsen Izadi <mohsen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616041}
parent 3a3a52b5
...@@ -97,10 +97,6 @@ ...@@ -97,10 +97,6 @@
#include "jni/ContentNfcDelegate_jni.h" #include "jni/ContentNfcDelegate_jni.h"
#endif #endif
#if defined(USE_AURA)
#include "ui/aura/env.h"
#endif
#if defined(OS_LINUX) #if defined(OS_LINUX)
#include "components/services/font/font_service_app.h" #include "components/services/font/font_service_app.h"
#include "components/services/font/public/interfaces/constants.mojom.h" #include "components/services/font/public/interfaces/constants.mojom.h"
...@@ -358,16 +354,6 @@ class DeviceServiceURLLoaderFactory : public network::SharedURLLoaderFactory { ...@@ -358,16 +354,6 @@ class DeviceServiceURLLoaderFactory : public network::SharedURLLoaderFactory {
DISALLOW_COPY_AND_ASSIGN(DeviceServiceURLLoaderFactory); DISALLOW_COPY_AND_ASSIGN(DeviceServiceURLLoaderFactory);
}; };
bool ShouldEnableVizService() {
#if defined(USE_AURA)
// aura::Env can be null in tests.
return aura::Env::HasInstance() &&
aura::Env::GetInstance()->mode() == aura::Env::Mode::MUS;
#else
return false;
#endif
}
std::unique_ptr<service_manager::Service> CreateNetworkService( std::unique_ptr<service_manager::Service> CreateNetworkService(
service_manager::mojom::ServiceRequest service_request) { service_manager::mojom::ServiceRequest service_request) {
// The test interface doesn't need to be implemented in the in-process case. // The test interface doesn't need to be implemented in the in-process case.
...@@ -766,7 +752,7 @@ ServiceManagerContext::ServiceManagerContext( ...@@ -766,7 +752,7 @@ ServiceManagerContext::ServiceManagerContext(
#endif // BUILDFLAG(ENABLE_CROS_LIBASSISTANT) #endif // BUILDFLAG(ENABLE_CROS_LIBASSISTANT)
#endif #endif
if (ShouldEnableVizService()) { if (features::IsMultiProcessMash() && features::IsMashOopVizEnabled()) {
out_of_process_services[viz::mojom::kVizServiceName] = out_of_process_services[viz::mojom::kVizServiceName] =
base::BindRepeating(&base::ASCIIToUTF16, "Visuals Service"); base::BindRepeating(&base::ASCIIToUTF16, "Visuals Service");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment