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

Unified Diff: base/debug/trace_event_memory.cc

Issue 369703003: Reduce usage of MessageLoopProxy in base/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 2 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 | « base/debug/trace_event_memory.h ('k') | base/files/file_path_watcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/trace_event_memory.cc
diff --git a/base/debug/trace_event_memory.cc b/base/debug/trace_event_memory.cc
index 5cb09087f57fa404eedee214ef9c80ec3069d0aa..766ca7412290285bf532b34a6745d71a27d4d553 100644
--- a/base/debug/trace_event_memory.cc
+++ b/base/debug/trace_event_memory.cc
@@ -9,7 +9,7 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
+#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_local_storage.h"
@@ -144,11 +144,11 @@ int GetPseudoStack(int skip_count_ignored, void** stack_out) {
//////////////////////////////////////////////////////////////////////////////
TraceMemoryController::TraceMemoryController(
- scoped_refptr<MessageLoopProxy> message_loop_proxy,
+ scoped_refptr<SingleThreadTaskRunner> main_task_runner,
HeapProfilerStartFunction heap_profiler_start_function,
HeapProfilerStopFunction heap_profiler_stop_function,
GetHeapProfileFunction get_heap_profile_function)
- : message_loop_proxy_(message_loop_proxy),
+ : main_task_runner_(main_task_runner),
heap_profiler_start_function_(heap_profiler_start_function),
heap_profiler_stop_function_(heap_profiler_stop_function),
get_heap_profile_function_(get_heap_profile_function),
@@ -174,10 +174,9 @@ void TraceMemoryController::OnTraceLogEnabled() {
if (!enabled)
return;
DVLOG(1) << "OnTraceLogEnabled";
- message_loop_proxy_->PostTask(
- FROM_HERE,
- base::Bind(&TraceMemoryController::StartProfiling,
- weak_factory_.GetWeakPtr()));
+ main_task_runner_->PostTask(FROM_HERE,
+ base::Bind(&TraceMemoryController::StartProfiling,
+ weak_factory_.GetWeakPtr()));
}
void TraceMemoryController::OnTraceLogDisabled() {
@@ -185,10 +184,9 @@ void TraceMemoryController::OnTraceLogDisabled() {
// called, so we cannot tell if it was enabled before. Always try to turn
// off profiling.
DVLOG(1) << "OnTraceLogDisabled";
- message_loop_proxy_->PostTask(
- FROM_HERE,
- base::Bind(&TraceMemoryController::StopProfiling,
- weak_factory_.GetWeakPtr()));
+ main_task_runner_->PostTask(FROM_HERE,
+ base::Bind(&TraceMemoryController::StopProfiling,
+ weak_factory_.GetWeakPtr()));
}
void TraceMemoryController::StartProfiling() {
« no previous file with comments | « base/debug/trace_event_memory.h ('k') | base/files/file_path_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698