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

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

Issue 1232193002: Replace MessageLoop::current() with ThreadTaskRunnerHandle::Get() in GCM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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.cc
diff --git a/google_apis/gcm/engine/heartbeat_manager.cc b/google_apis/gcm/engine/heartbeat_manager.cc
index 31c2876a60ada208b9dc6be533f7328719df8356..293f41667ebdff12ea102960606b01806959d807 100644
--- a/google_apis/gcm/engine/heartbeat_manager.cc
+++ b/google_apis/gcm/engine/heartbeat_manager.cc
@@ -5,8 +5,10 @@
#include "google_apis/gcm/engine/heartbeat_manager.h"
#include "base/callback.h"
+#include "base/location.h"
#include "base/metrics/histogram.h"
#include "base/power_monitor/power_monitor.h"
+#include "base/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "google_apis/gcm/protocol/mcs.pb.h"
@@ -174,7 +176,7 @@ void HeartbeatManager::RestartTimer() {
// Windows, Mac, Android, iOS, and Chrome OS all provide a way to be notified
// when the system is suspending or resuming. The only one that does not is
// Linux so we need to poll to check for missed heartbeats.
- base::MessageLoop::current()->PostDelayedTask(
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE,
base::Bind(&HeartbeatManager::CheckForMissedHeartbeat,
weak_ptr_factory_.GetWeakPtr()),
@@ -197,7 +199,7 @@ void HeartbeatManager::CheckForMissedHeartbeat() {
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
// Otherwise check again later.
- base::MessageLoop::current()->PostDelayedTask(
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE,
base::Bind(&HeartbeatManager::CheckForMissedHeartbeat,
weak_ptr_factory_.GetWeakPtr()),

Powered by Google App Engine
This is Rietveld 408576698