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

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

Issue 641943002: components: Introduce AlarmTimer class and use it for GCM heartbeat (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build error in mcs_probe Created 6 years, 2 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 | « components/timers/rtc_alarm.cc ('k') | google_apis/gcm/engine/heartbeat_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/engine/heartbeat_manager.h
diff --git a/google_apis/gcm/engine/heartbeat_manager.h b/google_apis/gcm/engine/heartbeat_manager.h
index 9266b98c8d4b21f02935002cd106dd314c27e40a..086e4112f217361db1212f540d2522b6155aa9c4 100644
--- a/google_apis/gcm/engine/heartbeat_manager.h
+++ b/google_apis/gcm/engine/heartbeat_manager.h
@@ -7,10 +7,14 @@
#include "base/callback.h"
#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
-#include "base/timer/timer.h"
#include "google_apis/gcm/base/gcm_export.h"
+namespace base {
+class Timer;
+}
+
namespace mcs_proto {
class HeartbeatConfig;
}
@@ -21,7 +25,7 @@ namespace gcm {
// receipt/failures and triggering reconnection as necessary.
class GCM_EXPORT HeartbeatManager {
public:
- HeartbeatManager();
+ explicit HeartbeatManager(scoped_ptr<base::Timer> heartbeat_timer);
~HeartbeatManager();
// Start the heartbeat logic.
@@ -66,7 +70,7 @@ class GCM_EXPORT HeartbeatManager {
int server_interval_ms_;
// Timer for triggering heartbeats.
- base::Timer heartbeat_timer_;
+ scoped_ptr<base::Timer> heartbeat_timer_;
// Callbacks for interacting with the the connection.
base::Closure send_heartbeat_callback_;
« no previous file with comments | « components/timers/rtc_alarm.cc ('k') | google_apis/gcm/engine/heartbeat_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698