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

Side by Side Diff: chrome/browser/chromeos/policy/affiliated_invalidation_service_provider_impl.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iwyu fixes Created 4 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide r_impl.h" 5 #include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide r_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 return; 300 return;
301 } 301 }
302 } 302 }
303 303
304 if (!device_invalidation_service_) { 304 if (!device_invalidation_service_) {
305 // If no other connected invalidation service was found and no device-global 305 // If no other connected invalidation service was found and no device-global
306 // invalidation service exists, create one. 306 // invalidation service exists, create one.
307 device_invalidation_service_.reset( 307 device_invalidation_service_.reset(
308 new invalidation::TiclInvalidationService( 308 new invalidation::TiclInvalidationService(
309 GetUserAgent(), 309 GetUserAgent(),
310 scoped_ptr<IdentityProvider>(new chromeos::DeviceIdentityProvider( 310 std::unique_ptr<IdentityProvider>(
311 chromeos::DeviceOAuth2TokenServiceFactory::Get())), 311 new chromeos::DeviceIdentityProvider(
312 scoped_ptr<invalidation::TiclSettingsProvider>( 312 chromeos::DeviceOAuth2TokenServiceFactory::Get())),
313 std::unique_ptr<invalidation::TiclSettingsProvider>(
313 new TiclDeviceSettingsProvider), 314 new TiclDeviceSettingsProvider),
314 g_browser_process->gcm_driver(), 315 g_browser_process->gcm_driver(),
315 g_browser_process->system_request_context())); 316 g_browser_process->system_request_context()));
316 device_invalidation_service_->Init( 317 device_invalidation_service_->Init(
317 scoped_ptr<syncer::InvalidationStateTracker>( 318 std::unique_ptr<syncer::InvalidationStateTracker>(
318 new invalidation::InvalidatorStorage( 319 new invalidation::InvalidatorStorage(
319 g_browser_process->local_state()))); 320 g_browser_process->local_state())));
320 device_invalidation_service_observer_.reset( 321 device_invalidation_service_observer_.reset(
321 new InvalidationServiceObserver( 322 new InvalidationServiceObserver(
322 this, 323 this,
323 device_invalidation_service_.get())); 324 device_invalidation_service_.get()));
324 } 325 }
325 326
326 if (device_invalidation_service_observer_->IsServiceConnected()) { 327 if (device_invalidation_service_observer_->IsServiceConnected()) {
327 // If the device-global invalidation service is connected already, make it 328 // If the device-global invalidation service is connected already, make it
328 // available to consumers immediately. Otherwise, the invalidation service 329 // available to consumers immediately. Otherwise, the invalidation service
329 // will be made available to clients when it successfully connects. 330 // will be made available to clients when it successfully connects.
(...skipping 10 matching lines...) Expand all
340 OnInvalidationServiceSet(invalidation_service_)); 341 OnInvalidationServiceSet(invalidation_service_));
341 } 342 }
342 343
343 void 344 void
344 AffiliatedInvalidationServiceProviderImpl::DestroyDeviceInvalidationService() { 345 AffiliatedInvalidationServiceProviderImpl::DestroyDeviceInvalidationService() {
345 device_invalidation_service_observer_.reset(); 346 device_invalidation_service_observer_.reset();
346 device_invalidation_service_.reset(); 347 device_invalidation_service_.reset();
347 } 348 }
348 349
349 } // namespace policy 350 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698