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

Side by Side Diff: chrome/browser/sync/glue/chrome_sync_notification_bridge.h

Issue 10874096: [Sync] Rework Invalidator-related unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments 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
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 CHROME_BROWSER_SYNC_GLUE_CHROME_SYNC_NOTIFICATION_BRIDGE_H_ 5 #ifndef CHROME_BROWSER_SYNC_GLUE_CHROME_SYNC_NOTIFICATION_BRIDGE_H_
6 #define CHROME_BROWSER_SYNC_GLUE_CHROME_SYNC_NOTIFICATION_BRIDGE_H_ 6 #define CHROME_BROWSER_SYNC_GLUE_CHROME_SYNC_NOTIFICATION_BRIDGE_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/sequenced_task_runner.h" 10 #include "base/sequenced_task_runner.h"
11 #include "content/public/browser/notification_observer.h" 11 #include "content/public/browser/notification_observer.h"
12 #include "content/public/browser/notification_registrar.h" 12 #include "content/public/browser/notification_registrar.h"
13 #include "sync/internal_api/public/base/model_type.h"
14 #include "sync/notifier/invalidation_util.h" 13 #include "sync/notifier/invalidation_util.h"
15 14
16 class Profile; 15 class Profile;
17 16
18 namespace syncer { 17 namespace syncer {
19 class InvalidationHandler; 18 class InvalidationHandler;
20 } // namespace 19 } // namespace
21 20
22 namespace browser_sync { 21 namespace browser_sync {
23 22
(...skipping 11 matching lines...) Expand all
35 const Profile* profile, 34 const Profile* profile,
36 const scoped_refptr<base::SequencedTaskRunner>& sync_task_runner); 35 const scoped_refptr<base::SequencedTaskRunner>& sync_task_runner);
37 virtual ~ChromeSyncNotificationBridge(); 36 virtual ~ChromeSyncNotificationBridge();
38 37
39 // Must be called on the UI thread while the sync task runner is still 38 // Must be called on the UI thread while the sync task runner is still
40 // around. No other member functions on the sync thread may be called after 39 // around. No other member functions on the sync thread may be called after
41 // this is called. 40 // this is called.
42 void StopForShutdown(); 41 void StopForShutdown();
43 42
44 // Must be called on the sync task runner. 43 // Must be called on the sync task runner.
45 void UpdateEnabledTypes(syncer::ModelTypeSet enabled_types); 44 void RegisterHandler(syncer::InvalidationHandler* handler);
46 // Marked virtual for tests. 45 void UpdateRegisteredIds(syncer::InvalidationHandler* handler,
47 virtual void RegisterHandler(syncer::InvalidationHandler* handler); 46 const syncer::ObjectIdSet& ids);
48 virtual void UpdateRegisteredIds(syncer::InvalidationHandler* handler, 47 void UnregisterHandler(syncer::InvalidationHandler* handler);
49 const syncer::ObjectIdSet& ids); 48
50 virtual void UnregisterHandler(syncer::InvalidationHandler* handler); 49 bool IsHandlerRegisteredForTest(
50 syncer::InvalidationHandler* handler) const;
51 syncer::ObjectIdSet GetRegisteredIdsForTest(
52 syncer::InvalidationHandler* handler) const;
51 53
52 // NotificationObserver implementation. Called on UI thread. 54 // NotificationObserver implementation. Called on UI thread.
53 virtual void Observe(int type, 55 virtual void Observe(int type,
54 const content::NotificationSource& source, 56 const content::NotificationSource& source,
55 const content::NotificationDetails& details) OVERRIDE; 57 const content::NotificationDetails& details) OVERRIDE;
56 58
57 private: 59 private:
58 // Inner class to hold all the bits used on |sync_task_runner_|. 60 // Inner class to hold all the bits used on |sync_task_runner_|.
59 class Core; 61 class Core;
60 62
61 const scoped_refptr<base::SequencedTaskRunner> sync_task_runner_; 63 const scoped_refptr<base::SequencedTaskRunner> sync_task_runner_;
62 64
63 // Created on the UI thread, used only on |sync_task_runner_|. 65 // Created on the UI thread, used only on |sync_task_runner_|.
64 const scoped_refptr<Core> core_; 66 const scoped_refptr<Core> core_;
65 67
66 // Used only on the UI thread. 68 // Used only on the UI thread.
67 content::NotificationRegistrar registrar_; 69 content::NotificationRegistrar registrar_;
68 }; 70 };
69 71
70 } // namespace browser_sync 72 } // namespace browser_sync
71 73
72 #endif // CHROME_BROWSER_SYNC_GLUE_CHROME_SYNC_NOTIFICATION_BRIDGE_H_ 74 #endif // CHROME_BROWSER_SYNC_GLUE_CHROME_SYNC_NOTIFICATION_BRIDGE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/bridged_invalidator_unittest.cc ('k') | chrome/browser/sync/glue/chrome_sync_notification_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698