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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // Message to be delivered to the other party. | 60 // Message to be delivered to the other party. |
61 struct GCM_EXPORT OutgoingMessage { | 61 struct GCM_EXPORT OutgoingMessage { |
62 OutgoingMessage(); | 62 OutgoingMessage(); |
63 ~OutgoingMessage(); | 63 ~OutgoingMessage(); |
64 | 64 |
65 // Message ID. | 65 // Message ID. |
66 std::string id; | 66 std::string id; |
67 // In seconds. | 67 // In seconds. |
68 int time_to_live; | 68 int time_to_live; |
69 MessageData data; | 69 MessageData data; |
| 70 |
| 71 static const int kMaximumTTL = 4 * 7 * 24 * 60 * 60; // 4 weeks. |
70 }; | 72 }; |
71 | 73 |
72 // Message being received from the other party. | 74 // Message being received from the other party. |
73 struct GCM_EXPORT IncomingMessage { | 75 struct GCM_EXPORT IncomingMessage { |
74 IncomingMessage(); | 76 IncomingMessage(); |
75 ~IncomingMessage(); | 77 ~IncomingMessage(); |
76 | 78 |
77 MessageData data; | 79 MessageData data; |
78 std::string collapse_key; | 80 std::string collapse_key; |
79 std::string sender_id; | 81 std::string sender_id; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // Clear all recorded GCM activity logs. | 223 // Clear all recorded GCM activity logs. |
222 virtual void ClearActivityLogs() = 0; | 224 virtual void ClearActivityLogs() = 0; |
223 | 225 |
224 // Gets internal states and statistics. | 226 // Gets internal states and statistics. |
225 virtual GCMStatistics GetStatistics() const = 0; | 227 virtual GCMStatistics GetStatistics() const = 0; |
226 }; | 228 }; |
227 | 229 |
228 } // namespace gcm | 230 } // namespace gcm |
229 | 231 |
230 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_H_ | 232 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_H_ |
OLD | NEW |