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

Side by Side Diff: sync/notifier/invalidation_notifier.h

Issue 11229015: Add the InvalidationState struct to bundle local state about invalidations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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 // An implementation of Invalidator that wraps an invalidation 5 // An implementation of Invalidator that wraps an invalidation
6 // client. Handles the details of connecting to XMPP and hooking it 6 // client. Handles the details of connecting to XMPP and hooking it
7 // up to the invalidation client. 7 // up to the invalidation client.
8 // 8 //
9 // You probably don't want to use this directly; use 9 // You probably don't want to use this directly; use
10 // NonBlockingInvalidationNotifier. 10 // NonBlockingInvalidationNotifier.
(...skipping 23 matching lines...) Expand all
34 // This class must live on the IO thread. 34 // This class must live on the IO thread.
35 // TODO(dcheng): Think of a name better than InvalidationInvalidator. 35 // TODO(dcheng): Think of a name better than InvalidationInvalidator.
36 class InvalidationNotifier 36 class InvalidationNotifier
37 : public Invalidator, 37 : public Invalidator,
38 public SyncInvalidationListener::Delegate, 38 public SyncInvalidationListener::Delegate,
39 public base::NonThreadSafe { 39 public base::NonThreadSafe {
40 public: 40 public:
41 // |invalidation_state_tracker| must be initialized. 41 // |invalidation_state_tracker| must be initialized.
42 InvalidationNotifier( 42 InvalidationNotifier(
43 scoped_ptr<notifier::PushClient> push_client, 43 scoped_ptr<notifier::PushClient> push_client,
44 const InvalidationVersionMap& initial_max_invalidation_versions, 44 const InvalidationStateMap& initial_invalidation_state_map,
45 const std::string& invalidation_bootstrap_data, 45 const std::string& invalidation_bootstrap_data,
46 const WeakHandle<InvalidationStateTracker>& 46 const WeakHandle<InvalidationStateTracker>&
47 invalidation_state_tracker, 47 invalidation_state_tracker,
48 const std::string& client_info); 48 const std::string& client_info);
49 49
50 virtual ~InvalidationNotifier(); 50 virtual ~InvalidationNotifier();
51 51
52 // Invalidator implementation. 52 // Invalidator implementation.
53 virtual void RegisterHandler(InvalidationHandler* handler) OVERRIDE; 53 virtual void RegisterHandler(InvalidationHandler* handler) OVERRIDE;
54 virtual void UpdateRegisteredIds(InvalidationHandler* handler, 54 virtual void UpdateRegisteredIds(InvalidationHandler* handler,
(...skipping 20 matching lines...) Expand all
75 enum State { 75 enum State {
76 STOPPED, 76 STOPPED,
77 CONNECTING, 77 CONNECTING,
78 STARTED 78 STARTED
79 }; 79 };
80 State state_; 80 State state_;
81 81
82 InvalidatorRegistrar registrar_; 82 InvalidatorRegistrar registrar_;
83 83
84 // Passed to |invalidation_listener_|. 84 // Passed to |invalidation_listener_|.
85 const InvalidationVersionMap initial_max_invalidation_versions_; 85 const InvalidationStateMap initial_invalidation_state_map_;
86 86
87 // Passed to |invalidation_listener_|. 87 // Passed to |invalidation_listener_|.
88 const WeakHandle<InvalidationStateTracker> 88 const WeakHandle<InvalidationStateTracker>
89 invalidation_state_tracker_; 89 invalidation_state_tracker_;
90 90
91 // Passed to |invalidation_listener_|. 91 // Passed to |invalidation_listener_|.
92 const std::string client_info_; 92 const std::string client_info_;
93 93
94 // The client ID to pass to |invalidation_listener_|. 94 // The client ID to pass to |invalidation_listener_|.
95 std::string client_id_; 95 std::string client_id_;
96 96
97 // The initial bootstrap data to pass to |invalidation_listener_|. 97 // The initial bootstrap data to pass to |invalidation_listener_|.
98 // TODO(tim): This should be made const once migration is completed for bug 98 // TODO(tim): This should be made const once migration is completed for bug
99 // 124140. 99 // 124140.
100 std::string invalidation_bootstrap_data_; 100 std::string invalidation_bootstrap_data_;
101 101
102 // The invalidation listener. 102 // The invalidation listener.
103 SyncInvalidationListener invalidation_listener_; 103 SyncInvalidationListener invalidation_listener_;
104 104
105 DISALLOW_COPY_AND_ASSIGN(InvalidationNotifier); 105 DISALLOW_COPY_AND_ASSIGN(InvalidationNotifier);
106 }; 106 };
107 107
108 } // namespace syncer 108 } // namespace syncer
109 109
110 #endif // SYNC_NOTIFIER_INVALIDATION_NOTIFIER_H_ 110 #endif // SYNC_NOTIFIER_INVALIDATION_NOTIFIER_H_
OLDNEW
« no previous file with comments | « sync/notifier/fake_invalidation_state_tracker.cc ('k') | sync/notifier/invalidation_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698