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

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

Issue 15580002: Make use of InvalidationService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SYNC_GLUE_ANDROID_INVALIDATOR_BRIDGE_PROXY_H_
6 #define CHROME_BROWSER_SYNC_GLUE_ANDROID_INVALIDATOR_BRIDGE_PROXY_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "sync/notifier/invalidator.h"
11
12 namespace browser_sync {
13
14 class AndroidInvalidatorBridge;
15
16 // This class implements the Invalidator interface by wrapping (but not taking
17 // ownership of) an AndroidInvalidatorBridge. This is useful because the
18 // SyncManager currently expects to take ownership of its invalidator, but it is
19 // not prepared to take ownership of the UI-thread-owned
20 // AndroidInvalidatorBridge. So we use this class to wrap the
21 // AndroidInvalidator and allow the SyncManager to own it instead.
22 class AndroidInvalidatorBridgeProxy : public syncer::Invalidator {
23 public:
24 // Does not take ownership of |bridge|.
25 explicit AndroidInvalidatorBridgeProxy(AndroidInvalidatorBridge* bridge);
26 virtual ~AndroidInvalidatorBridgeProxy();
27
28 // Invalidator implementation. Passes through all calls to the bridge.
29 virtual void RegisterHandler(syncer::InvalidationHandler* handler) OVERRIDE;
30 virtual void UpdateRegisteredIds(syncer::InvalidationHandler * handler,
31 const syncer::ObjectIdSet& ids) OVERRIDE;
32 virtual void UnregisterHandler(syncer::InvalidationHandler* handler) OVERRIDE;
33 virtual void Acknowledge(const invalidation::ObjectId& id,
34 const syncer::AckHandle& ack_handle) OVERRIDE;
35 virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE;
36 virtual void UpdateCredentials(
37 const std::string& email, const std::string& token) OVERRIDE;
38 virtual void SendInvalidation(
39 const syncer::ObjectIdInvalidationMap& invalidation_map) OVERRIDE;
40
41 private:
42 // The notification bridge that we forward to but don't own.
43 AndroidInvalidatorBridge* const bridge_;
44
45 DISALLOW_COPY_AND_ASSIGN(AndroidInvalidatorBridgeProxy);
46 };
47
48 } // namespace browser_sync
49
50 #endif // CHROME_BROWSER_SYNC_GLUE_ANDROID_INVALIDATOR_BRIDGE_PROXY_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/android_invalidator_bridge.cc ('k') | chrome/browser/sync/glue/android_invalidator_bridge_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698