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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 const checkin_proto::ChromeBuildProto& chrome_build_proto, | 146 const checkin_proto::ChromeBuildProto& chrome_build_proto, |
147 const base::FilePath& store_path, | 147 const base::FilePath& store_path, |
148 const std::vector<std::string>& account_ids, | 148 const std::vector<std::string>& account_ids, |
149 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, | 149 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, |
150 const scoped_refptr<net::URLRequestContextGetter>& | 150 const scoped_refptr<net::URLRequestContextGetter>& |
151 url_request_context_getter, | 151 url_request_context_getter, |
152 Delegate* delegate) = 0; | 152 Delegate* delegate) = 0; |
153 | 153 |
154 // Loads the data from the persistent store. This will automatically kick off | 154 // Loads the data from the persistent store. This will automatically kick off |
155 // the check-in if the check-in info is not found in the store. | 155 // the check-in if the check-in info is not found in the store. |
| 156 // TODO(jianli): consider renaming this name to Start. |
156 virtual void Load() = 0; | 157 virtual void Load() = 0; |
157 | 158 |
| 159 // Stops using the GCM service. This will not erase the persisted data. |
| 160 virtual void Stop() = 0; |
| 161 |
158 // Checks out of the GCM service. This will erase all the cached and persisted | 162 // Checks out of the GCM service. This will erase all the cached and persisted |
159 // data. | 163 // data. |
160 virtual void CheckOut() = 0; | 164 virtual void CheckOut() = 0; |
161 | 165 |
162 // Registers the application for GCM. Delegate::OnRegisterFinished will be | 166 // Registers the application for GCM. Delegate::OnRegisterFinished will be |
163 // called asynchronously upon completion. | 167 // called asynchronously upon completion. |
164 // |app_id|: application ID. | 168 // |app_id|: application ID. |
165 // |cert|: SHA-1 of public key of the application, in base16 format. | 169 // |cert|: SHA-1 of public key of the application, in base16 format. |
166 // |sender_ids|: list of IDs of the servers that are allowed to send the | 170 // |sender_ids|: list of IDs of the servers that are allowed to send the |
167 // messages to the application. These IDs are assigned by the | 171 // messages to the application. These IDs are assigned by the |
(...skipping 14 matching lines...) Expand all Loading... |
182 // |receiver_id|: registration ID of the receiver party. | 186 // |receiver_id|: registration ID of the receiver party. |
183 // |message|: message to be sent. | 187 // |message|: message to be sent. |
184 virtual void Send(const std::string& app_id, | 188 virtual void Send(const std::string& app_id, |
185 const std::string& receiver_id, | 189 const std::string& receiver_id, |
186 const OutgoingMessage& message) = 0; | 190 const OutgoingMessage& message) = 0; |
187 }; | 191 }; |
188 | 192 |
189 } // namespace gcm | 193 } // namespace gcm |
190 | 194 |
191 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_H_ | 195 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_H_ |
OLD | NEW |