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

Unified Diff: components/metrics/call_stack_profile_metrics_provider.cc

Issue 1144153004: components: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 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 | « components/metrics/call_stack_profile_metrics_provider.h ('k') | components/metrics/metrics_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/call_stack_profile_metrics_provider.cc
diff --git a/components/metrics/call_stack_profile_metrics_provider.cc b/components/metrics/call_stack_profile_metrics_provider.cc
index 1ebff3e80fcd8a999c24a2b33bcf27fff3f20156..9484776cc8a651b2270b84bd26c24ff3b922ad01 100644
--- a/components/metrics/call_stack_profile_metrics_provider.cc
+++ b/components/metrics/call_stack_profile_metrics_provider.cc
@@ -9,11 +9,13 @@
#include <utility>
#include "base/bind.h"
+#include "base/location.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/message_loop/message_loop_proxy.h"
#include "base/metrics/field_trial.h"
#include "base/profiler/stack_sampling_profiler.h"
+#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "components/metrics/metrics_hashes.h"
#include "components/metrics/proto/chrome_user_metrics_extension.pb.h"
@@ -153,10 +155,9 @@ CallStackProfileMetricsProvider::~CallStackProfileMetricsProvider() {
}
void CallStackProfileMetricsProvider::OnRecordingEnabled() {
- StackSamplingProfiler::SetDefaultCompletedCallback(
- base::Bind(&CallStackProfileMetricsProvider::ReceiveCompletedProfiles,
- base::MessageLoopProxy::current(),
- weak_factory_.GetWeakPtr()));
+ StackSamplingProfiler::SetDefaultCompletedCallback(base::Bind(
+ &CallStackProfileMetricsProvider::ReceiveCompletedProfiles,
+ base::ThreadTaskRunnerHandle::Get(), weak_factory_.GetWeakPtr()));
}
void CallStackProfileMetricsProvider::OnRecordingDisabled() {
@@ -195,10 +196,10 @@ bool CallStackProfileMetricsProvider::IsSamplingProfilingReportingEnabled() {
// static
// Posts a message back to our own thread to collect the profiles.
void CallStackProfileMetricsProvider::ReceiveCompletedProfiles(
- scoped_refptr<base::MessageLoopProxy> message_loop,
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner,
base::WeakPtr<CallStackProfileMetricsProvider> provider,
const StackSamplingProfiler::CallStackProfiles& profiles) {
- message_loop->PostTask(
+ task_runner->PostTask(
FROM_HERE,
base::Bind(&CallStackProfileMetricsProvider::AppendCompletedProfiles,
provider, profiles));
« no previous file with comments | « components/metrics/call_stack_profile_metrics_provider.h ('k') | components/metrics/metrics_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698