| OLD | NEW |
| 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 Loading... |
| 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 bool needs_frame_update() const { return needs_frame_update_; } |
| 56 |
| 55 protected: | 57 protected: |
| 56 // protected for testing. | 58 // protected for testing. |
| 57 FrameScheduler(base::TimeDelta frame_delay, | 59 FrameScheduler(base::TimeDelta frame_delay, |
| 58 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 60 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 59 FrameSchedulerClient* client); | 61 FrameSchedulerClient* client); |
| 60 | 62 |
| 61 private: | 63 private: |
| 62 void ScheduleFrameUpdateIfNecessary(); | 64 void ScheduleFrameUpdateIfNecessary(); |
| 63 | 65 |
| 64 // Returns true if a frame update can be started. The Scheduler can not | 66 // Returns true if a frame update can be started. The Scheduler can not |
| (...skipping 22 matching lines...) Expand all Loading... |
| 87 | 89 |
| 88 FrameSchedulerClient* client_; | 90 FrameSchedulerClient* client_; |
| 89 | 91 |
| 90 DISALLOW_COPY_AND_ASSIGN(FrameScheduler); | 92 DISALLOW_COPY_AND_ASSIGN(FrameScheduler); |
| 91 }; | 93 }; |
| 92 | 94 |
| 93 } // namespace engine | 95 } // namespace engine |
| 94 } // namespace blimp | 96 } // namespace blimp |
| 95 | 97 |
| 96 #endif // BLIMP_ENGINE_RENDERER_FRAME_SCHEDULER_H_ | 98 #endif // BLIMP_ENGINE_RENDERER_FRAME_SCHEDULER_H_ |
| OLD | NEW |