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

Side by Side Diff: components/sync_driver/local_device_info_provider_mock.cc

Issue 1907683003: Convert //components/sync_driver from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fix, address feedback 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 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 "components/sync_driver/local_device_info_provider_mock.h" 5 #include "components/sync_driver/local_device_info_provider_mock.h"
6 6
7 namespace sync_driver { 7 namespace sync_driver {
8 8
9 LocalDeviceInfoProviderMock::LocalDeviceInfoProviderMock() 9 LocalDeviceInfoProviderMock::LocalDeviceInfoProviderMock()
10 : is_initialized_(false) {} 10 : is_initialized_(false) {}
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 43
44 void LocalDeviceInfoProviderMock::Initialize( 44 void LocalDeviceInfoProviderMock::Initialize(
45 const std::string& cache_guid, 45 const std::string& cache_guid,
46 const std::string& signin_scoped_device_id, 46 const std::string& signin_scoped_device_id,
47 const scoped_refptr<base::TaskRunner>& blocking_task_runner) { 47 const scoped_refptr<base::TaskRunner>& blocking_task_runner) {
48 // Ignored for the mock provider. 48 // Ignored for the mock provider.
49 } 49 }
50 50
51 void LocalDeviceInfoProviderMock::Initialize( 51 void LocalDeviceInfoProviderMock::Initialize(
52 scoped_ptr<DeviceInfo> local_device_info) { 52 std::unique_ptr<DeviceInfo> local_device_info) {
53 local_device_info_.swap(local_device_info); 53 local_device_info_.swap(local_device_info);
54 SetInitialized(true); 54 SetInitialized(true);
55 } 55 }
56 56
57 scoped_ptr<LocalDeviceInfoProvider::Subscription> 57 std::unique_ptr<LocalDeviceInfoProvider::Subscription>
58 LocalDeviceInfoProviderMock::RegisterOnInitializedCallback( 58 LocalDeviceInfoProviderMock::RegisterOnInitializedCallback(
59 const base::Closure& callback) { 59 const base::Closure& callback) {
60 DCHECK(!is_initialized_); 60 DCHECK(!is_initialized_);
61 return callback_list_.Add(callback); 61 return callback_list_.Add(callback);
62 } 62 }
63 63
64 void LocalDeviceInfoProviderMock::SetInitialized(bool is_initialized) { 64 void LocalDeviceInfoProviderMock::SetInitialized(bool is_initialized) {
65 is_initialized_ = is_initialized; 65 is_initialized_ = is_initialized;
66 if (is_initialized_) { 66 if (is_initialized_) {
67 callback_list_.Notify(); 67 callback_list_.Notify();
68 } 68 }
69 } 69 }
70 70
71 } // namespace sync_driver 71 } // namespace sync_driver
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698