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

Side by Side Diff: sync/internal_api/test/fake_sync_manager.cc

Issue 10828158: [Sync] Address msw's comments for r149747 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nits Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « sync/internal_api/sync_manager_impl.cc ('k') | sync/notifier/object_id_payload_map.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "sync/internal_api/public/test/fake_sync_manager.h" 5 #include "sync/internal_api/public/test/fake_sync_manager.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 downloaded_types_.Clear(); 48 downloaded_types_.Clear();
49 return downloaded_types; 49 return downloaded_types;
50 } 50 }
51 51
52 ModelTypeSet FakeSyncManager::GetAndResetEnabledTypes() { 52 ModelTypeSet FakeSyncManager::GetAndResetEnabledTypes() {
53 ModelTypeSet enabled_types = enabled_types_; 53 ModelTypeSet enabled_types = enabled_types_;
54 enabled_types_.Clear(); 54 enabled_types_.Clear();
55 return enabled_types; 55 return enabled_types;
56 } 56 }
57 57
58 void FakeSyncManager::Invalidate( 58 void FakeSyncManager::Invalidate(const ObjectIdPayloadMap& id_payloads,
59 const ObjectIdPayloadMap& id_payloads, 59 IncomingNotificationSource source) {
60 IncomingNotificationSource source) {
61 if (!sync_task_runner_->PostTask( 60 if (!sync_task_runner_->PostTask(
62 FROM_HERE, 61 FROM_HERE,
63 base::Bind(&FakeSyncManager::InvalidateOnSyncThread, 62 base::Bind(&FakeSyncManager::InvalidateOnSyncThread,
64 base::Unretained(this), id_payloads, source))) { 63 base::Unretained(this), id_payloads, source))) {
65 NOTREACHED(); 64 NOTREACHED();
66 } 65 }
67 } 66 }
68 67
69 void FakeSyncManager::EnableNotifications() { 68 void FakeSyncManager::EnableNotifications() {
70 if (!sync_task_runner_->PostTask( 69 if (!sync_task_runner_->PostTask(
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 143
145 void FakeSyncManager::UpdateCredentials(const SyncCredentials& credentials) { 144 void FakeSyncManager::UpdateCredentials(const SyncCredentials& credentials) {
146 NOTIMPLEMENTED(); 145 NOTIMPLEMENTED();
147 } 146 }
148 147
149 void FakeSyncManager::UpdateEnabledTypes(const ModelTypeSet& types) { 148 void FakeSyncManager::UpdateEnabledTypes(const ModelTypeSet& types) {
150 enabled_types_ = types; 149 enabled_types_ = types;
151 } 150 }
152 151
153 void FakeSyncManager::UpdateRegisteredInvalidationIds( 152 void FakeSyncManager::UpdateRegisteredInvalidationIds(
154 SyncNotifierObserver* handler, const ObjectIdSet& ids) { 153 SyncNotifierObserver* handler,
154 const ObjectIdSet& ids) {
155 notifier_helper_.UpdateRegisteredIds(handler, ids); 155 notifier_helper_.UpdateRegisteredIds(handler, ids);
156 } 156 }
157 157
158 void FakeSyncManager::StartSyncingNormally( 158 void FakeSyncManager::StartSyncingNormally(
159 const ModelSafeRoutingInfo& routing_info) { 159 const ModelSafeRoutingInfo& routing_info) {
160 // Do nothing. 160 // Do nothing.
161 } 161 }
162 162
163 void FakeSyncManager::SetEncryptionPassphrase(const std::string& passphrase, 163 void FakeSyncManager::SetEncryptionPassphrase(const std::string& passphrase,
164 bool is_explicit) { 164 bool is_explicit) {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 notifier_helper_.EmitOnNotificationsEnabled(); 273 notifier_helper_.EmitOnNotificationsEnabled();
274 } 274 }
275 275
276 void FakeSyncManager::DisableNotificationsOnSyncThread( 276 void FakeSyncManager::DisableNotificationsOnSyncThread(
277 NotificationsDisabledReason reason) { 277 NotificationsDisabledReason reason) {
278 DCHECK(sync_task_runner_->RunsTasksOnCurrentThread()); 278 DCHECK(sync_task_runner_->RunsTasksOnCurrentThread());
279 notifier_helper_.EmitOnNotificationsDisabled(reason); 279 notifier_helper_.EmitOnNotificationsDisabled(reason);
280 } 280 }
281 281
282 } // namespace syncer 282 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/sync_manager_impl.cc ('k') | sync/notifier/object_id_payload_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698