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

Unified Diff: components/gcm_driver/gcm_client_impl.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 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/gcm_driver/DEPS ('k') | components/gcm_driver/gcm_client_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/gcm_client_impl.cc
diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc
index fa968a0e9a08a6a24202f7d4bc21a828762ecc8d..db4504ba2143defd2d6a9e8a4af0d6127c551d03 100644
--- a/components/gcm_driver/gcm_client_impl.cc
+++ b/components/gcm_driver/gcm_client_impl.cc
@@ -16,6 +16,7 @@
#include "base/strings/stringprintf.h"
#include "base/time/default_clock.h"
#include "components/gcm_driver/gcm_backoff_policy.h"
+#include "components/timers/alarm_timer.h"
#include "google_apis/gcm/base/encryptor.h"
#include "google_apis/gcm/base/mcs_message.h"
#include "google_apis/gcm/base/mcs_util.h"
@@ -192,12 +193,17 @@ scoped_ptr<MCSClient> GCMInternalsBuilder::BuildMCSClient(
ConnectionFactory* connection_factory,
GCMStore* gcm_store,
GCMStatsRecorder* recorder) {
- return make_scoped_ptr<MCSClient>(
- new MCSClient(version,
- clock,
- connection_factory,
- gcm_store,
- recorder));
+#if defined(OS_CHROMEOS)
+ return scoped_ptr<MCSClient>(new MCSClient(
+ version, clock, connection_factory, gcm_store, recorder,
+ make_scoped_ptr(new timers::AlarmTimer(true, /* retain user task */
+ false /* non-repeating */))));
+#else
+ return scoped_ptr<MCSClient>(new MCSClient(
+ version, clock, connection_factory, gcm_store, recorder,
+ make_scoped_ptr(new base::Timer(true, /* retain user task */
+ false /* non-repeating */))));
+#endif // defined(OS_CHROMEOS)
}
scoped_ptr<ConnectionFactory> GCMInternalsBuilder::BuildConnectionFactory(
« no previous file with comments | « components/gcm_driver/DEPS ('k') | components/gcm_driver/gcm_client_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698