Commit 12c173d0 authored by Daniel Cheng's avatar Daniel Cheng

Remove implicit conversions from scoped_refptr to T* in sync/

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

BUG=110610
R=rlarocque@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#291804}
parent 79270799
...@@ -32,7 +32,7 @@ const scoped_refptr<base::RefCountedMemory>& Attachment::GetData() const { ...@@ -32,7 +32,7 @@ const scoped_refptr<base::RefCountedMemory>& Attachment::GetData() const {
Attachment::Attachment(const AttachmentId& id, Attachment::Attachment(const AttachmentId& id,
const scoped_refptr<base::RefCountedMemory>& data) const scoped_refptr<base::RefCountedMemory>& data)
: id_(id), data_(data) { : id_(id), data_(data) {
DCHECK(data); DCHECK(data.get());
} }
} // namespace syncer } // namespace syncer
...@@ -306,15 +306,16 @@ class SyncerTest : public testing::Test, ...@@ -306,15 +306,16 @@ class SyncerTest : public testing::Test,
model_type_registry_->RegisterDirectoryTypeDebugInfoObserver( model_type_registry_->RegisterDirectoryTypeDebugInfoObserver(
&debug_info_cache_); &debug_info_cache_);
context_.reset( context_.reset(new SyncSessionContext(
new SyncSessionContext( mock_server_.get(),
mock_server_.get(), directory(), directory(),
extensions_activity_, extensions_activity_.get(),
listeners, debug_info_getter_.get(), listeners,
model_type_registry_.get(), debug_info_getter_.get(),
true, // enable keystore encryption model_type_registry_.get(),
false, // force enable pre-commit GU avoidance experiment true, // enable keystore encryption
"fake_invalidator_client_id")); false, // force enable pre-commit GU avoidance experiment
"fake_invalidator_client_id"));
context_->SetRoutingInfo(routing_info); context_->SetRoutingInfo(routing_info);
syncer_ = new Syncer(&cancelation_signal_); syncer_ = new Syncer(&cancelation_signal_);
......
...@@ -51,8 +51,8 @@ AttachmentDownloaderImpl::AttachmentDownloaderImpl( ...@@ -51,8 +51,8 @@ AttachmentDownloaderImpl::AttachmentDownloaderImpl(
token_service_provider_(token_service_provider) { token_service_provider_(token_service_provider) {
DCHECK(!account_id.empty()); DCHECK(!account_id.empty());
DCHECK(!scopes.empty()); DCHECK(!scopes.empty());
DCHECK(token_service_provider_); DCHECK(token_service_provider_.get());
DCHECK(url_request_context_getter_); DCHECK(url_request_context_getter_.get());
} }
AttachmentDownloaderImpl::~AttachmentDownloaderImpl() { AttachmentDownloaderImpl::~AttachmentDownloaderImpl() {
......
...@@ -53,15 +53,15 @@ AttachmentServiceProxy::AttachmentServiceProxy( ...@@ -53,15 +53,15 @@ AttachmentServiceProxy::AttachmentServiceProxy(
const scoped_refptr<base::SequencedTaskRunner>& wrapped_task_runner, const scoped_refptr<base::SequencedTaskRunner>& wrapped_task_runner,
const base::WeakPtr<syncer::AttachmentService>& wrapped) const base::WeakPtr<syncer::AttachmentService>& wrapped)
: wrapped_task_runner_(wrapped_task_runner), core_(new Core(wrapped)) { : wrapped_task_runner_(wrapped_task_runner), core_(new Core(wrapped)) {
DCHECK(wrapped_task_runner_); DCHECK(wrapped_task_runner_.get());
} }
AttachmentServiceProxy::AttachmentServiceProxy( AttachmentServiceProxy::AttachmentServiceProxy(
const scoped_refptr<base::SequencedTaskRunner>& wrapped_task_runner, const scoped_refptr<base::SequencedTaskRunner>& wrapped_task_runner,
const scoped_refptr<Core>& core) const scoped_refptr<Core>& core)
: wrapped_task_runner_(wrapped_task_runner), core_(core) { : wrapped_task_runner_(wrapped_task_runner), core_(core) {
DCHECK(wrapped_task_runner_); DCHECK(wrapped_task_runner_.get());
DCHECK(core_); DCHECK(core_.get());
} }
AttachmentServiceProxy::~AttachmentServiceProxy() { AttachmentServiceProxy::~AttachmentServiceProxy() {
...@@ -70,7 +70,7 @@ AttachmentServiceProxy::~AttachmentServiceProxy() { ...@@ -70,7 +70,7 @@ AttachmentServiceProxy::~AttachmentServiceProxy() {
void AttachmentServiceProxy::GetOrDownloadAttachments( void AttachmentServiceProxy::GetOrDownloadAttachments(
const AttachmentIdList& attachment_ids, const AttachmentIdList& attachment_ids,
const GetOrDownloadCallback& callback) { const GetOrDownloadCallback& callback) {
DCHECK(wrapped_task_runner_); DCHECK(wrapped_task_runner_.get());
GetOrDownloadCallback proxy_callback = GetOrDownloadCallback proxy_callback =
base::Bind(&ProxyGetOrDownloadCallback, base::Bind(&ProxyGetOrDownloadCallback,
base::ThreadTaskRunnerHandle::Get(), base::ThreadTaskRunnerHandle::Get(),
...@@ -86,7 +86,7 @@ void AttachmentServiceProxy::GetOrDownloadAttachments( ...@@ -86,7 +86,7 @@ void AttachmentServiceProxy::GetOrDownloadAttachments(
void AttachmentServiceProxy::DropAttachments( void AttachmentServiceProxy::DropAttachments(
const AttachmentIdList& attachment_ids, const AttachmentIdList& attachment_ids,
const DropCallback& callback) { const DropCallback& callback) {
DCHECK(wrapped_task_runner_); DCHECK(wrapped_task_runner_.get());
DropCallback proxy_callback = base::Bind( DropCallback proxy_callback = base::Bind(
&ProxyDropCallback, base::ThreadTaskRunnerHandle::Get(), callback); &ProxyDropCallback, base::ThreadTaskRunnerHandle::Get(), callback);
wrapped_task_runner_->PostTask(FROM_HERE, wrapped_task_runner_->PostTask(FROM_HERE,
...@@ -98,7 +98,7 @@ void AttachmentServiceProxy::DropAttachments( ...@@ -98,7 +98,7 @@ void AttachmentServiceProxy::DropAttachments(
void AttachmentServiceProxy::StoreAttachments(const AttachmentList& attachments, void AttachmentServiceProxy::StoreAttachments(const AttachmentList& attachments,
const StoreCallback& callback) { const StoreCallback& callback) {
DCHECK(wrapped_task_runner_); DCHECK(wrapped_task_runner_.get());
StoreCallback proxy_callback = base::Bind( StoreCallback proxy_callback = base::Bind(
&ProxyStoreCallback, base::ThreadTaskRunnerHandle::Get(), callback); &ProxyStoreCallback, base::ThreadTaskRunnerHandle::Get(), callback);
wrapped_task_runner_->PostTask( wrapped_task_runner_->PostTask(
......
...@@ -40,7 +40,7 @@ AttachmentServiceProxy AttachmentServiceProxyForTest::Create() { ...@@ -40,7 +40,7 @@ AttachmentServiceProxy AttachmentServiceProxyForTest::Create() {
scoped_refptr<base::SequencedTaskRunner> runner( scoped_refptr<base::SequencedTaskRunner> runner(
base::ThreadTaskRunnerHandle::Get()); base::ThreadTaskRunnerHandle::Get());
if (!runner) { if (!runner.get()) {
// Dummy runner for tests that don't care about AttachmentServiceProxy. // Dummy runner for tests that don't care about AttachmentServiceProxy.
DVLOG(1) << "Creating dummy MessageLoop for AttachmentServiceProxy."; DVLOG(1) << "Creating dummy MessageLoop for AttachmentServiceProxy.";
base::MessageLoop loop; base::MessageLoop loop;
......
...@@ -108,7 +108,7 @@ AttachmentUploaderImpl::UploadState::UploadState( ...@@ -108,7 +108,7 @@ AttachmentUploaderImpl::UploadState::UploadState(
token_service_provider_(token_service_provider), token_service_provider_(token_service_provider),
owner_(owner) { owner_(owner) {
DCHECK(upload_url_.is_valid()); DCHECK(upload_url_.is_valid());
DCHECK(url_request_context_getter_); DCHECK(url_request_context_getter_.get());
DCHECK(!account_id_.empty()); DCHECK(!account_id_.empty());
DCHECK(!scopes_.empty()); DCHECK(!scopes_.empty());
DCHECK(token_service_provider_); DCHECK(token_service_provider_);
...@@ -222,7 +222,7 @@ AttachmentUploaderImpl::AttachmentUploaderImpl( ...@@ -222,7 +222,7 @@ AttachmentUploaderImpl::AttachmentUploaderImpl(
DCHECK(CalledOnValidThread()); DCHECK(CalledOnValidThread());
DCHECK(!account_id.empty()); DCHECK(!account_id.empty());
DCHECK(!scopes.empty()); DCHECK(!scopes.empty());
DCHECK(token_service_provider_); DCHECK(token_service_provider_.get());
} }
AttachmentUploaderImpl::~AttachmentUploaderImpl() { AttachmentUploaderImpl::~AttachmentUploaderImpl() {
......
...@@ -82,9 +82,8 @@ void HttpBridgeFactory::Init(const std::string& user_agent) { ...@@ -82,9 +82,8 @@ void HttpBridgeFactory::Init(const std::string& user_agent) {
return; return;
} }
request_context_getter_ = request_context_getter_ = new HttpBridge::RequestContextGetter(
new HttpBridge::RequestContextGetter( baseline_request_context_getter_.get(), user_agent);
baseline_request_context_getter_, user_agent);
} }
HttpPostProviderInterface* HttpBridgeFactory::Create() { HttpPostProviderInterface* HttpBridgeFactory::Create() {
......
...@@ -499,10 +499,10 @@ TEST_F(SyncHttpBridgeTest, EarlyAbortFactory) { ...@@ -499,10 +499,10 @@ TEST_F(SyncHttpBridgeTest, EarlyAbortFactory) {
// UI Thread: Initialize the HttpBridgeFactory. The next step would be to // UI Thread: Initialize the HttpBridgeFactory. The next step would be to
// post a task to SBH::Core to have it initialized. // post a task to SBH::Core to have it initialized.
scoped_ptr<syncer::HttpBridgeFactory> factory(new HttpBridgeFactory( scoped_ptr<syncer::HttpBridgeFactory> factory(
baseline_context_getter, new HttpBridgeFactory(baseline_context_getter.get(),
NetworkTimeUpdateCallback(), NetworkTimeUpdateCallback(),
&release_request_context_signal)); &release_request_context_signal));
// UI Thread: A very early shutdown request arrives and executes on the UI // UI Thread: A very early shutdown request arrives and executes on the UI
// thread before the posted sync thread task is run. // thread before the posted sync thread task is run.
......
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