Commit ac10e4a8 authored by dcheng's avatar dcheng Committed by Commit bot

Remove implicit conversions from scoped_refptr to T* in remoting/

This patch was generated by running the rewrite_scoped_refptr clang tool
on a Linux build.

BUG=110610

Review URL: https://codereview.chromium.org/502123003

Cr-Commit-Position: refs/heads/master@{#291832}
parent 1ebd8d84
......@@ -326,7 +326,7 @@ CastExtensionSession::CastExtensionSession(
worker_thread_wrapper_(NULL),
worker_thread_(kWorkerThreadName) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
DCHECK(url_request_context_getter_);
DCHECK(url_request_context_getter_.get());
DCHECK(client_session_control_);
DCHECK(client_stub_);
......
......@@ -142,21 +142,21 @@ void ClientSession::ControlVideo(const protocol::VideoControl& video_control) {
VLOG(1) << "Received VideoControl (enable="
<< video_control.enable() << ")";
pause_video_ = !video_control.enable();
if (video_scheduler_)
if (video_scheduler_.get())
video_scheduler_->Pause(pause_video_);
}
if (video_control.has_lossless_encode()) {
VLOG(1) << "Received VideoControl (lossless_encode="
<< video_control.lossless_encode() << ")";
lossless_video_encode_ = video_control.lossless_encode();
if (video_scheduler_)
if (video_scheduler_.get())
video_scheduler_->SetLosslessEncode(lossless_video_encode_);
}
if (video_control.has_lossless_color()) {
VLOG(1) << "Received VideoControl (lossless_color="
<< video_control.lossless_color() << ")";
lossless_video_color_ = video_control.lossless_color();
if (video_scheduler_)
if (video_scheduler_.get())
video_scheduler_->SetLosslessColor(lossless_video_color_);
}
}
......@@ -207,7 +207,7 @@ void ClientSession::SetCapabilities(
void ClientSession::RequestPairing(
const protocol::PairingRequest& pairing_request) {
if (pairing_registry_ && pairing_request.has_client_name()) {
if (pairing_registry_.get() && pairing_request.has_client_name()) {
protocol::PairingRegistry::Pairing pairing =
pairing_registry_->CreatePairing(pairing_request.client_name());
protocol::PairingResponse pairing_response;
......
......@@ -38,7 +38,7 @@ OAuthTokenGetter::OAuthTokenGetter(
bool auto_refresh)
: oauth_credentials_(oauth_credentials.Pass()),
gaia_oauth_client_(
new gaia::GaiaOAuthClient(url_request_context_getter)),
new gaia::GaiaOAuthClient(url_request_context_getter.get())),
url_request_context_getter_(url_request_context_getter),
refreshing_oauth_token_(false) {
if (auto_refresh) {
......
......@@ -182,7 +182,7 @@ void Me2MeNativeMessagingHost::ProcessClearPairedClients(
return;
}
if (pairing_registry_) {
if (pairing_registry_.get()) {
pairing_registry_->ClearAllPairings(
base::Bind(&Me2MeNativeMessagingHost::SendBooleanResult, weak_ptr_,
base::Passed(&response)));
......@@ -211,7 +211,7 @@ void Me2MeNativeMessagingHost::ProcessDeletePairedClient(
return;
}
if (pairing_registry_) {
if (pairing_registry_.get()) {
pairing_registry_->DeletePairing(
client_id, base::Bind(&Me2MeNativeMessagingHost::SendBooleanResult,
weak_ptr_, base::Passed(&response)));
......@@ -294,7 +294,7 @@ void Me2MeNativeMessagingHost::ProcessGetPairedClients(
scoped_ptr<base::DictionaryValue> response) {
DCHECK(thread_checker_.CalledOnValidThread());
if (pairing_registry_) {
if (pairing_registry_.get()) {
pairing_registry_->GetAllPairings(
base::Bind(&Me2MeNativeMessagingHost::SendPairedClientsResponse,
weak_ptr_, base::Passed(&response)));
......
......@@ -14,7 +14,7 @@ namespace remoting {
OAuthClient::OAuthClient(
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter)
: gaia_oauth_client_(url_request_context_getter) {
: gaia_oauth_client_(url_request_context_getter.get()) {
}
OAuthClient::~OAuthClient() {
......
......@@ -146,7 +146,7 @@ void TokenValidatorBase::OnCertificatesSelected(
for (size_t i = 0; i < selected_certs->size(); ++i) {
if (issuer == kCertIssuerWildCard ||
issuer == (*selected_certs)[i]->issuer().common_name) {
request_->ContinueWithCertificate((*selected_certs)[i]);
request_->ContinueWithCertificate((*selected_certs)[i].get());
return;
}
}
......
......@@ -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_,
......
......@@ -91,7 +91,7 @@ void FakePortAllocatorSession::SendSessionRequest(
scoped_ptr<FakePortAllocator> FakePortAllocator::Create(
scoped_refptr<FakeNetworkDispatcher> fake_network_dispatcher) {
scoped_ptr<FakePacketSocketFactory> socket_factory(
new FakePacketSocketFactory(fake_network_dispatcher));
new FakePacketSocketFactory(fake_network_dispatcher.get()));
scoped_ptr<rtc::NetworkManager> network_manager(
new FakeNetworkManager(socket_factory->GetAddress()));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment