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

Side by Side Diff: sync/engine/all_status.cc

Issue 12256033: Separate invalidator and sync client ID (part 1/2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 9 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/engine/all_status.h ('k') | sync/engine/sync_scheduler_unittest.cc » ('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/engine/all_status.h" 5 #include "sync/engine/all_status.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/port.h" 10 #include "base/port.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 void AllStatus::SetHasKeystoreKey(bool has_keystore_key) { 160 void AllStatus::SetHasKeystoreKey(bool has_keystore_key) {
161 ScopedStatusLock lock(this); 161 ScopedStatusLock lock(this);
162 status_.has_keystore_key = has_keystore_key; 162 status_.has_keystore_key = has_keystore_key;
163 } 163 }
164 164
165 void AllStatus::SetKeystoreMigrationTime(const base::Time& migration_time) { 165 void AllStatus::SetKeystoreMigrationTime(const base::Time& migration_time) {
166 ScopedStatusLock lock(this); 166 ScopedStatusLock lock(this);
167 status_.keystore_migration_time = migration_time; 167 status_.keystore_migration_time = migration_time;
168 } 168 }
169 169
170 void AllStatus::SetUniqueId(const std::string& guid) { 170 void AllStatus::SetSyncId(const std::string& sync_id) {
171 ScopedStatusLock lock(this); 171 ScopedStatusLock lock(this);
172 status_.unique_id = guid; 172 status_.sync_id = sync_id;
173 }
174
175 void AllStatus::SetInvalidatorClientId(
176 const std::string& invalidator_client_id) {
177 ScopedStatusLock lock(this);
178 status_.invalidator_client_id = invalidator_client_id;
173 } 179 }
174 180
175 void AllStatus::IncrementNudgeCounter(NudgeSource source) { 181 void AllStatus::IncrementNudgeCounter(NudgeSource source) {
176 ScopedStatusLock lock(this); 182 ScopedStatusLock lock(this);
177 switch(source) { 183 switch(source) {
178 case NUDGE_SOURCE_LOCAL_REFRESH: 184 case NUDGE_SOURCE_LOCAL_REFRESH:
179 status_.nudge_source_local_refresh++; 185 status_.nudge_source_local_refresh++;
180 return; 186 return;
181 case NUDGE_SOURCE_LOCAL: 187 case NUDGE_SOURCE_LOCAL:
182 status_.nudge_source_local++; 188 status_.nudge_source_local++;
(...skipping 12 matching lines...) Expand all
195 ScopedStatusLock::ScopedStatusLock(AllStatus* allstatus) 201 ScopedStatusLock::ScopedStatusLock(AllStatus* allstatus)
196 : allstatus_(allstatus) { 202 : allstatus_(allstatus) {
197 allstatus->mutex_.Acquire(); 203 allstatus->mutex_.Acquire();
198 } 204 }
199 205
200 ScopedStatusLock::~ScopedStatusLock() { 206 ScopedStatusLock::~ScopedStatusLock() {
201 allstatus_->mutex_.Release(); 207 allstatus_->mutex_.Release();
202 } 208 }
203 209
204 } // namespace syncer 210 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/engine/all_status.h ('k') | sync/engine/sync_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698