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

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

Issue 10824161: [Sync] Avoid unregistering object IDs on shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 4 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_BRIDGED_SYNC_NOTIFIER_H_ 5 #ifndef CHROME_BROWSER_SYNC_GLUE_BRIDGED_SYNC_NOTIFIER_H_
6 #define CHROME_BROWSER_SYNC_GLUE_BRIDGED_SYNC_NOTIFIER_H_ 6 #define CHROME_BROWSER_SYNC_GLUE_BRIDGED_SYNC_NOTIFIER_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "sync/notifier/sync_notifier.h" 10 #include "sync/notifier/sync_notifier.h"
(...skipping 11 matching lines...) Expand all
22 class BridgedSyncNotifier : public syncer::SyncNotifier { 22 class BridgedSyncNotifier : public syncer::SyncNotifier {
23 public: 23 public:
24 // Does not take ownership of |bridge|. Takes ownership of |delegate|. 24 // Does not take ownership of |bridge|. Takes ownership of |delegate|.
25 // |delegate| may be NULL. 25 // |delegate| may be NULL.
26 BridgedSyncNotifier(ChromeSyncNotificationBridge* bridge, 26 BridgedSyncNotifier(ChromeSyncNotificationBridge* bridge,
27 syncer::SyncNotifier* delegate); 27 syncer::SyncNotifier* delegate);
28 virtual ~BridgedSyncNotifier(); 28 virtual ~BridgedSyncNotifier();
29 29
30 // SyncNotifier implementation. Passes through all calls to the delegate. 30 // SyncNotifier implementation. Passes through all calls to the delegate.
31 // UpdateRegisteredIds calls will also be forwarded to the bridge. 31 // UpdateRegisteredIds calls will also be forwarded to the bridge.
32 virtual void UpdateRegisteredIds(syncer::SyncNotifierObserver* handler, 32 virtual void SetHandler(const std::string& handler_name,
msw 2012/08/07 20:09:30 When a Handler wants to unregister itself in this
33 syncer::SyncNotifierObserver* handler) OVERRIDE;
34 virtual void UpdateRegisteredIds(const std::string& handler_name,
33 const syncer::ObjectIdSet& ids) OVERRIDE; 35 const syncer::ObjectIdSet& ids) OVERRIDE;
34 virtual void SetUniqueId(const std::string& unique_id) OVERRIDE; 36 virtual void SetUniqueId(const std::string& unique_id) OVERRIDE;
35 virtual void SetStateDeprecated(const std::string& state) OVERRIDE; 37 virtual void SetStateDeprecated(const std::string& state) OVERRIDE;
36 virtual void UpdateCredentials( 38 virtual void UpdateCredentials(
37 const std::string& email, const std::string& token) OVERRIDE; 39 const std::string& email, const std::string& token) OVERRIDE;
38 virtual void SendNotification( 40 virtual void SendNotification(
39 syncer::ModelTypeSet changed_types) OVERRIDE; 41 syncer::ModelTypeSet changed_types) OVERRIDE;
40 42
41 private: 43 private:
42 // The notification bridge that we register the observers with. 44 // The notification bridge that we register the observers with.
43 ChromeSyncNotificationBridge* bridge_; 45 ChromeSyncNotificationBridge* bridge_;
44 46
45 // The delegate we are wrapping. 47 // The delegate we are wrapping.
46 scoped_ptr<syncer::SyncNotifier> delegate_; 48 scoped_ptr<syncer::SyncNotifier> delegate_;
47 }; 49 };
48 50
49 } // namespace browser_sync 51 } // namespace browser_sync
50 52
51 #endif // CHROME_BROWSER_SYNC_GLUE_BRIDGED_SYNC_NOTIFIER_H_ 53 #endif // CHROME_BROWSER_SYNC_GLUE_BRIDGED_SYNC_NOTIFIER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698