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

Side by Side Diff: cc/surfaces/primary_begin_frame_source.h

Issue 2880023002: cc::SurfaceDependencyTracker should not crash when a Display goes away (Closed)
Patch Set: StrictMock => NiceMock Created 3 years, 7 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 | « cc/surfaces/frame_sink_observer.h ('k') | cc/surfaces/primary_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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CC_SURFACES_PRIMARY_BEGIN_FRAME_SOURCE_H_
6 #define CC_SURFACES_PRIMARY_BEGIN_FRAME_SOURCE_H_
7
8 #include "cc/scheduler/begin_frame_source.h"
9 #include "cc/surfaces/frame_sink_observer.h"
10
11 namespace cc {
12
13 class FrameSinkManager;
14
15 // PrimaryBeginFrameSource echos the first BeginFrameSource in the system.
16 // If the first source goes away then it will echo the new first
17 // BeginFrameSource.
18 class PrimaryBeginFrameSource : public BeginFrameSource,
19 public BeginFrameObserver,
20 public ExternalBeginFrameSourceClient,
21 public FrameSinkObserver {
22 public:
23 PrimaryBeginFrameSource();
24 ~PrimaryBeginFrameSource() override;
25
26 void Init(FrameSinkManager* frame_sink_manager);
27
28 // BeginFrameObserver implementation.
29 void OnBeginFrame(const BeginFrameArgs& args) override;
30 const BeginFrameArgs& LastUsedBeginFrameArgs() const override;
31 void OnBeginFrameSourcePausedChanged(bool paused) override;
32
33 // BeginFrameSource implementation.
34 void DidFinishFrame(BeginFrameObserver* obs,
35 const BeginFrameAck& ack) override;
36 void AddObserver(BeginFrameObserver* obs) override;
37 void RemoveObserver(BeginFrameObserver* obs) override;
38 bool IsThrottled() const override;
39
40 // ExternalBeginFrameSourceClient implementation.
41 void OnNeedsBeginFrames(bool needs_begin_frames) override;
42
43 // FrameSinkObserver implementation.
44 void OnBeginFrameSourceAdded(BeginFrameSource* begin_frame_source) override;
enne (OOO) 2017/05/24 17:55:17 This is a tiny design nit in this class, but I fee
Fady Samuel 2017/05/24 18:36:51 Done.
45 void OnBeginFrameSourceRemoved(BeginFrameSource* begin_frame_source) override;
46
47 private:
48 FrameSinkManager* frame_sink_manager_ = nullptr;
49 std::unique_ptr<ExternalBeginFrameSource> begin_frame_source_;
enne (OOO) 2017/05/24 17:55:17 Maybe just make this a member instead of a heap al
Fady Samuel 2017/05/24 18:36:51 Done.
50 BeginFrameSource* primary_begin_frame_source_ = nullptr;
enne (OOO) 2017/05/24 17:55:17 There's a lot of "primary" verbage everywhere. Ma
Fady Samuel 2017/05/24 18:36:52 Done.
51
52 // The last begin frame args generated by the begin frame source.
53 BeginFrameArgs last_begin_frame_args_;
54
55 bool needs_begin_frames_ = false;
56
57 DISALLOW_COPY_AND_ASSIGN(PrimaryBeginFrameSource);
58 };
59
60 } // namespace cc
61
62 #endif // CC_SURFACES_PRIMARY_BEGIN_FRAME_SOURCE_H_
OLDNEW
« no previous file with comments | « cc/surfaces/frame_sink_observer.h ('k') | cc/surfaces/primary_begin_frame_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698