| 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 28 matching lines...) Expand all Loading... |
| 39 virtual void OnSyncEngineEvent(const SyncEngineEvent& event); | 39 virtual void OnSyncEngineEvent(const SyncEngineEvent& event); |
| 40 | 40 |
| 41 sync_api::SyncManager::Status status() const; | 41 sync_api::SyncManager::Status status() const; |
| 42 | 42 |
| 43 void SetNotificationsEnabled(bool notifications_enabled); | 43 void SetNotificationsEnabled(bool notifications_enabled); |
| 44 | 44 |
| 45 void IncrementNotifiableCommits(); | 45 void IncrementNotifiableCommits(); |
| 46 | 46 |
| 47 void IncrementNotificationsReceived(); | 47 void IncrementNotificationsReceived(); |
| 48 | 48 |
| 49 void SetEncryptEverything(bool everything); |
| 50 void SetCryptographerReady(bool ready); |
| 51 |
| 49 protected: | 52 protected: |
| 50 // Examines syncer to calculate syncing and the unsynced count, | 53 // Examines syncer to calculate syncing and the unsynced count, |
| 51 // and returns a Status with new values. | 54 // and returns a Status with new values. |
| 52 sync_api::SyncManager::Status CalcSyncing(const SyncEngineEvent& event) const; | 55 sync_api::SyncManager::Status CalcSyncing(const SyncEngineEvent& event) const; |
| 53 sync_api::SyncManager::Status CreateBlankStatus() const; | 56 sync_api::SyncManager::Status CreateBlankStatus() const; |
| 54 | 57 |
| 55 // 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. |
| 56 void CalcStatusChanges(); | 59 void CalcStatusChanges(); |
| 57 | 60 |
| 58 sync_api::SyncManager::Status status_; | 61 sync_api::SyncManager::Status status_; |
| 59 | 62 |
| 60 mutable base::Lock mutex_; // Protects all data members. | 63 mutable base::Lock mutex_; // Protects all data members. |
| 61 DISALLOW_COPY_AND_ASSIGN(AllStatus); | 64 DISALLOW_COPY_AND_ASSIGN(AllStatus); |
| 62 }; | 65 }; |
| 63 | 66 |
| 64 class ScopedStatusLock { | 67 class ScopedStatusLock { |
| 65 public: | 68 public: |
| 66 explicit ScopedStatusLock(AllStatus* allstatus); | 69 explicit ScopedStatusLock(AllStatus* allstatus); |
| 67 ~ScopedStatusLock(); | 70 ~ScopedStatusLock(); |
| 68 protected: | 71 protected: |
| 69 AllStatus* allstatus_; | 72 AllStatus* allstatus_; |
| 70 }; | 73 }; |
| 71 | 74 |
| 72 } // namespace browser_sync | 75 } // namespace browser_sync |
| 73 | 76 |
| 74 #endif // CHROME_BROWSER_SYNC_ENGINE_ALL_STATUS_H_ | 77 #endif // CHROME_BROWSER_SYNC_ENGINE_ALL_STATUS_H_ |
| OLD | NEW |