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

Unified Diff: services/ui/public/cpp/compositor_frame_sink.cc

Issue 2409923002: cc: Rename SwapBuffers on CompositorFrameSink to SubmitCompositorFrame (Closed)
Patch Set: swap-to-submit: 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
Index: services/ui/public/cpp/compositor_frame_sink.cc
diff --git a/services/ui/public/cpp/compositor_frame_sink.cc b/services/ui/public/cpp/compositor_frame_sink.cc
index dc33f6c45a5885936b8e0e4dbe8d11bcabd05167..d132f8062546b164ad398965739287df04275ce1 100644
--- a/services/ui/public/cpp/compositor_frame_sink.cc
+++ b/services/ui/public/cpp/compositor_frame_sink.cc
@@ -48,13 +48,15 @@ void CompositorFrameSink::DetachFromClient() {
cc::CompositorFrameSink::DetachFromClient();
}
-void CompositorFrameSink::SwapBuffers(cc::CompositorFrame frame) {
+void CompositorFrameSink::SubmitCompositorFrame(cc::CompositorFrame frame) {
// CompositorFrameSink owns WindowSurface, and so if CompositorFrameSink is
// destroyed then SubmitCompositorFrame's callback will never get called.
- // Thus, base::Unretained is safe here.
+ // Thus, base::Unretained is safe here as |client_| is valid as long as |this|
+ // is.
surface_->SubmitCompositorFrame(
- std::move(frame), base::Bind(&CompositorFrameSink::SwapBuffersComplete,
- base::Unretained(this)));
+ std::move(frame),
+ base::Bind(&cc::CompositorFrameSinkClient::DidReceiveCompositorFrameAck,
+ base::Unretained(client_)));
}
void CompositorFrameSink::OnResourcesReturned(
@@ -63,8 +65,4 @@ void CompositorFrameSink::OnResourcesReturned(
client_->ReclaimResources(resources);
}
-void CompositorFrameSink::SwapBuffersComplete() {
- client_->DidSwapBuffersComplete();
-}
-
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698