Index: base/memory/weak_ptr_unittest.cc |
diff --git a/base/memory/weak_ptr_unittest.cc b/base/memory/weak_ptr_unittest.cc |
index d89a5c6bbda66d9417d05ef94d68eb4a6128e31b..20e5c7b05c2d533b75eabc191054ad85669c2003 100644 |
--- a/base/memory/weak_ptr_unittest.cc |
+++ b/base/memory/weak_ptr_unittest.cc |
@@ -8,8 +8,9 @@ |
#include "base/bind.h" |
#include "base/debug/leak_annotations.h" |
+#include "base/location.h" |
#include "base/memory/scoped_ptr.h" |
-#include "base/message_loop/message_loop.h" |
+#include "base/single_thread_task_runner.h" |
#include "base/synchronization/waitable_event.h" |
#include "base/threading/thread.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -25,9 +26,8 @@ class OffThreadObjectCreator { |
{ |
Thread creator_thread("creator_thread"); |
creator_thread.Start(); |
- creator_thread.message_loop()->PostTask( |
- FROM_HERE, |
- base::Bind(OffThreadObjectCreator::CreateObject, &result)); |
+ creator_thread.task_runner()->PostTask( |
+ FROM_HERE, base::Bind(OffThreadObjectCreator::CreateObject, &result)); |
} |
DCHECK(result); // We synchronized on thread destruction above. |
return result; |
@@ -66,25 +66,23 @@ class BackgroundThread : public Thread { |
void CreateArrowFromTarget(Arrow** arrow, Target* target) { |
WaitableEvent completion(true, false); |
- message_loop()->PostTask( |
- FROM_HERE, |
- base::Bind(&BackgroundThread::DoCreateArrowFromTarget, |
- arrow, target, &completion)); |
+ task_runner()->PostTask( |
+ FROM_HERE, base::Bind(&BackgroundThread::DoCreateArrowFromTarget, arrow, |
+ target, &completion)); |
completion.Wait(); |
} |
void CreateArrowFromArrow(Arrow** arrow, const Arrow* other) { |
WaitableEvent completion(true, false); |
- message_loop()->PostTask( |
- FROM_HERE, |
- base::Bind(&BackgroundThread::DoCreateArrowFromArrow, |
- arrow, other, &completion)); |
+ task_runner()->PostTask( |
+ FROM_HERE, base::Bind(&BackgroundThread::DoCreateArrowFromArrow, arrow, |
+ other, &completion)); |
completion.Wait(); |
} |
void DeleteTarget(Target* object) { |
WaitableEvent completion(true, false); |
- message_loop()->PostTask( |
+ task_runner()->PostTask( |
FROM_HERE, |
base::Bind(&BackgroundThread::DoDeleteTarget, object, &completion)); |
completion.Wait(); |
@@ -92,25 +90,23 @@ class BackgroundThread : public Thread { |
void CopyAndAssignArrow(Arrow* object) { |
WaitableEvent completion(true, false); |
- message_loop()->PostTask( |
- FROM_HERE, |
- base::Bind(&BackgroundThread::DoCopyAndAssignArrow, |
- object, &completion)); |
+ task_runner()->PostTask( |
+ FROM_HERE, base::Bind(&BackgroundThread::DoCopyAndAssignArrow, object, |
+ &completion)); |
completion.Wait(); |
} |
void CopyAndAssignArrowBase(Arrow* object) { |
WaitableEvent completion(true, false); |
- message_loop()->PostTask( |
- FROM_HERE, |
- base::Bind(&BackgroundThread::DoCopyAndAssignArrowBase, |
- object, &completion)); |
+ task_runner()->PostTask( |
+ FROM_HERE, base::Bind(&BackgroundThread::DoCopyAndAssignArrowBase, |
+ object, &completion)); |
completion.Wait(); |
} |
void DeleteArrow(Arrow* object) { |
WaitableEvent completion(true, false); |
- message_loop()->PostTask( |
+ task_runner()->PostTask( |
FROM_HERE, |
base::Bind(&BackgroundThread::DoDeleteArrow, object, &completion)); |
completion.Wait(); |
@@ -119,9 +115,8 @@ class BackgroundThread : public Thread { |
Target* DeRef(const Arrow* arrow) { |
WaitableEvent completion(true, false); |
Target* result = NULL; |
- message_loop()->PostTask( |
- FROM_HERE, |
- base::Bind(&BackgroundThread::DoDeRef, arrow, &result, &completion)); |
+ task_runner()->PostTask(FROM_HERE, base::Bind(&BackgroundThread::DoDeRef, |
+ arrow, &result, &completion)); |
completion.Wait(); |
return result; |
} |