| OLD | NEW |
| 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 Loading... |
| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 // |url_request_context_getter|: for url requests. | 178 // |url_request_context_getter|: for url requests. |
| 177 // |delegate|: the delegate whose methods will be called asynchronously in | 179 // |delegate|: the delegate whose methods will be called asynchronously in |
| 178 // response to events and messages. | 180 // response to events and messages. |
| 179 virtual void Initialize( | 181 virtual void Initialize( |
| 180 const checkin_proto::ChromeBuildProto& chrome_build_proto, | 182 const checkin_proto::ChromeBuildProto& chrome_build_proto, |
| 181 const base::FilePath& store_path, | 183 const base::FilePath& store_path, |
| 182 const std::vector<std::string>& account_ids, | 184 const std::vector<std::string>& account_ids, |
| 183 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, | 185 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, |
| 184 const scoped_refptr<net::URLRequestContextGetter>& | 186 const scoped_refptr<net::URLRequestContextGetter>& |
| 185 url_request_context_getter, | 187 url_request_context_getter, |
| 188 scoped_ptr<Encryptor> encryptor, |
| 186 Delegate* delegate) = 0; | 189 Delegate* delegate) = 0; |
| 187 | 190 |
| 188 // Starts the GCM service by first loading the data from the persistent store. | 191 // Starts the GCM service by first loading the data from the persistent store. |
| 189 // This will then kick off the check-in if the check-in info is not found in | 192 // This will then kick off the check-in if the check-in info is not found in |
| 190 // the store. | 193 // the store. |
| 191 virtual void Start() = 0; | 194 virtual void Start() = 0; |
| 192 | 195 |
| 193 // Stops using the GCM service. This will not erase the persisted data. | 196 // Stops using the GCM service. This will not erase the persisted data. |
| 194 virtual void Stop() = 0; | 197 virtual void Stop() = 0; |
| 195 | 198 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 // Clear all recorded GCM activity logs. | 230 // Clear all recorded GCM activity logs. |
| 228 virtual void ClearActivityLogs() = 0; | 231 virtual void ClearActivityLogs() = 0; |
| 229 | 232 |
| 230 // Gets internal states and statistics. | 233 // Gets internal states and statistics. |
| 231 virtual GCMStatistics GetStatistics() const = 0; | 234 virtual GCMStatistics GetStatistics() const = 0; |
| 232 }; | 235 }; |
| 233 | 236 |
| 234 } // namespace gcm | 237 } // namespace gcm |
| 235 | 238 |
| 236 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_H_ | 239 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_H_ |
| OLD | NEW |