| 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 "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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 void AllStatus::SetHasKeystoreKey(bool has_keystore_key) { | 157 void AllStatus::SetHasKeystoreKey(bool has_keystore_key) { |
| 158 ScopedStatusLock lock(this); | 158 ScopedStatusLock lock(this); |
| 159 status_.has_keystore_key = has_keystore_key; | 159 status_.has_keystore_key = has_keystore_key; |
| 160 } | 160 } |
| 161 | 161 |
| 162 void AllStatus::SetKeystoreMigrationTime(const base::Time& migration_time) { | 162 void AllStatus::SetKeystoreMigrationTime(const base::Time& migration_time) { |
| 163 ScopedStatusLock lock(this); | 163 ScopedStatusLock lock(this); |
| 164 status_.keystore_migration_time = migration_time; | 164 status_.keystore_migration_time = migration_time; |
| 165 } | 165 } |
| 166 | 166 |
| 167 void AllStatus::SetUniqueId(const std::string& guid) { | 167 void AllStatus::SetSyncId(const std::string& sync_id) { |
| 168 ScopedStatusLock lock(this); | 168 ScopedStatusLock lock(this); |
| 169 status_.unique_id = guid; | 169 status_.sync_id = sync_id; |
| 170 } |
| 171 |
| 172 void AllStatus::SetInvalidatorClientId( |
| 173 const std::string& invalidator_client_id) { |
| 174 ScopedStatusLock lock(this); |
| 175 status_.invalidator_client_id = invalidator_client_id; |
| 170 } | 176 } |
| 171 | 177 |
| 172 void AllStatus::IncrementNudgeCounter(NudgeSource source) { | 178 void AllStatus::IncrementNudgeCounter(NudgeSource source) { |
| 173 ScopedStatusLock lock(this); | 179 ScopedStatusLock lock(this); |
| 174 switch(source) { | 180 switch(source) { |
| 175 case NUDGE_SOURCE_LOCAL_REFRESH: | 181 case NUDGE_SOURCE_LOCAL_REFRESH: |
| 176 status_.nudge_source_local_refresh++; | 182 status_.nudge_source_local_refresh++; |
| 177 return; | 183 return; |
| 178 case NUDGE_SOURCE_LOCAL: | 184 case NUDGE_SOURCE_LOCAL: |
| 179 status_.nudge_source_local++; | 185 status_.nudge_source_local++; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 192 ScopedStatusLock::ScopedStatusLock(AllStatus* allstatus) | 198 ScopedStatusLock::ScopedStatusLock(AllStatus* allstatus) |
| 193 : allstatus_(allstatus) { | 199 : allstatus_(allstatus) { |
| 194 allstatus->mutex_.Acquire(); | 200 allstatus->mutex_.Acquire(); |
| 195 } | 201 } |
| 196 | 202 |
| 197 ScopedStatusLock::~ScopedStatusLock() { | 203 ScopedStatusLock::~ScopedStatusLock() { |
| 198 allstatus_->mutex_.Release(); | 204 allstatus_->mutex_.Release(); |
| 199 } | 205 } |
| 200 | 206 |
| 201 } // namespace syncer | 207 } // namespace syncer |
| OLD | NEW |