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

Unified Diff: services/tracing/public/cpp/provider.cc

Issue 2375663002: Replace MessageLoop::current()->task_runner() with ThreadTaskRunnerHandle::Get(). (Closed)
Patch Set: rebase Created 4 years, 3 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: services/tracing/public/cpp/provider.cc
diff --git a/services/tracing/public/cpp/provider.cc b/services/tracing/public/cpp/provider.cc
index 10f326e2e0bf001a7a9f29800057407e3bc902f4..e2a0a2f904f9040ee2a33a1cedd530fdcc7b0816 100644
--- a/services/tracing/public/cpp/provider.cc
+++ b/services/tracing/public/cpp/provider.cc
@@ -13,6 +13,7 @@
#include "base/single_thread_task_runner.h"
#include "base/synchronization/lock.h"
#include "base/threading/platform_thread.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "base/trace_event/trace_config.h"
#include "base/trace_event/trace_event.h"
@@ -107,7 +108,7 @@ void Provider::ForceEnableTracing() {
base::trace_event::TraceConfig("*", base::trace_event::RECORD_UNTIL_FULL),
base::trace_event::TraceLog::RECORDING_MODE);
tracing_forced_ = true;
- base::MessageLoop::current()->task_runner()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(&Provider::DelayedStop, weak_factory_.GetWeakPtr()));
}
@@ -116,7 +117,7 @@ void Provider::DelayedStop() {
// We use this indirection to account for cases where the Initialize method
// takes more than one second to finish; thus we start the countdown only when
// the current thread is unblocked.
- base::MessageLoop::current()->task_runner()->PostDelayedTask(
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE,
base::Bind(&Provider::StopIfForced, weak_factory_.GetWeakPtr()),
base::TimeDelta::FromSeconds(1));
« no previous file with comments | « services/shell/standalone/tracer.cc ('k') | third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698