OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_COMMON_GCM_MESSAGES_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_COMMON_GCM_MESSAGES_H_ |
6 #define COMPONENTS_GCM_DRIVER_COMMON_GCM_MESSAGES_H_ | 6 #define COMPONENTS_GCM_DRIVER_COMMON_GCM_MESSAGES_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "components/gcm_driver/common/gcm_driver_export.h" | 11 #include "components/gcm_driver/common/gcm_driver_export.h" |
12 | 12 |
13 namespace gcm { | 13 namespace gcm { |
14 | 14 |
15 // Message data consisting of key-value pairs. | 15 // Message data consisting of key-value pairs. |
16 typedef std::map<std::string, std::string> MessageData; | 16 typedef std::map<std::string, std::string> MessageData; |
17 | 17 |
18 // Message to be delivered to the other party. | 18 // Message to be delivered to the other party. |
19 struct GCM_DRIVER_EXPORT OutgoingMessage { | 19 struct GCM_DRIVER_EXPORT OutgoingMessage { |
20 OutgoingMessage(); | 20 OutgoingMessage(); |
| 21 OutgoingMessage(const OutgoingMessage& other); |
21 ~OutgoingMessage(); | 22 ~OutgoingMessage(); |
22 | 23 |
23 // Message ID. | 24 // Message ID. |
24 std::string id; | 25 std::string id; |
25 // In seconds. | 26 // In seconds. |
26 int time_to_live; | 27 int time_to_live; |
27 MessageData data; | 28 MessageData data; |
28 | 29 |
29 static const int kMaximumTTL; | 30 static const int kMaximumTTL; |
30 }; | 31 }; |
31 | 32 |
32 // Message being received from the other party. | 33 // Message being received from the other party. |
33 struct GCM_DRIVER_EXPORT IncomingMessage { | 34 struct GCM_DRIVER_EXPORT IncomingMessage { |
34 IncomingMessage(); | 35 IncomingMessage(); |
| 36 IncomingMessage(const IncomingMessage& other); |
35 ~IncomingMessage(); | 37 ~IncomingMessage(); |
36 | 38 |
37 MessageData data; | 39 MessageData data; |
38 std::string collapse_key; | 40 std::string collapse_key; |
39 std::string sender_id; | 41 std::string sender_id; |
40 std::string raw_data; | 42 std::string raw_data; |
41 | 43 |
42 // Whether the contents of the message have been decrypted, and are | 44 // Whether the contents of the message have been decrypted, and are |
43 // available in |raw_data|. | 45 // available in |raw_data|. |
44 bool decrypted; | 46 bool decrypted; |
45 }; | 47 }; |
46 | 48 |
47 } // namespace gcm | 49 } // namespace gcm |
48 | 50 |
49 #endif // COMPONENTS_GCM_DRIVER_COMMON_GCM_MESSAGES_H_ | 51 #endif // COMPONENTS_GCM_DRIVER_COMMON_GCM_MESSAGES_H_ |
OLD | NEW |