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

Unified Diff: cc/test/fake_external_begin_frame_source.cc

Issue 798323003: cc: Only send a BeginMainFrame inside an BeginImplFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing for rename. Created 6 years 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/test/fake_external_begin_frame_source.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_external_begin_frame_source.cc
diff --git a/cc/test/fake_external_begin_frame_source.cc b/cc/test/fake_external_begin_frame_source.cc
index 02e0ae195a7da89d42e949cbc3ec6c1f30e5049e..c1885c143429dafe1bc1a5ac7666e2d7aba77ab9 100644
--- a/cc/test/fake_external_begin_frame_source.cc
+++ b/cc/test/fake_external_begin_frame_source.cc
@@ -31,16 +31,24 @@ void FakeExternalBeginFrameSource::OnNeedsBeginFramesChange(
bool needs_begin_frames) {
DCHECK(CalledOnValidThread());
if (needs_begin_frames) {
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE, base::Bind(&FakeExternalBeginFrameSource::TestOnBeginFrame,
- weak_ptr_factory_.GetWeakPtr()),
- base::TimeDelta::FromMilliseconds(milliseconds_per_frame_));
+ PostTestOnBeginFrame();
}
}
void FakeExternalBeginFrameSource::TestOnBeginFrame() {
DCHECK(CalledOnValidThread());
CallOnBeginFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
+
+ if (NeedsBeginFrames()) {
+ PostTestOnBeginFrame();
+ }
+}
+
+void FakeExternalBeginFrameSource::PostTestOnBeginFrame() {
+ base::MessageLoop::current()->PostDelayedTask(
+ FROM_HERE, base::Bind(&FakeExternalBeginFrameSource::TestOnBeginFrame,
+ weak_ptr_factory_.GetWeakPtr()),
+ base::TimeDelta::FromMilliseconds(milliseconds_per_frame_));
}
} // namespace cc
« no previous file with comments | « cc/test/fake_external_begin_frame_source.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698