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 | |
196 ScopedStatusLock::ScopedStatusLock(AllStatus* allstatus) | 191 ScopedStatusLock::ScopedStatusLock(AllStatus* allstatus) |
197 : allstatus_(allstatus) { | 192 : allstatus_(allstatus) { |
198 allstatus->mutex_.Acquire(); | 193 allstatus->mutex_.Acquire(); |
199 } | 194 } |
200 | 195 |
201 ScopedStatusLock::~ScopedStatusLock() { | 196 ScopedStatusLock::~ScopedStatusLock() { |
202 allstatus_->CalcStatusChanges(); | 197 allstatus_->CalcStatusChanges(); |
203 allstatus_->mutex_.Release(); | 198 allstatus_->mutex_.Release(); |
204 } | 199 } |
205 | 200 |
206 } // namespace browser_sync | 201 } // namespace browser_sync |
OLD | NEW |