| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "remoting/protocol/capture_scheduler.h" | 5 #include "remoting/protocol/capture_scheduler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 ScheduleNextCapture(); | 111 ScheduleNextCapture(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void CaptureScheduler::OnFrameSent() { | 114 void CaptureScheduler::OnFrameSent() { |
| 115 DCHECK(thread_checker_.CalledOnValidThread()); | 115 DCHECK(thread_checker_.CalledOnValidThread()); |
| 116 | 116 |
| 117 ScheduleNextCapture(); | 117 ScheduleNextCapture(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 void CaptureScheduler::ProcessVideoAck(scoped_ptr<VideoAck> video_ack) { | 120 void CaptureScheduler::ProcessVideoAck(std::unique_ptr<VideoAck> video_ack) { |
| 121 DCHECK(thread_checker_.CalledOnValidThread()); | 121 DCHECK(thread_checker_.CalledOnValidThread()); |
| 122 | 122 |
| 123 --num_unacknowledged_frames_; | 123 --num_unacknowledged_frames_; |
| 124 DCHECK_GE(num_unacknowledged_frames_, 0); | 124 DCHECK_GE(num_unacknowledged_frames_, 0); |
| 125 | 125 |
| 126 ScheduleNextCapture(); | 126 ScheduleNextCapture(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void CaptureScheduler::SetTickClockForTest( | 129 void CaptureScheduler::SetTickClockForTest( |
| 130 scoped_ptr<base::TickClock> tick_clock) { | 130 std::unique_ptr<base::TickClock> tick_clock) { |
| 131 tick_clock_ = std::move(tick_clock); | 131 tick_clock_ = std::move(tick_clock); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void CaptureScheduler::SetTimerForTest(scoped_ptr<base::Timer> timer) { | 134 void CaptureScheduler::SetTimerForTest(std::unique_ptr<base::Timer> timer) { |
| 135 capture_timer_ = std::move(timer); | 135 capture_timer_ = std::move(timer); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void CaptureScheduler::SetNumOfProcessorsForTest(int num_of_processors) { | 138 void CaptureScheduler::SetNumOfProcessorsForTest(int num_of_processors) { |
| 139 num_of_processors_ = num_of_processors; | 139 num_of_processors_ = num_of_processors; |
| 140 } | 140 } |
| 141 | 141 |
| 142 void CaptureScheduler::ScheduleNextCapture() { | 142 void CaptureScheduler::ScheduleNextCapture() { |
| 143 DCHECK(thread_checker_.CalledOnValidThread()); | 143 DCHECK(thread_checker_.CalledOnValidThread()); |
| 144 | 144 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 175 DCHECK(!is_paused_); | 175 DCHECK(!is_paused_); |
| 176 DCHECK(!capture_pending_); | 176 DCHECK(!capture_pending_); |
| 177 | 177 |
| 178 capture_pending_ = true; | 178 capture_pending_ = true; |
| 179 last_capture_started_time_ = tick_clock_->NowTicks(); | 179 last_capture_started_time_ = tick_clock_->NowTicks(); |
| 180 capture_closure_.Run(); | 180 capture_closure_.Run(); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace protocol | 183 } // namespace protocol |
| 184 } // namespace remoting | 184 } // namespace remoting |
| OLD | NEW |