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

Unified Diff: cc/surfaces/direct_compositor_frame_sink.cc

Issue 2404993002: cc: Stop calling DetachFromClient if bind failed. (Closed)
Patch Set: detachinternal: rebase Created 4 years, 2 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 | « cc/output/output_surface.h ('k') | cc/surfaces/direct_compositor_frame_sink_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/direct_compositor_frame_sink.cc
diff --git a/cc/surfaces/direct_compositor_frame_sink.cc b/cc/surfaces/direct_compositor_frame_sink.cc
index 3e2e1f30864c40ca20fd682ac4edabefc547e06b..da2edda1922a2ca4130cf08ac4163e0d6afdf393 100644
--- a/cc/surfaces/direct_compositor_frame_sink.cc
+++ b/cc/surfaces/direct_compositor_frame_sink.cc
@@ -51,24 +51,22 @@ DirectCompositorFrameSink::DirectCompositorFrameSink(
DirectCompositorFrameSink::~DirectCompositorFrameSink() {
DCHECK(thread_checker_.CalledOnValidThread());
- if (HasClient())
- DetachFromClient();
}
bool DirectCompositorFrameSink::BindToClient(
CompositorFrameSinkClient* client) {
DCHECK(thread_checker_.CalledOnValidThread());
- surface_manager_->RegisterSurfaceFactoryClient(frame_sink_id_, this);
-
if (!CompositorFrameSink::BindToClient(client))
return false;
+ surface_manager_->RegisterSurfaceFactoryClient(frame_sink_id_, this);
+
// We want the Display's output surface to hear about lost context, and since
// this shares a context with it, we should not be listening for lost context
// callbacks on the context here.
- if (context_provider())
- context_provider()->SetLostContextCallback(base::Closure());
+ if (auto* cp = context_provider())
+ cp->SetLostContextCallback(base::Closure());
// Avoid initializing GL context here, as this should be sharing the
// Display's context.
@@ -77,8 +75,6 @@ bool DirectCompositorFrameSink::BindToClient(
}
void DirectCompositorFrameSink::DetachFromClient() {
- DCHECK(HasClient());
-
// Unregister the SurfaceFactoryClient here instead of the dtor so that only
// one client is alive for this namespace at any given time.
surface_manager_->UnregisterSurfaceFactoryClient(frame_sink_id_);
« no previous file with comments | « cc/output/output_surface.h ('k') | cc/surfaces/direct_compositor_frame_sink_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698