Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "chrome/browser/sync/internal_api/all_status.h" | 5 #include "chrome/browser/sync/internal_api/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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 status.sync_protocol_error = snapshot->errors.sync_protocol_error; | 65 status.sync_protocol_error = snapshot->errors.sync_protocol_error; |
| 66 | 66 |
| 67 // Accumulate update count only once per session to avoid double-counting. | 67 // Accumulate update count only once per session to avoid double-counting. |
| 68 // TODO(ncarter): Make this realtime by having the syncer_status | 68 // TODO(ncarter): Make this realtime by having the syncer_status |
| 69 // counter preserve its value across sessions. http://crbug.com/26339 | 69 // counter preserve its value across sessions. http://crbug.com/26339 |
| 70 if (event.what_happened == SyncEngineEvent::SYNC_CYCLE_ENDED) { | 70 if (event.what_happened == SyncEngineEvent::SYNC_CYCLE_ENDED) { |
| 71 status.updates_received += | 71 status.updates_received += |
| 72 snapshot->syncer_status.num_updates_downloaded_total; | 72 snapshot->syncer_status.num_updates_downloaded_total; |
| 73 status.tombstone_updates_received += | 73 status.tombstone_updates_received += |
| 74 snapshot->syncer_status.num_tombstone_updates_downloaded_total; | 74 snapshot->syncer_status.num_tombstone_updates_downloaded_total; |
| 75 status.echo_updates_received += | |
| 76 snapshot->syncer_status.num_echo_updates_downloaded_total; | |
|
tim (not reviewing)
2012/03/20 20:43:53
nit - Even though I like 'echo', we've historicall
rlarocque
2012/03/21 17:42:34
Done.
| |
| 75 status.num_local_overwrites_total += | 77 status.num_local_overwrites_total += |
| 76 snapshot->syncer_status.num_local_overwrites; | 78 snapshot->syncer_status.num_local_overwrites; |
| 77 status.num_server_overwrites_total += | 79 status.num_server_overwrites_total += |
| 78 snapshot->syncer_status.num_server_overwrites; | 80 snapshot->syncer_status.num_server_overwrites; |
| 79 if (snapshot->syncer_status.num_updates_downloaded_total == 0) { | 81 if (snapshot->syncer_status.num_updates_downloaded_total == 0) { |
| 80 ++status.empty_get_updates; | 82 ++status.empty_get_updates; |
| 81 } else { | 83 } else { |
| 82 ++status.nonempty_get_updates; | 84 ++status.nonempty_get_updates; |
| 83 } | 85 } |
| 84 if (snapshot->syncer_status.num_successful_commits == 0) { | 86 if (snapshot->syncer_status.num_successful_commits == 0) { |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 : allstatus_(allstatus) { | 191 : allstatus_(allstatus) { |
| 190 allstatus->mutex_.Acquire(); | 192 allstatus->mutex_.Acquire(); |
| 191 } | 193 } |
| 192 | 194 |
| 193 ScopedStatusLock::~ScopedStatusLock() { | 195 ScopedStatusLock::~ScopedStatusLock() { |
| 194 allstatus_->CalcStatusChanges(); | 196 allstatus_->CalcStatusChanges(); |
| 195 allstatus_->mutex_.Release(); | 197 allstatus_->mutex_.Release(); |
| 196 } | 198 } |
| 197 | 199 |
| 198 } // namespace browser_sync | 200 } // namespace browser_sync |
| OLD | NEW |