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

Unified Diff: content/renderer/gpu/renderer_compositor_frame_sink.cc

Issue 2763633002: CHECK that the RendererCompositorFrameSink has been detached (Closed)
Patch Set: check-bound: . Created 3 years, 9 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 | « content/renderer/gpu/renderer_compositor_frame_sink.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/renderer_compositor_frame_sink.cc
diff --git a/content/renderer/gpu/renderer_compositor_frame_sink.cc b/content/renderer/gpu/renderer_compositor_frame_sink.cc
index 16ccae09e0618e338d0de11d2f4676883ea6cb42..2fafbf0613a132efe335d133ce594052dfcbd706 100644
--- a/content/renderer/gpu/renderer_compositor_frame_sink.cc
+++ b/content/renderer/gpu/renderer_compositor_frame_sink.cc
@@ -74,7 +74,11 @@ RendererCompositorFrameSink::RendererCompositorFrameSink(
thread_checker_.DetachFromThread();
}
-RendererCompositorFrameSink::~RendererCompositorFrameSink() = default;
+RendererCompositorFrameSink::~RendererCompositorFrameSink() {
+ // TODO(crbug.com/702764): If not detached then IPC messages would crash
+ // after this class is destroyed.
+ CHECK(!bound_);
+}
bool RendererCompositorFrameSink::BindToClient(
cc::CompositorFrameSinkClient* client) {
@@ -91,6 +95,7 @@ bool RendererCompositorFrameSink::BindToClient(
compositor_frame_sink_proxy_);
compositor_frame_sink_filter_->AddHandlerOnCompositorThread(
routing_id_, compositor_frame_sink_filter_handler_);
+ bound_ = true;
return true;
}
@@ -105,6 +110,7 @@ void RendererCompositorFrameSink::DetachFromClient() {
routing_id_, compositor_frame_sink_filter_handler_);
cc::CompositorFrameSink::DetachFromClient();
+ bound_ = false;
}
void RendererCompositorFrameSink::SubmitCompositorFrame(
« no previous file with comments | « content/renderer/gpu/renderer_compositor_frame_sink.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698