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

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

Issue 2886873002: Only send the FrameSinkId to client when it is necessary (Closed)
Patch Set: Address review issues. 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
« no previous file with comments | « ui/aura/mus/window_port_mus.h ('k') | ui/aura/mus/window_tree_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_port_mus.cc
diff --git a/ui/aura/mus/window_port_mus.cc b/ui/aura/mus/window_port_mus.cc
index 4c98ed4558a036614237a01cf0d8aa1497009064..b946380ee01b382faa7ee45716b51182c7f698b6 100644
--- a/ui/aura/mus/window_port_mus.cc
+++ b/ui/aura/mus/window_port_mus.cc
@@ -93,39 +93,19 @@ void WindowPortMus::Embed(
window_tree_client_->Embed(window_, std::move(client), flags, callback);
}
-void WindowPortMus::RequestCompositorFrameSink(
- scoped_refptr<cc::ContextProvider> context_provider,
- gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
- const CompositorFrameSinkCallback& callback) {
- DCHECK(pending_compositor_frame_sink_request_.is_null());
- // If we haven't received a FrameSinkId from the window server yet then we
- // bind the parameters to a closure that will be called once the FrameSinkId
- // is available.
- if (!frame_sink_id_.is_valid()) {
- pending_compositor_frame_sink_request_ =
- base::Bind(&WindowPortMus::RequestCompositorFrameSinkInternal,
- base::Unretained(this), std::move(context_provider),
- gpu_memory_buffer_manager, callback);
- return;
- }
-
- RequestCompositorFrameSinkInternal(std::move(context_provider),
- gpu_memory_buffer_manager, callback);
-}
-
-void WindowPortMus::RequestCompositorFrameSinkInternal(
+std::unique_ptr<cc::CompositorFrameSink>
+WindowPortMus::RequestCompositorFrameSink(
scoped_refptr<cc::ContextProvider> context_provider,
- gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
- const CompositorFrameSinkCallback& callback) {
- DCHECK(frame_sink_id_.is_valid());
+ gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) {
std::unique_ptr<ui::ClientCompositorFrameSinkBinding>
compositor_frame_sink_binding;
std::unique_ptr<ui::ClientCompositorFrameSink> compositor_frame_sink =
ui::ClientCompositorFrameSink::Create(
- frame_sink_id_, std::move(context_provider),
- gpu_memory_buffer_manager, &compositor_frame_sink_binding);
+ std::move(context_provider), gpu_memory_buffer_manager,
+ &compositor_frame_sink_binding,
+ window_tree_client_->enable_surface_synchronization_);
AttachCompositorFrameSink(std::move(compositor_frame_sink_binding));
- callback.Run(std::move(compositor_frame_sink));
+ return std::move(compositor_frame_sink);
}
void WindowPortMus::AttachCompositorFrameSink(
@@ -288,15 +268,9 @@ void WindowPortMus::SetPropertyFromServer(
void WindowPortMus::SetFrameSinkIdFromServer(
const cc::FrameSinkId& frame_sink_id) {
+ DCHECK(window_mus_type() == WindowMusType::TOP_LEVEL_IN_WM ||
+ window_mus_type() == WindowMusType::EMBED_IN_OWNER);
frame_sink_id_ = frame_sink_id;
- if (!pending_compositor_frame_sink_request_.is_null()) {
- // TOP_LEVEL_IN_WM, and EMBED_IN_OWNER windows should not be requesting
- // CompositorFrameSinks.
- DCHECK_NE(WindowMusType::TOP_LEVEL_IN_WM, window_mus_type());
- DCHECK_NE(WindowMusType::EMBED_IN_OWNER, window_mus_type());
- base::ResetAndReturn(&pending_compositor_frame_sink_request_).Run();
- return;
- }
UpdatePrimarySurfaceInfo();
}
« no previous file with comments | « ui/aura/mus/window_port_mus.h ('k') | ui/aura/mus/window_tree_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698