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

Unified Diff: google_apis/gcm/engine/mcs_client.h

Issue 118133003: [GCM] Add heartbeat manager and reconnection logic due to heartbeat failure (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
Index: google_apis/gcm/engine/mcs_client.h
diff --git a/google_apis/gcm/engine/mcs_client.h b/google_apis/gcm/engine/mcs_client.h
index 4de62cb127e218121e8676f2a8d7425945b2b4a0..3137c9f50e91e71e099b2a570162fd4500363d78 100644
--- a/google_apis/gcm/engine/mcs_client.h
+++ b/google_apis/gcm/engine/mcs_client.h
@@ -13,10 +13,10 @@
#include "base/files/file_path.h"
#include "base/memory/linked_ptr.h"
#include "base/memory/weak_ptr.h"
-#include "base/timer/timer.h"
#include "google_apis/gcm/base/gcm_export.h"
#include "google_apis/gcm/base/mcs_message.h"
#include "google_apis/gcm/engine/connection_handler.h"
+#include "google_apis/gcm/engine/heartbeat_manager.h"
#include "google_apis/gcm/engine/rmq_store.h"
namespace google {
@@ -155,6 +155,9 @@ class GCM_EXPORT MCSClient {
// Virtual for testing.
virtual PersistentId GetNextPersistentId();
+ // Helper for the heartbeat manager to signal a connection reset.
+ void OnConnectionResetByHeartbeat();
+
// Client state.
State state_;
@@ -212,11 +215,8 @@ class GCM_EXPORT MCSClient {
// The reliable message queue persistent store.
RMQStore rmq_store_;
- // ----- Heartbeats -----
- // The current heartbeat interval.
- base::TimeDelta heartbeat_interval_;
- // Timer for triggering heartbeats.
- base::Timer heartbeat_timer_;
+ // Manager to handle triggering/detecting heartbeats.
+ HeartbeatManager heartbeat_manager_;
// The task runner for blocking tasks (i.e. persisting RMQ state to disk).
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;

Powered by Google App Engine
This is Rietveld 408576698