Index: base/trace_event/trace_event_unittest.cc |
diff --git a/base/trace_event/trace_event_unittest.cc b/base/trace_event/trace_event_unittest.cc |
index 17953e76da1cfe288e7952ae67136e76775b2f2d..0d3b0912ae21a15deac99aaa02b3eaede25421b8 100644 |
--- a/base/trace_event/trace_event_unittest.cc |
+++ b/base/trace_event/trace_event_unittest.cc |
@@ -9,12 +9,10 @@ |
#include "base/command_line.h" |
#include "base/json/json_reader.h" |
#include "base/json/json_writer.h" |
-#include "base/location.h" |
#include "base/memory/ref_counted_memory.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/singleton.h" |
#include "base/process/process_handle.h" |
-#include "base/single_thread_task_runner.h" |
#include "base/strings/stringprintf.h" |
#include "base/synchronization/waitable_event.h" |
#include "base/threading/platform_thread.h" |
@@ -97,9 +95,10 @@ |
WaitableEvent flush_complete_event(false, false); |
Thread flush_thread("flush"); |
flush_thread.Start(); |
- flush_thread.task_runner()->PostTask( |
- FROM_HERE, base::Bind(&TraceEventTestFixture::EndTraceAndFlushAsync, |
- base::Unretained(this), &flush_complete_event)); |
+ flush_thread.message_loop()->PostTask(FROM_HERE, |
+ base::Bind(&TraceEventTestFixture::EndTraceAndFlushAsync, |
+ base::Unretained(this), |
+ &flush_complete_event)); |
flush_complete_event.Wait(); |
} |
@@ -1425,7 +1424,7 @@ |
WaitableEvent task_complete_event(false, false); |
thread.Start(); |
- thread.task_runner()->PostTask( |
+ thread.message_loop()->PostTask( |
FROM_HERE, base::Bind(&TraceWithAllMacroVariants, &task_complete_event)); |
task_complete_event.Wait(); |
thread.Stop(); |
@@ -1446,9 +1445,9 @@ |
threads[i] = new Thread(StringPrintf("Thread %d", i)); |
task_complete_events[i] = new WaitableEvent(false, false); |
threads[i]->Start(); |
- threads[i]->task_runner()->PostTask( |
- FROM_HERE, base::Bind(&TraceManyInstantEvents, i, num_events, |
- task_complete_events[i])); |
+ threads[i]->message_loop()->PostTask( |
+ FROM_HERE, base::Bind(&TraceManyInstantEvents, |
+ i, num_events, task_complete_events[i])); |
} |
for (int i = 0; i < num_threads; i++) { |
@@ -1494,9 +1493,9 @@ |
task_complete_events[i] = new WaitableEvent(false, false); |
threads[i]->Start(); |
thread_ids[i] = threads[i]->thread_id(); |
- threads[i]->task_runner()->PostTask( |
- FROM_HERE, base::Bind(&TraceManyInstantEvents, i, kNumEvents, |
- task_complete_events[i])); |
+ threads[i]->message_loop()->PostTask( |
+ FROM_HERE, base::Bind(&TraceManyInstantEvents, |
+ i, kNumEvents, task_complete_events[i])); |
} |
for (int i = 0; i < kNumThreads; i++) { |
task_complete_events[i]->Wait(); |
@@ -2726,17 +2725,17 @@ |
Thread thread("1"); |
WaitableEvent task_complete_event(false, false); |
thread.Start(); |
- thread.task_runner()->PostTask( |
+ thread.message_loop()->PostTask( |
FROM_HERE, Bind(&TraceLog::SetCurrentThreadBlocksMessageLoop, |
Unretained(TraceLog::GetInstance()))); |
- thread.task_runner()->PostTask( |
+ thread.message_loop()->PostTask( |
FROM_HERE, Bind(&TraceWithAllMacroVariants, &task_complete_event)); |
task_complete_event.Wait(); |
WaitableEvent task_start_event(false, false); |
WaitableEvent task_stop_event(false, false); |
- thread.task_runner()->PostTask( |
+ thread.message_loop()->PostTask( |
FROM_HERE, Bind(&BlockUntilStopped, &task_start_event, &task_stop_event)); |
task_start_event.Wait(); |
@@ -2797,15 +2796,15 @@ |
WaitableEvent task_complete_event(false, false); |
thread.Start(); |
- thread.task_runner()->PostTask( |
+ thread.message_loop()->PostTask( |
FROM_HERE, Bind(&TraceWithAllMacroVariants, &task_complete_event)); |
task_complete_event.Wait(); |
WaitableEvent task_start_event(false, false); |
WaitableEvent task_stop_event(false, false); |
- thread.task_runner()->PostTask( |
- FROM_HERE, Bind(&SetBlockingFlagAndBlockUntilStopped, &task_start_event, |
- &task_stop_event)); |
+ thread.message_loop()->PostTask( |
+ FROM_HERE, Bind(&SetBlockingFlagAndBlockUntilStopped, |
+ &task_start_event, &task_stop_event)); |
task_start_event.Wait(); |
EndTraceAndFlush(); |
@@ -2822,14 +2821,14 @@ |
WaitableEvent task_complete_event(false, false); |
thread.Start(); |
- thread.task_runner()->PostTask( |
+ thread.message_loop()->PostTask( |
FROM_HERE, Bind(&TraceWithAllMacroVariants, &task_complete_event)); |
task_complete_event.Wait(); |
task_complete_event.Reset(); |
WaitableEvent task_start_event(false, false); |
WaitableEvent task_stop_event(false, false); |
- thread.task_runner()->PostTask( |
+ thread.message_loop()->PostTask( |
FROM_HERE, Bind(&BlockUntilStopped, &task_start_event, &task_stop_event)); |
task_start_event.Wait(); |
@@ -2844,7 +2843,7 @@ |
// executed in the thread before continuing. |
task_start_event.Reset(); |
task_stop_event.Reset(); |
- thread.task_runner()->PostTask( |
+ thread.message_loop()->PostTask( |
FROM_HERE, Bind(&BlockUntilStopped, &task_start_event, &task_stop_event)); |
task_start_event.Wait(); |
task_stop_event.Signal(); |
@@ -2853,7 +2852,7 @@ |
// TraceLog should discover the generation mismatch and recover the thread |
// local buffer for the thread without any error. |
BeginTrace(); |
- thread.task_runner()->PostTask( |
+ thread.message_loop()->PostTask( |
FROM_HERE, Bind(&TraceWithAllMacroVariants, &task_complete_event)); |
task_complete_event.Wait(); |
task_complete_event.Reset(); |