| 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 // Wraps PrefService in an InvalidationStateTracker to allow SyncNotifiers | 5 // Wraps PrefService in an InvalidationStateTracker to allow SyncNotifiers |
| 6 // to use PrefService as persistence for invalidation state. It is not thread | 6 // to use PrefService as persistence for invalidation state. It is not thread |
| 7 // safe, and lives on the UI thread. | 7 // safe, and lives on the UI thread. |
| 8 | 8 |
| 9 #ifndef CHROME_BROWSER_INVALIDATION_INVALIDATOR_STORAGE_H_ | 9 #ifndef CHROME_BROWSER_INVALIDATION_INVALIDATOR_STORAGE_H_ |
| 10 #define CHROME_BROWSER_INVALIDATION_INVALIDATOR_STORAGE_H_ | 10 #define CHROME_BROWSER_INVALIDATION_INVALIDATOR_STORAGE_H_ |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 namespace user_prefs { | 25 namespace user_prefs { |
| 26 class PrefRegistrySyncable; | 26 class PrefRegistrySyncable; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace invalidation { | 29 namespace invalidation { |
| 30 | 30 |
| 31 class InvalidatorStorage : public base::SupportsWeakPtr<InvalidatorStorage>, | 31 class InvalidatorStorage : public base::SupportsWeakPtr<InvalidatorStorage>, |
| 32 public syncer::InvalidationStateTracker { | 32 public syncer::InvalidationStateTracker { |
| 33 public: | 33 public: |
| 34 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); | 34 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 35 | 35 |
| 36 // |pref_service| may be NULL (for unit tests), but in that case no setter | 36 // |pref_service| may be NULL (for unit tests), but in that case no setter |
| 37 // methods should be called. Does not own |pref_service|. | 37 // methods should be called. Does not own |pref_service|. |
| 38 explicit InvalidatorStorage(PrefService* pref_service); | 38 explicit InvalidatorStorage(PrefService* pref_service); |
| 39 virtual ~InvalidatorStorage(); | 39 virtual ~InvalidatorStorage(); |
| 40 | 40 |
| 41 // InvalidationStateTracker implementation. | 41 // InvalidationStateTracker implementation. |
| 42 virtual syncer::InvalidationStateMap GetAllInvalidationStates() const | 42 virtual syncer::InvalidationStateMap GetAllInvalidationStates() const |
| 43 OVERRIDE; | 43 OVERRIDE; |
| 44 virtual void SetMaxVersionAndPayload(const invalidation::ObjectId& id, | 44 virtual void SetMaxVersionAndPayload(const invalidation::ObjectId& id, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 // May be NULL. | 96 // May be NULL. |
| 97 PrefService* const pref_service_; | 97 PrefService* const pref_service_; |
| 98 | 98 |
| 99 DISALLOW_COPY_AND_ASSIGN(InvalidatorStorage); | 99 DISALLOW_COPY_AND_ASSIGN(InvalidatorStorage); |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 } // namespace invalidation | 102 } // namespace invalidation |
| 103 | 103 |
| 104 #endif // CHROME_BROWSER_INVALIDATION_INVALIDATOR_STORAGE_H_ | 104 #endif // CHROME_BROWSER_INVALIDATION_INVALIDATOR_STORAGE_H_ |
| OLD | NEW |