OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ |
6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ | 6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/memory/linked_ptr.h" | 15 #include "base/memory/linked_ptr.h" |
16 #include "components/gcm_driver/common/gcm_messages.h" | 16 #include "components/gcm_driver/common/gcm_messages.h" |
17 #include "components/gcm_driver/crypto/gcm_encryption_provider.h" | 17 #include "components/gcm_driver/crypto/gcm_encryption_provider.h" |
18 #include "components/gcm_driver/gcm_activity.h" | 18 #include "components/gcm_driver/gcm_activity.h" |
19 #include "components/gcm_driver/gcm_message_status.h" | |
19 #include "components/gcm_driver/registration_info.h" | 20 #include "components/gcm_driver/registration_info.h" |
20 | 21 |
21 template <class T> class scoped_refptr; | 22 template <class T> class scoped_refptr; |
22 | 23 |
23 namespace base { | 24 namespace base { |
24 class FilePath; | 25 class FilePath; |
25 class SequencedTaskRunner; | 26 class SequencedTaskRunner; |
26 class Timer; | 27 class Timer; |
27 } | 28 } |
28 | 29 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 // |app_id|: application ID. | 167 // |app_id|: application ID. |
167 // |message_id|: ID of the message being sent. | 168 // |message_id|: ID of the message being sent. |
168 // |result|: the type of the error if an error occured, success otherwise. | 169 // |result|: the type of the error if an error occured, success otherwise. |
169 virtual void OnSendFinished(const std::string& app_id, | 170 virtual void OnSendFinished(const std::string& app_id, |
170 const std::string& message_id, | 171 const std::string& message_id, |
171 Result result) = 0; | 172 Result result) = 0; |
172 | 173 |
173 // Called when a message has been received. | 174 // Called when a message has been received. |
174 // |app_id|: application ID. | 175 // |app_id|: application ID. |
175 // |message|: message received. | 176 // |message|: message received. |
176 virtual void OnMessageReceived(const std::string& app_id, | 177 // |optional_receipt_callback|: Optional callback to invoke if desired when |
177 const IncomingMessage& message) = 0; | 178 // processing the message is complete if the receiver wants to return a |
179 // delivery receipt. The callback can be invoked from any thread, but will | |
180 // run on the UI thread. | |
Peter Beverloo
2017/02/08 17:09:09
[The callback can...the UI thread]
That seems wro
harkness
2017/02/09 16:27:29
Yup, I updated the code without updating the comme
| |
181 virtual void OnMessageReceived( | |
182 const std::string& app_id, | |
183 const IncomingMessage& message, | |
184 const MessageReceiptCallback& optional_receipt_callback) = 0; | |
178 | 185 |
179 // Called when some messages have been deleted from the server. | 186 // Called when some messages have been deleted from the server. |
180 // |app_id|: application ID. | 187 // |app_id|: application ID. |
181 virtual void OnMessagesDeleted(const std::string& app_id) = 0; | 188 virtual void OnMessagesDeleted(const std::string& app_id) = 0; |
182 | 189 |
183 // Called when a message failed to send to the server. | 190 // Called when a message failed to send to the server. |
184 // |app_id|: application ID. | 191 // |app_id|: application ID. |
185 // |send_error_detials|: Details of the send error event, like mesasge ID. | 192 // |send_error_detials|: Details of the send error event, like mesasge ID. |
186 virtual void OnMessageSendError( | 193 virtual void OnMessageSendError( |
187 const std::string& app_id, | 194 const std::string& app_id, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
328 // to be set, and allows that component to later revoke the setting. It should | 335 // to be set, and allows that component to later revoke the setting. It should |
329 // be unique. | 336 // be unique. |
330 virtual void AddHeartbeatInterval(const std::string& scope, | 337 virtual void AddHeartbeatInterval(const std::string& scope, |
331 int interval_ms) = 0; | 338 int interval_ms) = 0; |
332 virtual void RemoveHeartbeatInterval(const std::string& scope) = 0; | 339 virtual void RemoveHeartbeatInterval(const std::string& scope) = 0; |
333 }; | 340 }; |
334 | 341 |
335 } // namespace gcm | 342 } // namespace gcm |
336 | 343 |
337 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ | 344 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ |
OLD | NEW |