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

Unified Diff: remoting/host/video_frame_recorder.cc

Issue 502123003: Remove implicit conversions from scoped_refptr to T* in remoting/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/token_validator_base.cc ('k') | remoting/test/fake_port_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/video_frame_recorder.cc
diff --git a/remoting/host/video_frame_recorder.cc b/remoting/host/video_frame_recorder.cc
index 38213b3bcba9ae3693d2ec81329c65452f083da7..5303a80cfb1229f3aa8731295231443576c03ad0 100644
--- a/remoting/host/video_frame_recorder.cc
+++ b/remoting/host/video_frame_recorder.cc
@@ -34,7 +34,7 @@ class VideoFrameRecorder::RecordingVideoEncoder : public VideoEncoder {
enable_recording_(false),
weak_factory_(this) {
DCHECK(encoder_);
- DCHECK(recorder_task_runner_);
+ DCHECK(recorder_task_runner_.get());
}
base::WeakPtr<RecordingVideoEncoder> AsWeakPtr() {
@@ -42,7 +42,7 @@ class VideoFrameRecorder::RecordingVideoEncoder : public VideoEncoder {
}
void SetEnableRecording(bool enable_recording) {
- DCHECK(!encoder_task_runner_ ||
+ DCHECK(!encoder_task_runner_.get() ||
encoder_task_runner_->BelongsToCurrentThread());
enable_recording_ = enable_recording;
}
@@ -58,7 +58,7 @@ class VideoFrameRecorder::RecordingVideoEncoder : public VideoEncoder {
const webrtc::DesktopFrame& frame) OVERRIDE {
// If this is the first Encode() then store the TaskRunner and inform the
// VideoFrameRecorder so it can post SetEnableRecording() on it.
- if (!encoder_task_runner_) {
+ if (!encoder_task_runner_.get()) {
encoder_task_runner_ = base::ThreadTaskRunnerHandle::Get();
recorder_task_runner_->PostTask(FROM_HERE,
base::Bind(&VideoFrameRecorder::SetEncoderTaskRunner,
@@ -112,8 +112,8 @@ VideoFrameRecorder::~VideoFrameRecorder() {
scoped_ptr<VideoEncoder> VideoFrameRecorder::WrapVideoEncoder(
scoped_ptr<VideoEncoder> encoder) {
- DCHECK(!encoder_task_runner_);
- DCHECK(!caller_task_runner_);
+ DCHECK(!encoder_task_runner_.get());
+ DCHECK(!caller_task_runner_.get());
caller_task_runner_ = base::ThreadTaskRunnerHandle::Get();
scoped_ptr<RecordingVideoEncoder> recording_encoder(
@@ -126,7 +126,8 @@ scoped_ptr<VideoEncoder> VideoFrameRecorder::WrapVideoEncoder(
}
void VideoFrameRecorder::DetachVideoEncoderWrapper() {
- DCHECK(!caller_task_runner_ || caller_task_runner_->BelongsToCurrentThread());
+ DCHECK(!caller_task_runner_.get() ||
+ caller_task_runner_->BelongsToCurrentThread());
// Immediately detach the wrapper from this recorder.
weak_factory_.InvalidateWeakPtrs();
@@ -136,7 +137,7 @@ void VideoFrameRecorder::DetachVideoEncoderWrapper() {
content_bytes_ = 0;
// Tell the wrapper to stop recording and posting frames to us.
- if (encoder_task_runner_) {
+ if (encoder_task_runner_.get()) {
encoder_task_runner_->PostTask(FROM_HERE,
base::Bind(&RecordingVideoEncoder::SetEnableRecording,
recording_encoder_, false));
@@ -148,14 +149,15 @@ void VideoFrameRecorder::DetachVideoEncoderWrapper() {
}
void VideoFrameRecorder::SetEnableRecording(bool enable_recording) {
- DCHECK(!caller_task_runner_ || caller_task_runner_->BelongsToCurrentThread());
+ DCHECK(!caller_task_runner_.get() ||
+ caller_task_runner_->BelongsToCurrentThread());
if (enable_recording_ == enable_recording) {
return;
}
enable_recording_ = enable_recording;
- if (encoder_task_runner_) {
+ if (encoder_task_runner_.get()) {
encoder_task_runner_->PostTask(FROM_HERE,
base::Bind(&RecordingVideoEncoder::SetEnableRecording,
recording_encoder_,
@@ -164,7 +166,8 @@ void VideoFrameRecorder::SetEnableRecording(bool enable_recording) {
}
void VideoFrameRecorder::SetMaxContentBytes(int64_t max_content_bytes) {
- DCHECK(!caller_task_runner_ || caller_task_runner_->BelongsToCurrentThread());
+ DCHECK(!caller_task_runner_.get() ||
+ caller_task_runner_->BelongsToCurrentThread());
DCHECK_GE(max_content_bytes, 0);
max_content_bytes_ = max_content_bytes;
@@ -187,13 +190,13 @@ scoped_ptr<webrtc::DesktopFrame> VideoFrameRecorder::NextFrame() {
void VideoFrameRecorder::SetEncoderTaskRunner(
scoped_refptr<base::TaskRunner> task_runner) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
- DCHECK(!encoder_task_runner_);
- DCHECK(task_runner);
+ DCHECK(!encoder_task_runner_.get());
+ DCHECK(task_runner.get());
encoder_task_runner_ = task_runner;
// If the caller already enabled recording, inform the recording encoder.
- if (enable_recording_ && encoder_task_runner_) {
+ if (enable_recording_ && encoder_task_runner_.get()) {
encoder_task_runner_->PostTask(FROM_HERE,
base::Bind(&RecordingVideoEncoder::SetEnableRecording,
recording_encoder_,
« no previous file with comments | « remoting/host/token_validator_base.cc ('k') | remoting/test/fake_port_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698