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

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: Address comments 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
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..970ddcbfcf7850813665c51c436873e6a8587a55 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> 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_;

Powered by Google App Engine
This is Rietveld 408576698