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

Side by Side Diff: remoting/host/screen_recorder.cc

Issue 7825026: Revert "Currently, base/timer.cc calls PostTask with FROM_HERE as the Location, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « remoting/host/heartbeat_sender.cc ('k') | ui/base/animation/animation_container.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/host/screen_recorder.h" 5 #include "remoting/host/screen_recorder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 capture_timer_.Stop(); 174 capture_timer_.Stop();
175 StartCaptureTimer(); 175 StartCaptureTimer();
176 } 176 }
177 } 177 }
178 178
179 void ScreenRecorder::StartCaptureTimer() { 179 void ScreenRecorder::StartCaptureTimer() {
180 DCHECK_EQ(capture_loop_, MessageLoop::current()); 180 DCHECK_EQ(capture_loop_, MessageLoop::current());
181 181
182 base::TimeDelta interval = base::TimeDelta::FromMilliseconds( 182 base::TimeDelta interval = base::TimeDelta::FromMilliseconds(
183 static_cast<int>(base::Time::kMillisecondsPerSecond / max_rate_)); 183 static_cast<int>(base::Time::kMillisecondsPerSecond / max_rate_));
184 capture_timer_.Start(FROM_HERE, interval, this, &ScreenRecorder::DoCapture); 184 capture_timer_.Start(interval, this, &ScreenRecorder::DoCapture);
185 } 185 }
186 186
187 void ScreenRecorder::DoCapture() { 187 void ScreenRecorder::DoCapture() {
188 DCHECK_EQ(capture_loop_, MessageLoop::current()); 188 DCHECK_EQ(capture_loop_, MessageLoop::current());
189 // Make sure we have at most two oustanding recordings. We can simply return 189 // Make sure we have at most two oustanding recordings. We can simply return
190 // if we can't make a capture now, the next capture will be started by the 190 // if we can't make a capture now, the next capture will be started by the
191 // end of an encode operation. 191 // end of an encode operation.
192 if (recordings_ >= kMaxRecordings || !is_recording_) { 192 if (recordings_ >= kMaxRecordings || !is_recording_) {
193 frame_skipped_ = true; 193 frame_skipped_ = true;
194 return; 194 return;
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 (base::Time::Now() - encode_start_time_).InMilliseconds()); 397 (base::Time::Now() - encode_start_time_).InMilliseconds());
398 packet->set_encode_time_ms(encode_time); 398 packet->set_encode_time_ms(encode_time);
399 } 399 }
400 400
401 network_loop_->PostTask( 401 network_loop_->PostTask(
402 FROM_HERE, 402 FROM_HERE,
403 NewTracedMethod(this, &ScreenRecorder::DoSendVideoPacket, packet)); 403 NewTracedMethod(this, &ScreenRecorder::DoSendVideoPacket, packet));
404 } 404 }
405 405
406 } // namespace remoting 406 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/heartbeat_sender.cc ('k') | ui/base/animation/animation_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698