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

Side by Side Diff: cc/test/fake_external_begin_frame_source.h

Issue 2919103002: Replace deprecated base::NonThreadSafe in /cc in favor of SequenceChecker. (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/test/fake_external_begin_frame_source.cc » ('j') | 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 #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 <set> 8 #include <set>
9 9
10 #include "base/cancelable_callback.h" 10 #include "base/cancelable_callback.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/threading/non_thread_safe.h" 12 #include "base/sequence_checker.h"
13 #include "cc/output/begin_frame_args.h" 13 #include "cc/output/begin_frame_args.h"
14 #include "cc/scheduler/begin_frame_source.h" 14 #include "cc/scheduler/begin_frame_source.h"
15 15
16 namespace base { 16 namespace base {
17 class SimpleTestTickClock; 17 class SimpleTestTickClock;
18 } // namespace base 18 } // namespace base
19 19
20 namespace cc { 20 namespace cc {
21 21
22 class FakeExternalBeginFrameSource 22 class FakeExternalBeginFrameSource : public BeginFrameSource {
23 : public BeginFrameSource,
24 public NON_EXPORTED_BASE(base::NonThreadSafe) {
25 public: 23 public:
26 class Client { 24 class Client {
27 public: 25 public:
28 virtual void OnAddObserver(BeginFrameObserver* obs) = 0; 26 virtual void OnAddObserver(BeginFrameObserver* obs) = 0;
29 virtual void OnRemoveObserver(BeginFrameObserver* obs) = 0; 27 virtual void OnRemoveObserver(BeginFrameObserver* obs) = 0;
30 }; 28 };
31 29
32 explicit FakeExternalBeginFrameSource(double refresh_rate, 30 explicit FakeExternalBeginFrameSource(double refresh_rate,
33 bool tick_automatically); 31 bool tick_automatically);
34 ~FakeExternalBeginFrameSource() override; 32 ~FakeExternalBeginFrameSource() override;
(...skipping 21 matching lines...) Expand all
56 void PostTestOnBeginFrame(); 54 void PostTestOnBeginFrame();
57 55
58 const bool tick_automatically_; 56 const bool tick_automatically_;
59 const double milliseconds_per_frame_; 57 const double milliseconds_per_frame_;
60 Client* client_ = nullptr; 58 Client* client_ = nullptr;
61 bool paused_ = false; 59 bool paused_ = false;
62 BeginFrameArgs current_args_; 60 BeginFrameArgs current_args_;
63 uint64_t next_begin_frame_number_ = BeginFrameArgs::kStartingFrameNumber; 61 uint64_t next_begin_frame_number_ = BeginFrameArgs::kStartingFrameNumber;
64 std::set<BeginFrameObserver*> observers_; 62 std::set<BeginFrameObserver*> observers_;
65 base::CancelableCallback<void(const BeginFrameArgs&)> begin_frame_task_; 63 base::CancelableCallback<void(const BeginFrameArgs&)> begin_frame_task_;
64
65 SEQUENCE_CHECKER(sequence_checker_);
66
66 base::WeakPtrFactory<FakeExternalBeginFrameSource> weak_ptr_factory_; 67 base::WeakPtrFactory<FakeExternalBeginFrameSource> weak_ptr_factory_;
67 }; 68 };
68 69
69 } // namespace cc 70 } // namespace cc
70 71
71 #endif // CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ 72 #endif // CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_
OLDNEW
« no previous file with comments | « no previous file | cc/test/fake_external_begin_frame_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698