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

Side by Side Diff: chrome/browser/sync/notifier/chrome_invalidation_client.h

Issue 2861034: Decomped registration logic into its own class. (Closed)
Patch Set: synced to head Created 10 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/sync/notifier/chrome_invalidation_client.cc » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // A simple wrapper around invalidation::InvalidationClient that 5 // A simple wrapper around invalidation::InvalidationClient that
6 // handles all the startup/shutdown details and hookups. 6 // handles all the startup/shutdown details and hookups.
7 7
8 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ 8 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_
9 #define CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ 9 #define CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_
10 10
11 #include <string> 11 #include <string>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/non_thread_safe.h" 14 #include "base/non_thread_safe.h"
15 #include "base/scoped_ptr.h" 15 #include "base/scoped_ptr.h"
16 #include "chrome/browser/sync/notifier/chrome_system_resources.h" 16 #include "chrome/browser/sync/notifier/chrome_system_resources.h"
17 #include "chrome/browser/sync/syncable/model_type.h" 17 #include "chrome/browser/sync/syncable/model_type.h"
18 #include "google/cacheinvalidation/invalidation-client.h" 18 #include "google/cacheinvalidation/invalidation-client.h"
19 19
20 namespace buzz { 20 namespace buzz {
21 class XmppClient; 21 class XmppClient;
22 } // namespace 22 } // namespace
23 23
24 namespace sync_notifier { 24 namespace sync_notifier {
25 25
26 class CacheInvalidationPacketHandler; 26 class CacheInvalidationPacketHandler;
27 class RegistrationManager;
27 28
28 // TODO(akalin): Hook this up to a NetworkChangeNotifier so we can 29 // TODO(akalin): Hook this up to a NetworkChangeNotifier so we can
29 // properly notify invalidation_client_. 30 // properly notify invalidation_client_.
30 31
31 class ChromeInvalidationClient : public invalidation::InvalidationListener { 32 class ChromeInvalidationClient : public invalidation::InvalidationListener {
32 public: 33 public:
33 class Listener { 34 class Listener {
34 public: 35 public:
35 virtual ~Listener(); 36 virtual ~Listener();
36 37
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 virtual void RegistrationLost(const invalidation::ObjectId& object_id, 71 virtual void RegistrationLost(const invalidation::ObjectId& object_id,
71 invalidation::Closure* callback); 72 invalidation::Closure* callback);
72 73
73 private: 74 private:
74 NonThreadSafe non_thread_safe_; 75 NonThreadSafe non_thread_safe_;
75 ChromeSystemResources chrome_system_resources_; 76 ChromeSystemResources chrome_system_resources_;
76 Listener* listener_; 77 Listener* listener_;
77 scoped_ptr<invalidation::InvalidationClient> invalidation_client_; 78 scoped_ptr<invalidation::InvalidationClient> invalidation_client_;
78 scoped_ptr<CacheInvalidationPacketHandler> 79 scoped_ptr<CacheInvalidationPacketHandler>
79 cache_invalidation_packet_handler_; 80 cache_invalidation_packet_handler_;
80 81 scoped_ptr<RegistrationManager> registration_manager_;
81 void OnRegister(const invalidation::RegistrationUpdateResult& result);
82 82
83 DISALLOW_COPY_AND_ASSIGN(ChromeInvalidationClient); 83 DISALLOW_COPY_AND_ASSIGN(ChromeInvalidationClient);
84 }; 84 };
85 85
86 } // namespace sync_notifier 86 } // namespace sync_notifier
87 87
88 #endif // CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ 88 #endif // CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/notifier/chrome_invalidation_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698