| 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 // 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 SYNC_INTERNAL_API_ALL_STATUS_H_ | 8 #ifndef SYNC_INTERNAL_API_ALL_STATUS_H_ |
| 9 #define SYNC_INTERNAL_API_ALL_STATUS_H_ | 9 #define SYNC_INTERNAL_API_ALL_STATUS_H_ |
| 10 #pragma once | 10 #pragma once |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 virtual void OnSyncEngineEvent(const SyncEngineEvent& event) OVERRIDE; | 42 virtual void OnSyncEngineEvent(const SyncEngineEvent& event) OVERRIDE; |
| 43 | 43 |
| 44 syncer::SyncStatus status() const; | 44 syncer::SyncStatus status() const; |
| 45 | 45 |
| 46 void SetNotificationsEnabled(bool notifications_enabled); | 46 void SetNotificationsEnabled(bool notifications_enabled); |
| 47 | 47 |
| 48 void IncrementNotifiableCommits(); | 48 void IncrementNotifiableCommits(); |
| 49 | 49 |
| 50 void IncrementNotificationsReceived(); | 50 void IncrementNotificationsReceived(); |
| 51 | 51 |
| 52 void SetThrottledTypes(const syncable::ModelTypeSet &types); | 52 void SetThrottledTypes(const syncer::ModelTypeSet &types); |
| 53 | 53 |
| 54 void SetEncryptedTypes(syncable::ModelTypeSet types); | 54 void SetEncryptedTypes(syncer::ModelTypeSet types); |
| 55 void SetCryptographerReady(bool ready); | 55 void SetCryptographerReady(bool ready); |
| 56 void SetCryptoHasPendingKeys(bool has_pending_keys); | 56 void SetCryptoHasPendingKeys(bool has_pending_keys); |
| 57 | 57 |
| 58 void SetUniqueId(const std::string& guid); | 58 void SetUniqueId(const std::string& guid); |
| 59 | 59 |
| 60 protected: | 60 protected: |
| 61 // Examines syncer to calculate syncing and the unsynced count, | 61 // Examines syncer to calculate syncing and the unsynced count, |
| 62 // and returns a Status with new values. | 62 // and returns a Status with new values. |
| 63 syncer::SyncStatus CalcSyncing(const SyncEngineEvent& event) const; | 63 syncer::SyncStatus CalcSyncing(const SyncEngineEvent& event) const; |
| 64 syncer::SyncStatus CreateBlankStatus() const; | 64 syncer::SyncStatus CreateBlankStatus() const; |
| 65 | 65 |
| 66 syncer::SyncStatus status_; | 66 syncer::SyncStatus status_; |
| 67 | 67 |
| 68 mutable base::Lock mutex_; // Protects all data members. | 68 mutable base::Lock mutex_; // Protects all data members. |
| 69 DISALLOW_COPY_AND_ASSIGN(AllStatus); | 69 DISALLOW_COPY_AND_ASSIGN(AllStatus); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 class ScopedStatusLock { | 72 class ScopedStatusLock { |
| 73 public: | 73 public: |
| 74 explicit ScopedStatusLock(AllStatus* allstatus); | 74 explicit ScopedStatusLock(AllStatus* allstatus); |
| 75 ~ScopedStatusLock(); | 75 ~ScopedStatusLock(); |
| 76 protected: | 76 protected: |
| 77 AllStatus* allstatus_; | 77 AllStatus* allstatus_; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace syncer | 80 } // namespace syncer |
| 81 | 81 |
| 82 #endif // SYNC_INTERNAL_API_ALL_STATUS_H_ | 82 #endif // SYNC_INTERNAL_API_ALL_STATUS_H_ |
| OLD | NEW |