| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/engine/all_status.h" | 5 #include "chrome/browser/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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 void AllStatus::SetCryptographerReady(bool ready) { | 181 void AllStatus::SetCryptographerReady(bool ready) { |
| 182 ScopedStatusLock lock(this); | 182 ScopedStatusLock lock(this); |
| 183 status_.cryptographer_ready = ready; | 183 status_.cryptographer_ready = ready; |
| 184 } | 184 } |
| 185 | 185 |
| 186 void AllStatus::SetCryptoHasPendingKeys(bool has_pending_keys) { | 186 void AllStatus::SetCryptoHasPendingKeys(bool has_pending_keys) { |
| 187 ScopedStatusLock lock(this); | 187 ScopedStatusLock lock(this); |
| 188 status_.crypto_has_pending_keys = has_pending_keys; | 188 status_.crypto_has_pending_keys = has_pending_keys; |
| 189 } | 189 } |
| 190 | 190 |
| 191 void AllStatus::SetUniqueId(const std::string& guid) { |
| 192 ScopedStatusLock lock(this); |
| 193 status_.unique_id = guid; |
| 194 } |
| 195 |
| 191 ScopedStatusLock::ScopedStatusLock(AllStatus* allstatus) | 196 ScopedStatusLock::ScopedStatusLock(AllStatus* allstatus) |
| 192 : allstatus_(allstatus) { | 197 : allstatus_(allstatus) { |
| 193 allstatus->mutex_.Acquire(); | 198 allstatus->mutex_.Acquire(); |
| 194 } | 199 } |
| 195 | 200 |
| 196 ScopedStatusLock::~ScopedStatusLock() { | 201 ScopedStatusLock::~ScopedStatusLock() { |
| 197 allstatus_->CalcStatusChanges(); | 202 allstatus_->CalcStatusChanges(); |
| 198 allstatus_->mutex_.Release(); | 203 allstatus_->mutex_.Release(); |
| 199 } | 204 } |
| 200 | 205 |
| 201 } // namespace browser_sync | 206 } // namespace browser_sync |
| OLD | NEW |