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 // The AllStatus object watches various sync engine components and aggregates | 5 // The AllStatus object watches various sync engine components and aggregates |
6 // the status of all of them into one place. | 6 // the status of all of them into one place. |
7 | 7 |
8 #ifndef CHROME_BROWSER_SYNC_ENGINE_ALL_STATUS_H_ | 8 #ifndef CHROME_BROWSER_SYNC_ENGINE_ALL_STATUS_H_ |
9 #define CHROME_BROWSER_SYNC_ENGINE_ALL_STATUS_H_ | 9 #define CHROME_BROWSER_SYNC_ENGINE_ALL_STATUS_H_ |
10 #pragma once | 10 #pragma once |
(...skipping 29 matching lines...) Expand all Loading... |
40 void SetNotificationsEnabled(bool notifications_enabled); | 40 void SetNotificationsEnabled(bool notifications_enabled); |
41 | 41 |
42 void IncrementNotifiableCommits(); | 42 void IncrementNotifiableCommits(); |
43 | 43 |
44 void IncrementNotificationsReceived(); | 44 void IncrementNotificationsReceived(); |
45 | 45 |
46 void SetEncryptedTypes(const syncable::ModelTypeSet& types); | 46 void SetEncryptedTypes(const syncable::ModelTypeSet& types); |
47 void SetCryptographerReady(bool ready); | 47 void SetCryptographerReady(bool ready); |
48 void SetCryptoHasPendingKeys(bool has_pending_keys); | 48 void SetCryptoHasPendingKeys(bool has_pending_keys); |
49 | 49 |
| 50 void SetUniqueId(const std::string& guid); |
| 51 |
50 protected: | 52 protected: |
51 // Examines syncer to calculate syncing and the unsynced count, | 53 // Examines syncer to calculate syncing and the unsynced count, |
52 // and returns a Status with new values. | 54 // and returns a Status with new values. |
53 sync_api::SyncManager::Status CalcSyncing(const SyncEngineEvent& event) const; | 55 sync_api::SyncManager::Status CalcSyncing(const SyncEngineEvent& event) const; |
54 sync_api::SyncManager::Status CreateBlankStatus() const; | 56 sync_api::SyncManager::Status CreateBlankStatus() const; |
55 | 57 |
56 // Examines status to see what has changed, updates old_status in place. | 58 // Examines status to see what has changed, updates old_status in place. |
57 void CalcStatusChanges(); | 59 void CalcStatusChanges(); |
58 | 60 |
59 sync_api::SyncManager::Status status_; | 61 sync_api::SyncManager::Status status_; |
60 | 62 |
61 mutable base::Lock mutex_; // Protects all data members. | 63 mutable base::Lock mutex_; // Protects all data members. |
62 DISALLOW_COPY_AND_ASSIGN(AllStatus); | 64 DISALLOW_COPY_AND_ASSIGN(AllStatus); |
63 }; | 65 }; |
64 | 66 |
65 class ScopedStatusLock { | 67 class ScopedStatusLock { |
66 public: | 68 public: |
67 explicit ScopedStatusLock(AllStatus* allstatus); | 69 explicit ScopedStatusLock(AllStatus* allstatus); |
68 ~ScopedStatusLock(); | 70 ~ScopedStatusLock(); |
69 protected: | 71 protected: |
70 AllStatus* allstatus_; | 72 AllStatus* allstatus_; |
71 }; | 73 }; |
72 | 74 |
73 } // namespace browser_sync | 75 } // namespace browser_sync |
74 | 76 |
75 #endif // CHROME_BROWSER_SYNC_ENGINE_ALL_STATUS_H_ | 77 #endif // CHROME_BROWSER_SYNC_ENGINE_ALL_STATUS_H_ |
OLD | NEW |