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

Side by Side Diff: google_apis/gcm/gcm_client.h

Issue 261853012: Componentize GCM Part 1: create GCM component and move some files over (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix trybot Created 6 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 GOOGLE_APIS_GCM_GCM_CLIENT_H_ 5 #ifndef GOOGLE_APIS_GCM_GCM_CLIENT_H_
6 #define GOOGLE_APIS_GCM_GCM_CLIENT_H_ 6 #define GOOGLE_APIS_GCM_GCM_CLIENT_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 12 matching lines...) Expand all
23 namespace checkin_proto { 23 namespace checkin_proto {
24 class ChromeBuildProto; 24 class ChromeBuildProto;
25 } 25 }
26 26
27 namespace net { 27 namespace net {
28 class URLRequestContextGetter; 28 class URLRequestContextGetter;
29 } 29 }
30 30
31 namespace gcm { 31 namespace gcm {
32 32
33 class Encryptor;
34
33 // Interface that encapsulates the network communications with the Google Cloud 35 // Interface that encapsulates the network communications with the Google Cloud
34 // Messaging server. This interface is not supposed to be thread-safe. 36 // Messaging server. This interface is not supposed to be thread-safe.
35 class GCM_EXPORT GCMClient { 37 class GCM_EXPORT GCMClient {
36 public: 38 public:
37 enum Result { 39 enum Result {
38 // Successful operation. 40 // Successful operation.
39 SUCCESS, 41 SUCCESS,
40 // Invalid parameter. 42 // Invalid parameter.
41 INVALID_PARAMETER, 43 INVALID_PARAMETER,
42 // Profile not signed in. 44 // Profile not signed in.
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // |url_request_context_getter|: for url requests. 172 // |url_request_context_getter|: for url requests.
171 // |delegate|: the delegate whose methods will be called asynchronously in 173 // |delegate|: the delegate whose methods will be called asynchronously in
172 // response to events and messages. 174 // response to events and messages.
173 virtual void Initialize( 175 virtual void Initialize(
174 const checkin_proto::ChromeBuildProto& chrome_build_proto, 176 const checkin_proto::ChromeBuildProto& chrome_build_proto,
175 const base::FilePath& store_path, 177 const base::FilePath& store_path,
176 const std::vector<std::string>& account_ids, 178 const std::vector<std::string>& account_ids,
177 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, 179 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner,
178 const scoped_refptr<net::URLRequestContextGetter>& 180 const scoped_refptr<net::URLRequestContextGetter>&
179 url_request_context_getter, 181 url_request_context_getter,
182 scoped_ptr<Encryptor> encryptor,
180 Delegate* delegate) = 0; 183 Delegate* delegate) = 0;
181 184
182 // Loads the data from the persistent store. This will automatically kick off 185 // Loads the data from the persistent store. This will automatically kick off
183 // the check-in if the check-in info is not found in the store. 186 // the check-in if the check-in info is not found in the store.
184 // TODO(jianli): consider renaming this name to Start. 187 // TODO(jianli): consider renaming this name to Start.
185 virtual void Load() = 0; 188 virtual void Load() = 0;
186 189
187 // Stops using the GCM service. This will not erase the persisted data. 190 // Stops using the GCM service. This will not erase the persisted data.
188 virtual void Stop() = 0; 191 virtual void Stop() = 0;
189 192
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 // Clear all recorded GCM activity logs. 224 // Clear all recorded GCM activity logs.
222 virtual void ClearActivityLogs() = 0; 225 virtual void ClearActivityLogs() = 0;
223 226
224 // Gets internal states and statistics. 227 // Gets internal states and statistics.
225 virtual GCMStatistics GetStatistics() const = 0; 228 virtual GCMStatistics GetStatistics() const = 0;
226 }; 229 };
227 230
228 } // namespace gcm 231 } // namespace gcm
229 232
230 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_H_ 233 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698