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

Unified Diff: components/gcm_driver/gcm_client_impl.cc

Issue 745123002: Link GCM heartbeat with wake on wifi preference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix missing include Created 6 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 | « components/gcm_driver/gcm_client_impl.h ('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 bd70ddf6a23bde1daeaeda2c5b482dc0de31280e..d320df553eab3ec1121c04fd5232bd0e43fdff9b 100644
--- a/components/gcm_driver/gcm_client_impl.cc
+++ b/components/gcm_driver/gcm_client_impl.cc
@@ -15,8 +15,8 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/time/default_clock.h"
+#include "base/timer/timer.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"
@@ -193,17 +193,8 @@ scoped_ptr<MCSClient> GCMInternalsBuilder::BuildMCSClient(
ConnectionFactory* connection_factory,
GCMStore* gcm_store,
GCMStatsRecorder* 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)
+ version, clock, connection_factory, gcm_store, recorder));
}
scoped_ptr<ConnectionFactory> GCMInternalsBuilder::BuildConnectionFactory(
@@ -478,6 +469,11 @@ void GCMClientImpl::SetLastTokenFetchTime(const base::Time& time) {
weak_ptr_factory_.GetWeakPtr()));
}
+void GCMClientImpl::UpdateHeartbeatTimer(scoped_ptr<base::Timer> timer) {
+ DCHECK(mcs_client_);
+ mcs_client_->UpdateHeartbeatTimer(timer.Pass());
+}
+
void GCMClientImpl::StartCheckin() {
// Make sure no checkin is in progress.
if (checkin_request_.get())
« no previous file with comments | « components/gcm_driver/gcm_client_impl.h ('k') | components/gcm_driver/gcm_client_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698