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

Unified Diff: base/memory/weak_ptr_unittest.cc

Issue 1113953002: Revert of base: Remove use of MessageLoopProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/memory/ref_counted_delete_on_message_loop.h ('k') | base/observer_list_threadsafe.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/weak_ptr_unittest.cc
diff --git a/base/memory/weak_ptr_unittest.cc b/base/memory/weak_ptr_unittest.cc
index 20e5c7b05c2d533b75eabc191054ad85669c2003..d89a5c6bbda66d9417d05ef94d68eb4a6128e31b 100644
--- a/base/memory/weak_ptr_unittest.cc
+++ b/base/memory/weak_ptr_unittest.cc
@@ -8,9 +8,8 @@
#include "base/bind.h"
#include "base/debug/leak_annotations.h"
-#include "base/location.h"
#include "base/memory/scoped_ptr.h"
-#include "base/single_thread_task_runner.h"
+#include "base/message_loop/message_loop.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -26,8 +25,9 @@
{
Thread creator_thread("creator_thread");
creator_thread.Start();
- creator_thread.task_runner()->PostTask(
- FROM_HERE, base::Bind(OffThreadObjectCreator::CreateObject, &result));
+ creator_thread.message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(OffThreadObjectCreator::CreateObject, &result));
}
DCHECK(result); // We synchronized on thread destruction above.
return result;
@@ -66,23 +66,25 @@
void CreateArrowFromTarget(Arrow** arrow, Target* target) {
WaitableEvent completion(true, false);
- task_runner()->PostTask(
- FROM_HERE, base::Bind(&BackgroundThread::DoCreateArrowFromTarget, arrow,
- target, &completion));
+ message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(&BackgroundThread::DoCreateArrowFromTarget,
+ arrow, target, &completion));
completion.Wait();
}
void CreateArrowFromArrow(Arrow** arrow, const Arrow* other) {
WaitableEvent completion(true, false);
- task_runner()->PostTask(
- FROM_HERE, base::Bind(&BackgroundThread::DoCreateArrowFromArrow, arrow,
- other, &completion));
+ message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(&BackgroundThread::DoCreateArrowFromArrow,
+ arrow, other, &completion));
completion.Wait();
}
void DeleteTarget(Target* object) {
WaitableEvent completion(true, false);
- task_runner()->PostTask(
+ message_loop()->PostTask(
FROM_HERE,
base::Bind(&BackgroundThread::DoDeleteTarget, object, &completion));
completion.Wait();
@@ -90,23 +92,25 @@
void CopyAndAssignArrow(Arrow* object) {
WaitableEvent completion(true, false);
- task_runner()->PostTask(
- FROM_HERE, base::Bind(&BackgroundThread::DoCopyAndAssignArrow, object,
- &completion));
+ message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(&BackgroundThread::DoCopyAndAssignArrow,
+ object, &completion));
completion.Wait();
}
void CopyAndAssignArrowBase(Arrow* object) {
WaitableEvent completion(true, false);
- task_runner()->PostTask(
- FROM_HERE, base::Bind(&BackgroundThread::DoCopyAndAssignArrowBase,
- object, &completion));
+ message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(&BackgroundThread::DoCopyAndAssignArrowBase,
+ object, &completion));
completion.Wait();
}
void DeleteArrow(Arrow* object) {
WaitableEvent completion(true, false);
- task_runner()->PostTask(
+ message_loop()->PostTask(
FROM_HERE,
base::Bind(&BackgroundThread::DoDeleteArrow, object, &completion));
completion.Wait();
@@ -115,8 +119,9 @@
Target* DeRef(const Arrow* arrow) {
WaitableEvent completion(true, false);
Target* result = NULL;
- task_runner()->PostTask(FROM_HERE, base::Bind(&BackgroundThread::DoDeRef,
- arrow, &result, &completion));
+ message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(&BackgroundThread::DoDeRef, arrow, &result, &completion));
completion.Wait();
return result;
}
« no previous file with comments | « base/memory/ref_counted_delete_on_message_loop.h ('k') | base/observer_list_threadsafe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698