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 // Utility methods for MCS interactions. | 5 // Utility methods for MCS interactions. |
6 | 6 |
7 #ifndef GOOGLE_APIS_GCM_BASE_MCS_UTIL_H_ | 7 #ifndef GOOGLE_APIS_GCM_BASE_MCS_UTIL_H_ |
8 #define GOOGLE_APIS_GCM_BASE_MCS_UTIL_H_ | 8 #define GOOGLE_APIS_GCM_BASE_MCS_UTIL_H_ |
9 | 9 |
10 #include <stdint.h> | 10 #include <stdint.h> |
11 | 11 |
12 #include <memory> | 12 #include <memory> |
13 #include <string> | 13 #include <string> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "google_apis/gcm/base/gcm_export.h" | 17 #include "google_apis/gcm/base/gcm_export.h" |
18 #include "google_apis/gcm/protocol/mcs.pb.h" | 18 #include "google_apis/gcm/protocol/mcs.pb.h" |
19 | 19 |
20 namespace base { | 20 namespace base { |
21 class Clock; | 21 class Clock; |
22 } | 22 } |
23 | 23 |
24 namespace net { | |
25 class StreamSocket; | |
26 } | |
27 | |
28 namespace gcm { | 24 namespace gcm { |
29 | 25 |
30 // MCS Message tags. | 26 // MCS Message tags. |
31 // WARNING: the order of these tags must remain the same, as the tag values | 27 // WARNING: the order of these tags must remain the same, as the tag values |
32 // must be consistent with those used on the server. | 28 // must be consistent with those used on the server. |
33 enum MCSProtoTag { | 29 enum MCSProtoTag { |
34 kHeartbeatPingTag = 0, | 30 kHeartbeatPingTag = 0, |
35 kHeartbeatAckTag, | 31 kHeartbeatAckTag, |
36 kLoginRequestTag, | 32 kLoginRequestTag, |
37 kLoginResponseTag, | 33 kLoginResponseTag, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 base::Clock* clock); | 86 base::Clock* clock); |
91 GCM_EXPORT int GetTTL(const google::protobuf::MessageLite& protobuf); | 87 GCM_EXPORT int GetTTL(const google::protobuf::MessageLite& protobuf); |
92 | 88 |
93 // Returns whether the message was sent with an immediate ack request. | 89 // Returns whether the message was sent with an immediate ack request. |
94 GCM_EXPORT bool IsImmediateAckRequested( | 90 GCM_EXPORT bool IsImmediateAckRequested( |
95 const google::protobuf::MessageLite& protobuf); | 91 const google::protobuf::MessageLite& protobuf); |
96 | 92 |
97 } // namespace gcm | 93 } // namespace gcm |
98 | 94 |
99 #endif // GOOGLE_APIS_GCM_BASE_MCS_UTIL_H_ | 95 #endif // GOOGLE_APIS_GCM_BASE_MCS_UTIL_H_ |
OLD | NEW |