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 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 DCHECK(thread_checker_.CalledOnValidThread()); | 120 DCHECK(thread_checker_.CalledOnValidThread()); |
121 | 121 |
122 --num_unacknowledged_frames_; | 122 --num_unacknowledged_frames_; |
123 DCHECK_GE(num_unacknowledged_frames_, 0); | 123 DCHECK_GE(num_unacknowledged_frames_, 0); |
124 | 124 |
125 ScheduleNextCapture(); | 125 ScheduleNextCapture(); |
126 } | 126 } |
127 | 127 |
128 void CaptureScheduler::SetTickClockForTest( | 128 void CaptureScheduler::SetTickClockForTest( |
129 scoped_ptr<base::TickClock> tick_clock) { | 129 scoped_ptr<base::TickClock> tick_clock) { |
130 tick_clock_ = tick_clock.Pass(); | 130 tick_clock_ = std::move(tick_clock); |
131 } | 131 } |
132 | 132 |
133 void CaptureScheduler::SetTimerForTest(scoped_ptr<base::Timer> timer) { | 133 void CaptureScheduler::SetTimerForTest(scoped_ptr<base::Timer> timer) { |
134 capture_timer_ = timer.Pass(); | 134 capture_timer_ = std::move(timer); |
135 } | 135 } |
136 | 136 |
137 void CaptureScheduler::SetNumOfProcessorsForTest(int num_of_processors) { | 137 void CaptureScheduler::SetNumOfProcessorsForTest(int num_of_processors) { |
138 num_of_processors_ = num_of_processors; | 138 num_of_processors_ = num_of_processors; |
139 } | 139 } |
140 | 140 |
141 void CaptureScheduler::ScheduleNextCapture() { | 141 void CaptureScheduler::ScheduleNextCapture() { |
142 DCHECK(thread_checker_.CalledOnValidThread()); | 142 DCHECK(thread_checker_.CalledOnValidThread()); |
143 | 143 |
144 if (is_paused_ || capture_pending_ || | 144 if (is_paused_ || capture_pending_ || |
(...skipping 29 matching lines...) Expand all Loading... |
174 DCHECK(!is_paused_); | 174 DCHECK(!is_paused_); |
175 DCHECK(!capture_pending_); | 175 DCHECK(!capture_pending_); |
176 | 176 |
177 capture_pending_ = true; | 177 capture_pending_ = true; |
178 last_capture_started_time_ = tick_clock_->NowTicks(); | 178 last_capture_started_time_ = tick_clock_->NowTicks(); |
179 capture_closure_.Run(); | 179 capture_closure_.Run(); |
180 } | 180 } |
181 | 181 |
182 } // namespace protocol | 182 } // namespace protocol |
183 } // namespace remoting | 183 } // namespace remoting |
OLD | NEW |