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

Side by Side Diff: blimp/engine/renderer/frame_scheduler.h

Issue 2445093002: cc/blimp: Add synchronization for scroll/scale state. (Closed)
Patch Set: fix rebase upload Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 BLIMP_ENGINE_RENDERER_FRAME_SCHEDULER_H_ 5 #ifndef BLIMP_ENGINE_RENDERER_FRAME_SCHEDULER_H_
6 #define BLIMP_ENGINE_RENDERER_FRAME_SCHEDULER_H_ 6 #define BLIMP_ENGINE_RENDERER_FRAME_SCHEDULER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/timer/timer.h" 10 #include "base/timer/timer.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 // Called when a frame update is sent to the client. This must be called only 46 // Called when a frame update is sent to the client. This must be called only
47 // when the |client| is producing a frame update in 47 // when the |client| is producing a frame update in
48 // FrameSchedulerClient::StartFrameUpdate and must be followed with a 48 // FrameSchedulerClient::StartFrameUpdate and must be followed with a
49 // DidReceiveFrameUpdateAck when the frame sent is ack-ed by the client. 49 // DidReceiveFrameUpdateAck when the frame sent is ack-ed by the client.
50 void DidSendFrameUpdateToClient(); 50 void DidSendFrameUpdateToClient();
51 51
52 // Called when an Ack is received for a frame sent to the client. 52 // Called when an Ack is received for a frame sent to the client.
53 void DidReceiveFrameUpdateAck(); 53 void DidReceiveFrameUpdateAck();
54 54
55 protected: 55 bool needs_frame_update() const { return needs_frame_update_; }
56 // protected for testing. 56
57 FrameScheduler(base::TimeDelta frame_delay, 57 void set_frame_delay_for_testing(base::TimeDelta frame_delay) {
58 scoped_refptr<base::SingleThreadTaskRunner> task_runner, 58 frame_delay_ = frame_delay;
59 FrameSchedulerClient* client); 59 }
60 60
61 private: 61 private:
62 void ScheduleFrameUpdateIfNecessary(); 62 void ScheduleFrameUpdateIfNecessary();
63 63
64 // Returns true if a frame update can be started. The Scheduler can not 64 // Returns true if a frame update can be started. The Scheduler can not
65 // produce new frames either if there is no request for frames pending or we 65 // produce new frames either if there is no request for frames pending or we
66 // are waiting for an ack for a frame previously sent to the client. 66 // are waiting for an ack for a frame previously sent to the client.
67 bool ShouldProduceFrameUpdates() const; 67 bool ShouldProduceFrameUpdates() const;
68 68
69 void StartFrameUpdate(); 69 void StartFrameUpdate();
(...skipping 17 matching lines...) Expand all
87 87
88 FrameSchedulerClient* client_; 88 FrameSchedulerClient* client_;
89 89
90 DISALLOW_COPY_AND_ASSIGN(FrameScheduler); 90 DISALLOW_COPY_AND_ASSIGN(FrameScheduler);
91 }; 91 };
92 92
93 } // namespace engine 93 } // namespace engine
94 } // namespace blimp 94 } // namespace blimp
95 95
96 #endif // BLIMP_ENGINE_RENDERER_FRAME_SCHEDULER_H_ 96 #endif // BLIMP_ENGINE_RENDERER_FRAME_SCHEDULER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698