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

Side by Side Diff: components/invalidation/ticl_invalidation_service.h

Issue 319223002: Componentize TiclInvalidationService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ 5 #ifndef COMPONENTS_INVALIDATION_TICL_INVALIDATION_SERVICE_H_
6 #define CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ 6 #define COMPONENTS_INVALIDATION_TICL_INVALIDATION_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/threading/non_thread_safe.h" 14 #include "base/threading/non_thread_safe.h"
15 #include "base/timer/timer.h" 15 #include "base/timer/timer.h"
16 #include "base/values.h" 16 #include "base/values.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 enum InvalidationNetworkChannel { 53 enum InvalidationNetworkChannel {
54 PUSH_CLIENT_CHANNEL = 0, 54 PUSH_CLIENT_CHANNEL = 0,
55 GCM_NETWORK_CHANNEL = 1, 55 GCM_NETWORK_CHANNEL = 1,
56 56
57 // This enum is used in UMA_HISTOGRAM_ENUMERATION. Insert new values above 57 // This enum is used in UMA_HISTOGRAM_ENUMERATION. Insert new values above
58 // this line. 58 // this line.
59 NETWORK_CHANNELS_COUNT = 2 59 NETWORK_CHANNELS_COUNT = 2
60 }; 60 };
61 61
62 TiclInvalidationService( 62 TiclInvalidationService(
63 const std::string& user_agent,
63 scoped_ptr<IdentityProvider> identity_provider, 64 scoped_ptr<IdentityProvider> identity_provider,
64 scoped_ptr<TiclSettingsProvider> settings_provider, 65 scoped_ptr<TiclSettingsProvider> settings_provider,
65 gcm::GCMDriver* gcm_driver, 66 gcm::GCMDriver* gcm_driver,
66 const scoped_refptr<net::URLRequestContextGetter>& request_context); 67 const scoped_refptr<net::URLRequestContextGetter>& request_context);
67 virtual ~TiclInvalidationService(); 68 virtual ~TiclInvalidationService();
68 69
69 void Init( 70 void Init(
70 scoped_ptr<syncer::InvalidationStateTracker> invalidation_state_tracker); 71 scoped_ptr<syncer::InvalidationStateTracker> invalidation_state_tracker);
71 72
72 // InvalidationService implementation. 73 // InvalidationService implementation.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 friend class TiclProfileSettingsProviderTest; 125 friend class TiclProfileSettingsProviderTest;
125 126
126 bool IsReadyToStart(); 127 bool IsReadyToStart();
127 bool IsStarted() const; 128 bool IsStarted() const;
128 129
129 void StartInvalidator(InvalidationNetworkChannel network_channel); 130 void StartInvalidator(InvalidationNetworkChannel network_channel);
130 void UpdateInvalidationNetworkChannel(); 131 void UpdateInvalidationNetworkChannel();
131 void UpdateInvalidatorCredentials(); 132 void UpdateInvalidatorCredentials();
132 void StopInvalidator(); 133 void StopInvalidator();
133 134
135 const std::string user_agent_;
136
134 scoped_ptr<IdentityProvider> identity_provider_; 137 scoped_ptr<IdentityProvider> identity_provider_;
135 scoped_ptr<TiclSettingsProvider> settings_provider_; 138 scoped_ptr<TiclSettingsProvider> settings_provider_;
136 139
137 scoped_ptr<syncer::InvalidatorRegistrar> invalidator_registrar_; 140 scoped_ptr<syncer::InvalidatorRegistrar> invalidator_registrar_;
138 scoped_ptr<syncer::InvalidationStateTracker> invalidation_state_tracker_; 141 scoped_ptr<syncer::InvalidationStateTracker> invalidation_state_tracker_;
139 scoped_ptr<syncer::Invalidator> invalidator_; 142 scoped_ptr<syncer::Invalidator> invalidator_;
140 143
141 // TiclInvalidationService needs to remember access token in order to 144 // TiclInvalidationService needs to remember access token in order to
142 // invalidate it with OAuth2TokenService. 145 // invalidate it with OAuth2TokenService.
143 std::string access_token_; 146 std::string access_token_;
(...skipping 15 matching lines...) Expand all
159 162
160 // Keep a copy of the important parameters used in network channel creation 163 // Keep a copy of the important parameters used in network channel creation
161 // for debugging. 164 // for debugging.
162 base::DictionaryValue network_channel_options_; 165 base::DictionaryValue network_channel_options_;
163 166
164 DISALLOW_COPY_AND_ASSIGN(TiclInvalidationService); 167 DISALLOW_COPY_AND_ASSIGN(TiclInvalidationService);
165 }; 168 };
166 169
167 } // namespace invalidation 170 } // namespace invalidation
168 171
169 #endif // CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ 172 #endif // COMPONENTS_INVALIDATION_TICL_INVALIDATION_SERVICE_H_
OLDNEW
« no previous file with comments | « components/invalidation/invalidation_service_test_template.cc ('k') | components/invalidation/ticl_invalidation_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698