Chromium Code Reviews| 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 must be invoked on the IO thread. | |
| 180 virtual void OnMessageReceived( | |
| 181 const std::string& app_id, | |
| 182 const IncomingMessage& message, | |
| 183 const MessageReceiptCallback& optional_receipt_callback) = 0; | |
|
Peter Beverloo
2017/02/13 13:47:06
nit: standardize on (optional_)?receipt_callback n
harkness
2017/02/14 19:22:28
I decided that I really like "optional" for standa
| |
| 178 | 184 |
| 179 // Called when some messages have been deleted from the server. | 185 // Called when some messages have been deleted from the server. |
| 180 // |app_id|: application ID. | 186 // |app_id|: application ID. |
| 181 virtual void OnMessagesDeleted(const std::string& app_id) = 0; | 187 virtual void OnMessagesDeleted(const std::string& app_id) = 0; |
| 182 | 188 |
| 183 // Called when a message failed to send to the server. | 189 // Called when a message failed to send to the server. |
| 184 // |app_id|: application ID. | 190 // |app_id|: application ID. |
| 185 // |send_error_detials|: Details of the send error event, like mesasge ID. | 191 // |send_error_detials|: Details of the send error event, like mesasge ID. |
| 186 virtual void OnMessageSendError( | 192 virtual void OnMessageSendError( |
| 187 const std::string& app_id, | 193 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 | 334 // to be set, and allows that component to later revoke the setting. It should |
| 329 // be unique. | 335 // be unique. |
| 330 virtual void AddHeartbeatInterval(const std::string& scope, | 336 virtual void AddHeartbeatInterval(const std::string& scope, |
| 331 int interval_ms) = 0; | 337 int interval_ms) = 0; |
| 332 virtual void RemoveHeartbeatInterval(const std::string& scope) = 0; | 338 virtual void RemoveHeartbeatInterval(const std::string& scope) = 0; |
| 333 }; | 339 }; |
| 334 | 340 |
| 335 } // namespace gcm | 341 } // namespace gcm |
| 336 | 342 |
| 337 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ | 343 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ |
| OLD | NEW |