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

Unified Diff: ui/aura/mus/mus_context_factory.cc

Issue 2886873002: Only send the FrameSinkId to client when it is necessary (Closed)
Patch Set: WIP Created 3 years, 7 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
Index: ui/aura/mus/mus_context_factory.cc
diff --git a/ui/aura/mus/mus_context_factory.cc b/ui/aura/mus/mus_context_factory.cc
index 9517875318f35ee39d05ef00313a8b7970cf1c18..b904bf589366f85ed160ae236ae71e244f1dc48e 100644
--- a/ui/aura/mus/mus_context_factory.cc
+++ b/ui/aura/mus/mus_context_factory.cc
@@ -26,18 +26,10 @@ void MusContextFactory::OnEstablishedGpuChannel(
WindowTreeHost::GetForAcceleratedWidget(compositor->widget());
WindowPortMus* window_port = WindowPortMus::Get(host->window());
DCHECK(window_port);
- window_port->RequestCompositorFrameSink(
- gpu_->CreateContextProvider(std::move(gpu_channel)),
- gpu_->gpu_memory_buffer_manager(),
- base::Bind(&MusContextFactory::OnCompositorFrameSinkAvailable,
- weak_ptr_factory_.GetWeakPtr(), compositor));
-}
-
-void MusContextFactory::OnCompositorFrameSinkAvailable(
- base::WeakPtr<ui::Compositor> compositor,
- std::unique_ptr<cc::CompositorFrameSink> compositor_frame_sink) {
- if (!compositor)
- return;
+ std::unique_ptr<cc::CompositorFrameSink> compositor_frame_sink =
+ window_port->RequestCompositorFrameSink(
+ gpu_->CreateContextProvider(std::move(gpu_channel)),
+ gpu_->gpu_memory_buffer_manager());
compositor->SetCompositorFrameSink(std::move(compositor_frame_sink));
}

Powered by Google App Engine
This is Rietveld 408576698