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

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

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 gyp files 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/mcs_client.cc
diff --git a/google_apis/gcm/engine/mcs_client.cc b/google_apis/gcm/engine/mcs_client.cc
index ec156b786f8e6bbeecf574e9dc25d6e734cd1a12..34ebfcb0e6cb33441e2cf2371adac8106ff61e9b 100644
--- a/google_apis/gcm/engine/mcs_client.cc
+++ b/google_apis/gcm/engine/mcs_client.cc
@@ -7,11 +7,13 @@
#include <set>
#include "base/basictypes.h"
+#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/clock.h"
#include "base/time/time.h"
+#include "base/timer/timer.h"
#include "google_apis/gcm/base/mcs_util.h"
#include "google_apis/gcm/base/socket_stream.h"
#include "google_apis/gcm/engine/connection_factory.h"
@@ -177,6 +179,10 @@ MCSClient::MCSClient(const std::string& version_string,
MCSClient::~MCSClient() {
}
+void MCSClient::SetHeartbeatTimer(scoped_ptr<base::Timer> timer) {
+ heartbeat_manager_.SetHeartbeatTimer(timer.Pass());
+}
+
void MCSClient::Initialize(
const ErrorCallback& error_callback,
const OnMessageReceivedCallback& message_received_callback,

Powered by Google App Engine
This is Rietveld 408576698