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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 void AllStatus::SetCryptographerReady(bool ready) { | 147 void AllStatus::SetCryptographerReady(bool ready) { |
148 ScopedStatusLock lock(this); | 148 ScopedStatusLock lock(this); |
149 status_.cryptographer_ready = ready; | 149 status_.cryptographer_ready = ready; |
150 } | 150 } |
151 | 151 |
152 void AllStatus::SetCryptoHasPendingKeys(bool has_pending_keys) { | 152 void AllStatus::SetCryptoHasPendingKeys(bool has_pending_keys) { |
153 ScopedStatusLock lock(this); | 153 ScopedStatusLock lock(this); |
154 status_.crypto_has_pending_keys = has_pending_keys; | 154 status_.crypto_has_pending_keys = has_pending_keys; |
155 } | 155 } |
156 | 156 |
| 157 void AllStatus::SetPassphraseType(PassphraseType type) { |
| 158 ScopedStatusLock lock(this); |
| 159 status_.passphrase_type = type; |
| 160 } |
| 161 |
| 162 void AllStatus::SetHasKeystoreKey(bool has_keystore_key) { |
| 163 ScopedStatusLock lock(this); |
| 164 status_.has_keystore_key = has_keystore_key; |
| 165 } |
| 166 |
| 167 void AllStatus::SetKeystoreMigrationTime(const base::Time& migration_time) { |
| 168 ScopedStatusLock lock(this); |
| 169 status_.keystore_migration_time = migration_time; |
| 170 } |
| 171 |
157 void AllStatus::SetUniqueId(const std::string& guid) { | 172 void AllStatus::SetUniqueId(const std::string& guid) { |
158 ScopedStatusLock lock(this); | 173 ScopedStatusLock lock(this); |
159 status_.unique_id = guid; | 174 status_.unique_id = guid; |
160 } | 175 } |
161 | 176 |
162 ScopedStatusLock::ScopedStatusLock(AllStatus* allstatus) | 177 ScopedStatusLock::ScopedStatusLock(AllStatus* allstatus) |
163 : allstatus_(allstatus) { | 178 : allstatus_(allstatus) { |
164 allstatus->mutex_.Acquire(); | 179 allstatus->mutex_.Acquire(); |
165 } | 180 } |
166 | 181 |
167 ScopedStatusLock::~ScopedStatusLock() { | 182 ScopedStatusLock::~ScopedStatusLock() { |
168 allstatus_->mutex_.Release(); | 183 allstatus_->mutex_.Release(); |
169 } | 184 } |
170 | 185 |
171 } // namespace syncer | 186 } // namespace syncer |
OLD | NEW |