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

Side by Side Diff: sync/internal_api/public/test/fake_sync_manager.h

Issue 10916131: [Invalidations] Add GetInvalidatorState() to Invalidator{,Frontend} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix android Created 8 years, 3 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
« no previous file with comments | « chrome/browser/sync/test_profile_sync_service.cc ('k') | sync/internal_api/sync_manager_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ 5 #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_
6 #define SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ 6 #define SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // GetAndResetDownloadedTypes(), or since startup if never called. 48 // GetAndResetDownloadedTypes(), or since startup if never called.
49 ModelTypeSet GetAndResetDownloadedTypes(); 49 ModelTypeSet GetAndResetDownloadedTypes();
50 50
51 // Returns those types that have been marked as enabled since the 51 // Returns those types that have been marked as enabled since the
52 // last call to GetAndResetEnabledTypes(), or since startup if never 52 // last call to GetAndResetEnabledTypes(), or since startup if never
53 // called. 53 // called.
54 ModelTypeSet GetAndResetEnabledTypes(); 54 ModelTypeSet GetAndResetEnabledTypes();
55 55
56 // Posts a method to invalidate the given IDs on the sync thread. 56 // Posts a method to invalidate the given IDs on the sync thread.
57 void Invalidate(const ObjectIdStateMap& id_state_map, 57 void Invalidate(const ObjectIdStateMap& id_state_map,
58 IncomingNotificationSource source); 58 IncomingInvalidationSource source);
59 59
60 // Posts a method to enable notifications on the sync thread. 60 // Posts a method to update the invalidator state on the sync thread.
61 void EnableNotifications(); 61 void UpdateInvalidatorState(InvalidatorState state);
62
63 // Posts a method to disable notifications on the sync thread.
64 void DisableNotifications(NotificationsDisabledReason reason);
65 62
66 // Block until the sync thread has finished processing any pending messages. 63 // Block until the sync thread has finished processing any pending messages.
67 void WaitForSyncThread(); 64 void WaitForSyncThread();
68 65
69 // SyncManager implementation. 66 // SyncManager implementation.
70 // Note: we treat whatever message loop this is called from as the sync 67 // Note: we treat whatever message loop this is called from as the sync
71 // loop for purposes of callbacks. 68 // loop for purposes of callbacks.
72 virtual void Init( 69 virtual void Init(
73 const FilePath& database_location, 70 const FilePath& database_location,
74 const WeakHandle<JsEventHandler>& event_handler, 71 const WeakHandle<JsEventHandler>& event_handler,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 virtual void StopSyncingForShutdown(const base::Closure& callback) OVERRIDE; 115 virtual void StopSyncingForShutdown(const base::Closure& callback) OVERRIDE;
119 virtual void ShutdownOnSyncThread() OVERRIDE; 116 virtual void ShutdownOnSyncThread() OVERRIDE;
120 virtual UserShare* GetUserShare() OVERRIDE; 117 virtual UserShare* GetUserShare() OVERRIDE;
121 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE; 118 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE;
122 virtual bool HasUnsyncedItems() OVERRIDE; 119 virtual bool HasUnsyncedItems() OVERRIDE;
123 virtual SyncEncryptionHandler* GetEncryptionHandler() OVERRIDE; 120 virtual SyncEncryptionHandler* GetEncryptionHandler() OVERRIDE;
124 121
125 private: 122 private:
126 void InvalidateOnSyncThread( 123 void InvalidateOnSyncThread(
127 const ObjectIdStateMap& id_state_map, 124 const ObjectIdStateMap& id_state_map,
128 IncomingNotificationSource source); 125 IncomingInvalidationSource source);
129 void EnableNotificationsOnSyncThread(); 126 void UpdateInvalidatorStateOnSyncThread(InvalidatorState state);
130 void DisableNotificationsOnSyncThread(NotificationsDisabledReason reason);
131 127
132 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_; 128 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_;
133 129
134 ObserverList<SyncManager::Observer> observers_; 130 ObserverList<SyncManager::Observer> observers_;
135 131
136 // Faked directory state. 132 // Faked directory state.
137 ModelTypeSet initial_sync_ended_types_; 133 ModelTypeSet initial_sync_ended_types_;
138 ModelTypeSet progress_marker_types_; 134 ModelTypeSet progress_marker_types_;
139 135
140 // Test specific state. 136 // Test specific state.
(...skipping 11 matching lines...) Expand all
152 InvalidatorRegistrar registrar_; 148 InvalidatorRegistrar registrar_;
153 149
154 scoped_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_; 150 scoped_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_;
155 151
156 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); 152 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager);
157 }; 153 };
158 154
159 } // namespace syncer 155 } // namespace syncer
160 156
161 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ 157 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/test_profile_sync_service.cc ('k') | sync/internal_api/sync_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698