| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 MessageData data; | 70 MessageData data; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 // Message being received from the other party. | 73 // Message being received from the other party. |
| 74 struct GCM_EXPORT IncomingMessage { | 74 struct GCM_EXPORT IncomingMessage { |
| 75 IncomingMessage(); | 75 IncomingMessage(); |
| 76 ~IncomingMessage(); | 76 ~IncomingMessage(); |
| 77 | 77 |
| 78 MessageData data; | 78 MessageData data; |
| 79 std::string collapse_key; | 79 std::string collapse_key; |
| 80 std::string sender_id; |
| 80 }; | 81 }; |
| 81 | 82 |
| 82 // A delegate interface that allows the GCMClient instance to interact with | 83 // A delegate interface that allows the GCMClient instance to interact with |
| 83 // its caller, i.e. notifying asynchronous event. | 84 // its caller, i.e. notifying asynchronous event. |
| 84 class Delegate { | 85 class Delegate { |
| 85 public: | 86 public: |
| 86 // Called when the registration completed successfully or an error occurs. | 87 // Called when the registration completed successfully or an error occurs. |
| 87 // |app_id|: application ID. | 88 // |app_id|: application ID. |
| 88 // |registration_id|: non-empty if the registration completed successfully. | 89 // |registration_id|: non-empty if the registration completed successfully. |
| 89 // |result|: the type of the error if an error occured, success otherwise. | 90 // |result|: the type of the error if an error occured, success otherwise. |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 // |receiver_id|: registration ID of the receiver party. | 183 // |receiver_id|: registration ID of the receiver party. |
| 183 // |message|: message to be sent. | 184 // |message|: message to be sent. |
| 184 virtual void Send(const std::string& app_id, | 185 virtual void Send(const std::string& app_id, |
| 185 const std::string& receiver_id, | 186 const std::string& receiver_id, |
| 186 const OutgoingMessage& message) = 0; | 187 const OutgoingMessage& message) = 0; |
| 187 }; | 188 }; |
| 188 | 189 |
| 189 } // namespace gcm | 190 } // namespace gcm |
| 190 | 191 |
| 191 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_H_ | 192 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_H_ |
| OLD | NEW |