Chromium Code Reviews| Index: sync/engine/all_status.cc |
| diff --git a/sync/engine/all_status.cc b/sync/engine/all_status.cc |
| index 656d6e0b861b2b922f1eef66f514762afe1af69c..579bbb9c2dd4e9021b1b0865a323a33b8d835e22 100644 |
| --- a/sync/engine/all_status.cc |
| +++ b/sync/engine/all_status.cc |
| @@ -174,6 +174,27 @@ void AllStatus::SetUniqueId(const std::string& guid) { |
| status_.unique_id = guid; |
| } |
| +void AllStatus::IncrementNudgeCounter(NudgeSource source) { |
| + ScopedStatusLock lock(this); |
| + switch(source) { |
| + case NUDGE_SOURCE_LOCAL_REFRESH: |
| + status_.nudge_source_local_refresh++; |
| + break; |
| + case NUDGE_SOURCE_LOCAL: |
| + status_.nudge_source_local++; |
| + break; |
| + case NUDGE_SOURCE_NOTIFICATION: |
| + status_.nudge_source_notification++; |
| + break; |
| + case NUDGE_SOURCE_CONTINUATION: |
| + status_.nudge_source_continuation++; |
| + break; |
| + case NUDGE_SOURCE_UNKNOWN: |
|
rlarocque
2012/09/24 23:24:37
This shouldn't happen. I think you could NOTREACH
|
| + default: |
| + status_.nudge_source_unknown++; |
| + } |
| +} |
| + |
| ScopedStatusLock::ScopedStatusLock(AllStatus* allstatus) |
| : allstatus_(allstatus) { |
| allstatus->mutex_.Acquire(); |