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

Unified Diff: services/ui/surfaces/gpu_compositor_frame_sink.cc

Issue 2527203002: Mus: GpuCompositorFrameSink uses WeakPtrFactory (Closed)
Patch Set: Created 4 years, 1 month 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 | « services/ui/surfaces/gpu_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: services/ui/surfaces/gpu_compositor_frame_sink.cc
diff --git a/services/ui/surfaces/gpu_compositor_frame_sink.cc b/services/ui/surfaces/gpu_compositor_frame_sink.cc
index eaea6249a5c76eddce8d266402eb03ca95814cfc..b2e3a8d7cd3a78df2778116f57b554da1216b0f9 100644
--- a/services/ui/surfaces/gpu_compositor_frame_sink.cc
+++ b/services/ui/surfaces/gpu_compositor_frame_sink.cc
@@ -40,7 +40,8 @@ GpuCompositorFrameSink::GpuCompositorFrameSink(
surface_factory_(frame_sink_id_, display_compositor_->manager(), this),
client_(std::move(client)),
binding_(this, std::move(request)),
- private_binding_(this, std::move(private_request)) {
+ private_binding_(this, std::move(private_request)),
+ weak_factory_(this) {
display_compositor_->manager()->RegisterFrameSinkId(frame_sink_id_);
display_compositor_->manager()->RegisterSurfaceFactoryClient(frame_sink_id_,
this);
@@ -92,7 +93,7 @@ void GpuCompositorFrameSink::SubmitCompositorFrame(
surface_factory_.SubmitCompositorFrame(
local_frame_id_, std::move(frame),
base::Bind(&GpuCompositorFrameSink::DidReceiveCompositorFrameAck,
- base::Unretained(this)));
+ weak_factory_.GetWeakPtr()));
if (display_) {
display_->SetLocalFrameId(local_frame_id_,
frame.metadata.device_scale_factor);
« no previous file with comments | « services/ui/surfaces/gpu_compositor_frame_sink.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698