Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: sync/internal_api/all_status.h

Issue 10454105: sync: Refactor per-datatype throttling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up and rebased Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 virtual void OnSyncEngineEvent(const SyncEngineEvent& event) OVERRIDE; 44 virtual void OnSyncEngineEvent(const SyncEngineEvent& event) OVERRIDE;
45 45
46 sync_api::SyncManager::Status status() const; 46 sync_api::SyncManager::Status status() const;
47 47
48 void SetNotificationsEnabled(bool notifications_enabled); 48 void SetNotificationsEnabled(bool notifications_enabled);
49 49
50 void IncrementNotifiableCommits(); 50 void IncrementNotifiableCommits();
51 51
52 void IncrementNotificationsReceived(); 52 void IncrementNotificationsReceived();
53 53
54 void SetThrottledTypes(syncable::ModelTypeSet types);
tim (not reviewing) 2012/06/11 18:53:46 I'm not sure why SetEncryptedTypes doesn't use con
rlarocque 2012/06/11 23:28:51 Done. I fixed SetEncryptedTypes, too. I feel b
55
54 void SetEncryptedTypes(syncable::ModelTypeSet types); 56 void SetEncryptedTypes(syncable::ModelTypeSet types);
55 void SetCryptographerReady(bool ready); 57 void SetCryptographerReady(bool ready);
56 void SetCryptoHasPendingKeys(bool has_pending_keys); 58 void SetCryptoHasPendingKeys(bool has_pending_keys);
57 59
58 void SetUniqueId(const std::string& guid); 60 void SetUniqueId(const std::string& guid);
59 61
60 protected: 62 protected:
61 // Examines syncer to calculate syncing and the unsynced count, 63 // Examines syncer to calculate syncing and the unsynced count,
62 // and returns a Status with new values. 64 // and returns a Status with new values.
63 sync_api::SyncManager::Status CalcSyncing(const SyncEngineEvent& event) const; 65 sync_api::SyncManager::Status CalcSyncing(const SyncEngineEvent& event) const;
64 sync_api::SyncManager::Status CreateBlankStatus() const; 66 sync_api::SyncManager::Status CreateBlankStatus() const;
65 67
66 sync_api::SyncManager::Status status_; 68 sync_api::SyncManager::Status status_;
67 69
68 mutable base::Lock mutex_; // Protects all data members. 70 mutable base::Lock mutex_; // Protects all data members.
69 DISALLOW_COPY_AND_ASSIGN(AllStatus); 71 DISALLOW_COPY_AND_ASSIGN(AllStatus);
70 }; 72 };
71 73
72 class ScopedStatusLock { 74 class ScopedStatusLock {
73 public: 75 public:
74 explicit ScopedStatusLock(AllStatus* allstatus); 76 explicit ScopedStatusLock(AllStatus* allstatus);
75 ~ScopedStatusLock(); 77 ~ScopedStatusLock();
76 protected: 78 protected:
77 AllStatus* allstatus_; 79 AllStatus* allstatus_;
78 }; 80 };
79 81
80 } // namespace browser_sync 82 } // namespace browser_sync
81 83
82 #endif // SYNC_INTERNAL_API_ALL_STATUS_H_ 84 #endif // SYNC_INTERNAL_API_ALL_STATUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698