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

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

Issue 10991005: Added nudge source counters to about:sync. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed indentation Created 8 years, 2 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
« no previous file with comments | « sync/engine/all_status.h ('k') | sync/internal_api/public/engine/sync_status.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/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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 void AllStatus::SetKeystoreMigrationTime(const base::Time& migration_time) { 167 void AllStatus::SetKeystoreMigrationTime(const base::Time& migration_time) {
168 ScopedStatusLock lock(this); 168 ScopedStatusLock lock(this);
169 status_.keystore_migration_time = migration_time; 169 status_.keystore_migration_time = migration_time;
170 } 170 }
171 171
172 void AllStatus::SetUniqueId(const std::string& guid) { 172 void AllStatus::SetUniqueId(const std::string& guid) {
173 ScopedStatusLock lock(this); 173 ScopedStatusLock lock(this);
174 status_.unique_id = guid; 174 status_.unique_id = guid;
175 } 175 }
176 176
177 void AllStatus::IncrementNudgeCounter(NudgeSource source) {
178 ScopedStatusLock lock(this);
179 switch(source) {
180 case NUDGE_SOURCE_LOCAL_REFRESH:
181 status_.nudge_source_local_refresh++;
182 return;
183 case NUDGE_SOURCE_LOCAL:
184 status_.nudge_source_local++;
185 return;
186 case NUDGE_SOURCE_NOTIFICATION:
187 status_.nudge_source_notification++;
188 return;
189 case NUDGE_SOURCE_CONTINUATION:
190 status_.nudge_source_continuation++;
191 return;
192 case NUDGE_SOURCE_UNKNOWN:
193 break;
194 }
195 // If we're here, the source is most likely
196 // NUDGE_SOURCE_UNKNOWN. That shouldn't happen.
197 NOTREACHED();
198 }
199
177 ScopedStatusLock::ScopedStatusLock(AllStatus* allstatus) 200 ScopedStatusLock::ScopedStatusLock(AllStatus* allstatus)
178 : allstatus_(allstatus) { 201 : allstatus_(allstatus) {
179 allstatus->mutex_.Acquire(); 202 allstatus->mutex_.Acquire();
180 } 203 }
181 204
182 ScopedStatusLock::~ScopedStatusLock() { 205 ScopedStatusLock::~ScopedStatusLock() {
183 allstatus_->mutex_.Release(); 206 allstatus_->mutex_.Release();
184 } 207 }
185 208
186 } // namespace syncer 209 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/engine/all_status.h ('k') | sync/internal_api/public/engine/sync_status.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698