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

Unified Diff: google_apis/gcm/base/mcs_util.h

Issue 117513004: [GCM] Add TTL support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | google_apis/gcm/base/mcs_util.cc » ('j') | google_apis/gcm/base/mcs_util.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/base/mcs_util.h
diff --git a/google_apis/gcm/base/mcs_util.h b/google_apis/gcm/base/mcs_util.h
index 7f92564ad27fc4d47f1af91a4382a7dfa0816920..a983e1562f437787f6c13c6f45eb0636d51c49f3 100644
--- a/google_apis/gcm/base/mcs_util.h
+++ b/google_apis/gcm/base/mcs_util.h
@@ -15,6 +15,10 @@
#include "google_apis/gcm/base/gcm_export.h"
#include "google_apis/gcm/protocol/mcs.pb.h"
+namespace base {
+class Clock;
+}
+
namespace net {
class StreamSocket;
}
@@ -76,6 +80,13 @@ GCM_EXPORT void SetLastStreamIdReceived(
uint32 last_stream_id_received,
google::protobuf::MessageLite* protobuf);
+// Returns whether the TTL (time to live) for this message has expired, based
+// on the |sent| timestamps and base::TimeTicks::Now(). If |protobuf| is not
+// for a DataMessageStanza or the TTL is 0, will return false.
+GCM_EXPORT bool HasTTLExpired(const google::protobuf::MessageLite& protobuf,
+ base::Clock* clock);
+GCM_EXPORT int GetTTL(const google::protobuf::MessageLite& protobuf);
+
} // namespace gcm
#endif // GOOGLE_APIS_GCM_BASE_MCS_UTIL_H_
« no previous file with comments | « no previous file | google_apis/gcm/base/mcs_util.cc » ('j') | google_apis/gcm/base/mcs_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698