Commit aadadcd5 authored by Sadrul Habib Chowdhury's avatar Sadrul Habib Chowdhury Committed by Commit Bot

mus/viz: Renderer needs to know the real viz host.

Renderer needs to talk to the browser if browser is hosting viz, even
when running with mus. So make sure renderer talks to the right process
for viz-related communication.

BUG=786453

Change-Id: I3561d9f1d8ae14bc35a34125fd55df773afeeca1
Reviewed-on: https://chromium-review.googlesource.com/777439
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarFady Samuel <fsamuel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517704}
parent 4d8458e2
......@@ -333,6 +333,16 @@ void AddHistogramSample(void* hist, int sample) {
histogram->Add(sample);
}
bool IsMusHostingViz() {
#if BUILDFLAG(ENABLE_MUS)
const auto* cmdline = base::CommandLine::ForCurrentProcess();
return cmdline->GetSwitchValueASCII(switches::kMus) ==
switches::kMusHostVizValue;
#else
return false;
#endif
}
class FrameFactoryImpl : public mojom::FrameFactory {
public:
explicit FrameFactoryImpl(const service_manager::BindSourceInfo& source_info)
......@@ -690,7 +700,7 @@ void RenderThreadImpl::Init(
gpu_ = ui::Gpu::Create(
GetConnector(),
IsRunningWithMus() ? ui::mojom::kServiceName : mojom::kBrowserServiceName,
IsMusHostingViz() ? ui::mojom::kServiceName : mojom::kBrowserServiceName,
GetIOTaskRunner());
viz::mojom::SharedBitmapAllocationNotifierPtr
......@@ -2043,7 +2053,7 @@ void RenderThreadImpl::RequestNewLayerTreeFrameSink(
}
#if defined(USE_AURA)
if (IsRunningWithMus()) {
if (IsMusHostingViz()) {
if (!RendererWindowTreeClient::Get(routing_id)) {
callback.Run(nullptr);
return;
......
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