| OLD | NEW |
| 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 #ifndef CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ | 5 #ifndef CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ |
| 6 #define CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ | 6 #define CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "cc/scheduler/begin_frame_source.h" | 9 #include "cc/scheduler/begin_frame_source.h" |
| 10 | 10 |
| 11 namespace cc { | 11 namespace cc { |
| 12 | 12 |
| 13 class FakeExternalBeginFrameSource | 13 class FakeExternalBeginFrameSource |
| 14 : public BeginFrameSourceBase, | 14 : public BeginFrameSourceBase, |
| 15 public NON_EXPORTED_BASE(base::NonThreadSafe) { | 15 public NON_EXPORTED_BASE(base::NonThreadSafe) { |
| 16 public: | 16 public: |
| 17 explicit FakeExternalBeginFrameSource(double refresh_rate); | 17 explicit FakeExternalBeginFrameSource(double refresh_rate); |
| 18 ~FakeExternalBeginFrameSource() override; | 18 ~FakeExternalBeginFrameSource() override; |
| 19 | 19 |
| 20 // BeginFrameSourceBase overrides. | 20 // BeginFrameSourceBase overrides. |
| 21 void DidFinishFrame(BeginFrameObserver* obs) override; |
| 21 void OnNeedsBeginFramesChanged(bool needs_begin_frames) override; | 22 void OnNeedsBeginFramesChanged(bool needs_begin_frames) override; |
| 22 | 23 |
| 23 void TestOnBeginFrame(); | 24 void TestOnBeginFrame(); |
| 24 void PostTestOnBeginFrame(); | 25 void PostTestOnBeginFrame(); |
| 25 | 26 |
| 26 private: | 27 private: |
| 27 double milliseconds_per_frame_; | 28 double milliseconds_per_frame_; |
| 29 BeginFrameArgs missed_begin_frame_args_; |
| 28 base::CancelableClosure begin_frame_task_; | 30 base::CancelableClosure begin_frame_task_; |
| 29 base::WeakPtrFactory<FakeExternalBeginFrameSource> weak_ptr_factory_; | 31 base::WeakPtrFactory<FakeExternalBeginFrameSource> weak_ptr_factory_; |
| 30 }; | 32 }; |
| 31 | 33 |
| 32 } // namespace cc | 34 } // namespace cc |
| 33 | 35 |
| 34 #endif // CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ | 36 #endif // CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ |
| OLD | NEW |