summaryrefslogtreecommitdiffstats
path: root/base/trace_event/trace_event_memory.cc
diff options
context:
space:
mode:
authorstevenjb <stevenjb@chromium.org>2015-04-29 14:43:03 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-29 21:44:18 +0000
commit7669182866d8605d98a5141f7b82be3b516799ca (patch)
treeab4b166fa5b19181751469bfff84be8c0f00aaad /base/trace_event/trace_event_memory.cc
parentfd2d6d70942f4a64845022066098622809c189e9 (diff)
downloadchromium_src-7669182866d8605d98a5141f7b82be3b516799ca.zip
chromium_src-7669182866d8605d98a5141f7b82be3b516799ca.tar.gz
chromium_src-7669182866d8605d98a5141f7b82be3b516799ca.tar.bz2
Revert of base: Remove use of MessageLoopProxy (patchset #6 id:100001 of https://codereview.chromium.org/1100773004/)
Reason for revert: This CL caused this failure: http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%281%29/builds/2126 I would strongly recommend doing this in smaller pieces since it combines mechanical changes with more subtle ones (base/prefs, base/task). Original issue's description: > base: Remove use of MessageLoopProxy > > Replace usage of MessageLoopProxy under base/ with SingleThreadTaskRunner > and ThreadTaskRunnerHandle (excluding the implementation of MessageLoopProxy > itself which will removed later). > > This patch was mostly autogenerated with > https://codereview.chromium.org/1010073002. > > Depends on https://codereview.chromium.org/1086733002/. > > BUG=465354 > TBR=nkostylev@chromium.org,pkasting@chromium.org,pauljensen@chromium.org > > Committed: https://crrev.com/62aa5ca413e15738ebebbb9acd271138ec808739 > Cr-Commit-Position: refs/heads/master@{#327512} TBR=danakj@chromium.org,skyostil@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=465354 Review URL: https://codereview.chromium.org/1113953002 Cr-Commit-Position: refs/heads/master@{#327573}
Diffstat (limited to 'base/trace_event/trace_event_memory.cc')
-rw-r--r--base/trace_event/trace_event_memory.cc21
1 files changed, 11 insertions, 10 deletions
diff --git a/base/trace_event/trace_event_memory.cc b/base/trace_event/trace_event_memory.cc
index ab8ba0d3..2bf6d38 100644
--- a/base/trace_event/trace_event_memory.cc
+++ b/base/trace_event/trace_event_memory.cc
@@ -6,10 +6,9 @@
#include "base/debug/leak_annotations.h"
#include "base/lazy_instance.h"
-#include "base/location.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-#include "base/single_thread_task_runner.h"
+#include "base/message_loop/message_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_local_storage.h"
@@ -145,11 +144,11 @@ int GetPseudoStack(int skip_count_ignored, void** stack_out) {
//////////////////////////////////////////////////////////////////////////////
TraceMemoryController::TraceMemoryController(
- scoped_refptr<SingleThreadTaskRunner> task_runner,
+ scoped_refptr<MessageLoopProxy> message_loop_proxy,
HeapProfilerStartFunction heap_profiler_start_function,
HeapProfilerStopFunction heap_profiler_stop_function,
GetHeapProfileFunction get_heap_profile_function)
- : task_runner_(task_runner.Pass()),
+ : message_loop_proxy_(message_loop_proxy),
heap_profiler_start_function_(heap_profiler_start_function),
heap_profiler_stop_function_(heap_profiler_stop_function),
get_heap_profile_function_(get_heap_profile_function),
@@ -175,9 +174,10 @@ void TraceMemoryController::OnTraceLogEnabled() {
if (!enabled)
return;
DVLOG(1) << "OnTraceLogEnabled";
- task_runner_->PostTask(FROM_HERE,
- base::Bind(&TraceMemoryController::StartProfiling,
- weak_factory_.GetWeakPtr()));
+ message_loop_proxy_->PostTask(
+ FROM_HERE,
+ base::Bind(&TraceMemoryController::StartProfiling,
+ weak_factory_.GetWeakPtr()));
}
void TraceMemoryController::OnTraceLogDisabled() {
@@ -185,9 +185,10 @@ void TraceMemoryController::OnTraceLogDisabled() {
// called, so we cannot tell if it was enabled before. Always try to turn
// off profiling.
DVLOG(1) << "OnTraceLogDisabled";
- task_runner_->PostTask(FROM_HERE,
- base::Bind(&TraceMemoryController::StopProfiling,
- weak_factory_.GetWeakPtr()));
+ message_loop_proxy_->PostTask(
+ FROM_HERE,
+ base::Bind(&TraceMemoryController::StopProfiling,
+ weak_factory_.GetWeakPtr()));
}
void TraceMemoryController::StartProfiling() {