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

Side by Side Diff: components/invalidation/impl/gcm_invalidation_bridge.cc

Issue 2257793002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/location.h" 6 #include "base/location.h"
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 GCMInvalidationBridge::~GCMInvalidationBridge() { 169 GCMInvalidationBridge::~GCMInvalidationBridge() {
170 if (subscribed_for_incoming_messages_) { 170 if (subscribed_for_incoming_messages_) {
171 gcm_driver_->RemoveAppHandler(kInvalidationsAppId); 171 gcm_driver_->RemoveAppHandler(kInvalidationsAppId);
172 gcm_driver_->RemoveConnectionObserver(this); 172 gcm_driver_->RemoveConnectionObserver(this);
173 } 173 }
174 } 174 }
175 175
176 std::unique_ptr<syncer::GCMNetworkChannelDelegate> 176 std::unique_ptr<syncer::GCMNetworkChannelDelegate>
177 GCMInvalidationBridge::CreateDelegate() { 177 GCMInvalidationBridge::CreateDelegate() {
178 DCHECK(CalledOnValidThread()); 178 DCHECK(CalledOnValidThread());
179 return base::WrapUnique(new Core(weak_factory_.GetWeakPtr(), 179 return base::MakeUnique<Core>(weak_factory_.GetWeakPtr(),
180 base::ThreadTaskRunnerHandle::Get())); 180 base::ThreadTaskRunnerHandle::Get());
181 } 181 }
182 182
183 void GCMInvalidationBridge::CoreInitializationDone( 183 void GCMInvalidationBridge::CoreInitializationDone(
184 base::WeakPtr<Core> core, 184 base::WeakPtr<Core> core,
185 scoped_refptr<base::SingleThreadTaskRunner> core_thread_task_runner) { 185 scoped_refptr<base::SingleThreadTaskRunner> core_thread_task_runner) {
186 DCHECK(CalledOnValidThread()); 186 DCHECK(CalledOnValidThread());
187 core_ = core; 187 core_ = core;
188 core_thread_task_runner_ = core_thread_task_runner; 188 core_thread_task_runner_ = core_thread_task_runner;
189 } 189 }
190 190
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 368
369 void GCMInvalidationBridge::OnDisconnected() { 369 void GCMInvalidationBridge::OnDisconnected() {
370 core_thread_task_runner_->PostTask( 370 core_thread_task_runner_->PostTask(
371 FROM_HERE, 371 FROM_HERE,
372 base::Bind(&GCMInvalidationBridge::Core::OnConnectionStateChanged, 372 base::Bind(&GCMInvalidationBridge::Core::OnConnectionStateChanged,
373 core_, 373 core_,
374 false)); 374 false));
375 } 375 }
376 376
377 } // namespace invalidation 377 } // namespace invalidation
OLDNEW
« no previous file with comments | « components/history/core/test/history_service_test_util.cc ('k') | components/invalidation/impl/sync_system_resources.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698