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

Unified Diff: rlz/lib/financial_ping.cc

Issue 2033863003: Remove use of deprecated MessageLoop methods in rlz. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: rlz/lib/financial_ping.cc
diff --git a/rlz/lib/financial_ping.cc b/rlz/lib/financial_ping.cc
index 1e0e362e2f29dc87c60afc1fc10b141656a4d069..b9c200d5e9b6cb6c25b405e2547d9b790ac094f4 100644
--- a/rlz/lib/financial_ping.cc
+++ b/rlz/lib/financial_ping.cc
@@ -11,11 +11,14 @@
#include <memory>
#include "base/atomicops.h"
+#include "base/location.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "base/single_thread_task_runner.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "rlz/lib/assert.h"
#include "rlz/lib/lib_values.h"
@@ -230,10 +233,8 @@ void ShutdownCheck(base::WeakPtr<base::RunLoop> weak) {
// How frequently the financial ping thread should check
// the shutdown condition?
const base::TimeDelta kInterval = base::TimeDelta::FromMilliseconds(500);
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&ShutdownCheck, weak),
- kInterval);
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&ShutdownCheck, weak), kInterval);
}
#endif
@@ -334,13 +335,12 @@ bool FinancialPing::PingServer(const char* request, std::string* response) {
const base::TimeDelta kTimeout = base::TimeDelta::FromMinutes(5);
base::MessageLoop::ScopedNestableTaskAllower allow_nested(
base::MessageLoop::current());
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&ShutdownCheck, weak.GetWeakPtr()));
- base::MessageLoop::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&ShutdownCheck, weak.GetWeakPtr()));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(&net::URLFetcher::Start, base::Unretained(fetcher.get())));
- base::MessageLoop::current()->PostDelayedTask(
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, loop.QuitClosure(), kTimeout);
loop.Run();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698