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

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: Unrevert fixes 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
« no previous file with comments | « google_apis/gcm/engine/heartbeat_manager_unittest.cc ('k') | google_apis/gcm/engine/mcs_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8087e4ec5b4dac533c727fe6e3750cf025b00e25..741c51e618d122c4de65c5d9b582ef7f8224b682 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 {
@@ -152,6 +152,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_;
@@ -209,11 +212,8 @@ class GCM_EXPORT MCSClient {
// The reliable message queue persistent store. Owned by the caller.
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_;
base::WeakPtrFactory<MCSClient> weak_ptr_factory_;
« no previous file with comments | « google_apis/gcm/engine/heartbeat_manager_unittest.cc ('k') | google_apis/gcm/engine/mcs_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698