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

Side by Side Diff: remoting/protocol/capture_scheduler.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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 | « remoting/protocol/capture_scheduler.h ('k') | remoting/protocol/capture_scheduler_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « remoting/protocol/capture_scheduler.h ('k') | remoting/protocol/capture_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698