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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « cc/test/fake_external_begin_frame_source.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/test/fake_external_begin_frame_source.h" 5 #include "cc/test/fake_external_begin_frame_source.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "cc/test/begin_frame_args_test.h" 10 #include "cc/test/begin_frame_args_test.h"
(...skipping 13 matching lines...) Expand all
24 24
25 void FakeExternalBeginFrameSource::SetClientReady() { 25 void FakeExternalBeginFrameSource::SetClientReady() {
26 DCHECK(CalledOnValidThread()); 26 DCHECK(CalledOnValidThread());
27 is_ready_ = true; 27 is_ready_ = true;
28 } 28 }
29 29
30 void FakeExternalBeginFrameSource::OnNeedsBeginFramesChange( 30 void FakeExternalBeginFrameSource::OnNeedsBeginFramesChange(
31 bool needs_begin_frames) { 31 bool needs_begin_frames) {
32 DCHECK(CalledOnValidThread()); 32 DCHECK(CalledOnValidThread());
33 if (needs_begin_frames) { 33 if (needs_begin_frames) {
34 base::MessageLoop::current()->PostDelayedTask( 34 PostTestOnBeginFrame();
35 FROM_HERE, base::Bind(&FakeExternalBeginFrameSource::TestOnBeginFrame,
36 weak_ptr_factory_.GetWeakPtr()),
37 base::TimeDelta::FromMilliseconds(milliseconds_per_frame_));
38 } 35 }
39 } 36 }
40 37
41 void FakeExternalBeginFrameSource::TestOnBeginFrame() { 38 void FakeExternalBeginFrameSource::TestOnBeginFrame() {
42 DCHECK(CalledOnValidThread()); 39 DCHECK(CalledOnValidThread());
43 CallOnBeginFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE)); 40 CallOnBeginFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
41
42 if (NeedsBeginFrames()) {
43 PostTestOnBeginFrame();
44 }
45 }
46
47 void FakeExternalBeginFrameSource::PostTestOnBeginFrame() {
48 base::MessageLoop::current()->PostDelayedTask(
49 FROM_HERE, base::Bind(&FakeExternalBeginFrameSource::TestOnBeginFrame,
50 weak_ptr_factory_.GetWeakPtr()),
51 base::TimeDelta::FromMilliseconds(milliseconds_per_frame_));
44 } 52 }
45 53
46 } // namespace cc 54 } // namespace cc
OLDNEW
« 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