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

Unified Diff: cc/surfaces/compositor_frame_sink_support.cc

Issue 2789143002: [cc] Test that CFSSupport forwards BeginFrameAcks in CompositorFrames. (Closed)
Patch Set: fix use after move 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 | « no previous file | cc/surfaces/compositor_frame_sink_support_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/compositor_frame_sink_support.cc
diff --git a/cc/surfaces/compositor_frame_sink_support.cc b/cc/surfaces/compositor_frame_sink_support.cc
index 97c351f2f9acc2d5472b096bf2dcfbbf655ef8d6..b0d7dc28df3399d40605455d89aabe40abf9d80e 100644
--- a/cc/surfaces/compositor_frame_sink_support.cc
+++ b/cc/surfaces/compositor_frame_sink_support.cc
@@ -72,7 +72,11 @@ void CompositorFrameSinkSupport::BeginFrameDidNotSwap(
// TODO(eseckler): While a pending CompositorFrame exists (see TODO below), we
// should not acknowledge immediately. Instead, we should update the ack that
// will be sent to DisplayScheduler when the pending frame is activated.
- DCHECK_LE(BeginFrameArgs::kStartingFrameNumber, ack.sequence_number);
+ if (ack.sequence_number < BeginFrameArgs::kStartingFrameNumber) {
+ DLOG(ERROR) << "Received BeginFrameDidNotSwap with invalid BeginFrameAck.";
+ return;
+ }
+
// |has_damage| is not transmitted, but false by default.
DCHECK(!ack.has_damage);
if (begin_frame_source_)
@@ -94,6 +98,7 @@ void CompositorFrameSinkSupport::SubmitCompositorFrame(
// |has_damage| is not transmitted.
frame.metadata.begin_frame_ack.has_damage = true;
+ BeginFrameAck ack = frame.metadata.begin_frame_ack;
brianderson 2017/04/04 00:01:57 Could this be a const ref?
Eric Seckler 2017/04/04 07:34:05 I don't think that'd be safe, since we're moving |
surface_factory_.SubmitCompositorFrame(
local_surface_id, std::move(frame),
base::Bind(&CompositorFrameSinkSupport::DidReceiveCompositorFrameAck,
@@ -105,7 +110,7 @@ void CompositorFrameSinkSupport::SubmitCompositorFrame(
// that we need to stay an active BFO while a CompositorFrame is pending.
// See https://crbug.com/703079.
if (begin_frame_source_)
- begin_frame_source_->DidFinishFrame(this, frame.metadata.begin_frame_ack);
+ begin_frame_source_->DidFinishFrame(this, ack);
}
void CompositorFrameSinkSupport::UpdateSurfaceReferences(
« no previous file with comments | « no previous file | cc/surfaces/compositor_frame_sink_support_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698