Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(658)

Side by Side Diff: google_apis/gcm/base/mcs_util.h

Issue 171683002: [GCM] Fix gcm login to properly identify chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <string> 10 #include <string>
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 enum MCSIqStanzaExtension { 52 enum MCSIqStanzaExtension {
53 kSelectiveAck = 12, 53 kSelectiveAck = 12,
54 kStreamAck = 13, 54 kStreamAck = 13,
55 }; 55 };
56 56
57 // Builds a LoginRequest with the hardcoded local data. 57 // Builds a LoginRequest with the hardcoded local data.
58 GCM_EXPORT scoped_ptr<mcs_proto::LoginRequest> BuildLoginRequest( 58 GCM_EXPORT scoped_ptr<mcs_proto::LoginRequest> BuildLoginRequest(
59 uint64 auth_id, 59 uint64 auth_id,
60 uint64 auth_token, 60 uint64 auth_token,
61 const std::string& version_string,
61 const std::vector<int64>& user_serial_numbers); 62 const std::vector<int64>& user_serial_numbers);
62 63
63 // Builds a StreamAck IqStanza message. 64 // Builds a StreamAck IqStanza message.
64 GCM_EXPORT scoped_ptr<mcs_proto::IqStanza> BuildStreamAck(); 65 GCM_EXPORT scoped_ptr<mcs_proto::IqStanza> BuildStreamAck();
65 GCM_EXPORT scoped_ptr<mcs_proto::IqStanza> BuildSelectiveAck( 66 GCM_EXPORT scoped_ptr<mcs_proto::IqStanza> BuildSelectiveAck(
66 const std::vector<std::string>& acked_ids); 67 const std::vector<std::string>& acked_ids);
67 68
68 // Utility methods for building and identifying MCS protobufs. 69 // Utility methods for building and identifying MCS protobufs.
69 GCM_EXPORT scoped_ptr<google::protobuf::MessageLite> 70 GCM_EXPORT scoped_ptr<google::protobuf::MessageLite>
70 BuildProtobufFromTag(uint8 tag); 71 BuildProtobufFromTag(uint8 tag);
(...skipping 14 matching lines...) Expand all
85 // Returns whether the TTL (time to live) for this message has expired, based 86 // Returns whether the TTL (time to live) for this message has expired, based
86 // on the |sent| timestamps and base::TimeTicks::Now(). If |protobuf| is not 87 // on the |sent| timestamps and base::TimeTicks::Now(). If |protobuf| is not
87 // for a DataMessageStanza or the TTL is 0, will return false. 88 // for a DataMessageStanza or the TTL is 0, will return false.
88 GCM_EXPORT bool HasTTLExpired(const google::protobuf::MessageLite& protobuf, 89 GCM_EXPORT bool HasTTLExpired(const google::protobuf::MessageLite& protobuf,
89 base::Clock* clock); 90 base::Clock* clock);
90 GCM_EXPORT int GetTTL(const google::protobuf::MessageLite& protobuf); 91 GCM_EXPORT int GetTTL(const google::protobuf::MessageLite& protobuf);
91 92
92 } // namespace gcm 93 } // namespace gcm
93 94
94 #endif // GOOGLE_APIS_GCM_BASE_MCS_UTIL_H_ 95 #endif // GOOGLE_APIS_GCM_BASE_MCS_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698