Index: content/child/web_data_consumer_handle_impl_unittest.cc |
diff --git a/content/child/web_data_consumer_handle_impl_unittest.cc b/content/child/web_data_consumer_handle_impl_unittest.cc |
index 4aaa4dc69c4cd954b8f3daad7b431604c0ed6647..fd250ec2fe7a38e49ce30427832b69fd81a83f7f 100644 |
--- a/content/child/web_data_consumer_handle_impl_unittest.cc |
+++ b/content/child/web_data_consumer_handle_impl_unittest.cc |
@@ -7,10 +7,12 @@ |
#include <algorithm> |
#include <string> |
#include "base/bind.h" |
+#include "base/location.h" |
#include "base/memory/scoped_ptr.h" |
-#include "base/message_loop/message_loop.h" |
#include "base/run_loop.h" |
+#include "base/single_thread_task_runner.h" |
#include "base/synchronization/waitable_event.h" |
+#include "base/thread_task_runner_handle.h" |
#include "base/threading/thread.h" |
#include "testing/gtest/include/gtest/gtest.h" |
#include "third_party/mojo/src/mojo/public/cpp/system/data_pipe.h" |
@@ -41,10 +43,9 @@ class ClientImpl final : public WebDataConsumerHandle::Client { |
: operation_(operation) {} |
void didGetReadable() override { |
- base::MessageLoop::current()->PostTask( |
- FROM_HERE, |
- base::Bind(&ReadDataOperationBase::ReadMore, |
- base::Unretained(operation_))); |
+ base::ThreadTaskRunnerHandle::Get()->PostTask( |
+ FROM_HERE, base::Bind(&ReadDataOperationBase::ReadMore, |
+ base::Unretained(operation_))); |
} |
private: |
@@ -93,7 +94,7 @@ class ReadDataOperation : public ReadDataOperationBase { |
} |
// The operation is done. |
- main_message_loop_->PostTask(FROM_HERE, on_done_); |
+ main_message_loop_->task_runner()->PostTask(FROM_HERE, on_done_); |
} |
private: |
@@ -140,7 +141,7 @@ class TwoPhaseReadDataOperation : public ReadDataOperationBase { |
if (rv != kOk) { |
// Something is wrong. |
result_ = "error"; |
- main_message_loop_->PostTask(FROM_HERE, on_done_); |
+ main_message_loop_->task_runner()->PostTask(FROM_HERE, on_done_); |
return; |
} |
} |
@@ -156,7 +157,7 @@ class TwoPhaseReadDataOperation : public ReadDataOperationBase { |
} |
// The operation is done. |
- main_message_loop_->PostTask(FROM_HERE, on_done_); |
+ main_message_loop_->task_runner()->PostTask(FROM_HERE, on_done_); |
} |
private: |
@@ -227,10 +228,9 @@ TEST_F(WebDataConsumerHandleImplTest, ReadData) { |
base::Thread t("DataConsumerHandle test thread"); |
ASSERT_TRUE(t.Start()); |
- t.message_loop()->PostTask( |
- FROM_HERE, |
- base::Bind(&ReadDataOperation::ReadData, |
- base::Unretained(operation.get()))); |
+ t.task_runner()->PostTask(FROM_HERE, |
+ base::Bind(&ReadDataOperation::ReadData, |
+ base::Unretained(operation.get()))); |
std::string expected = ProduceData(24 * 1024); |
producer_.reset(); |
@@ -251,10 +251,9 @@ TEST_F(WebDataConsumerHandleImplTest, TwoPhaseReadData) { |
base::Thread t("DataConsumerHandle test thread"); |
ASSERT_TRUE(t.Start()); |
- t.message_loop()->PostTask( |
- FROM_HERE, |
- base::Bind(&TwoPhaseReadDataOperation::ReadData, |
- base::Unretained(operation.get()))); |
+ t.task_runner()->PostTask(FROM_HERE, |
+ base::Bind(&TwoPhaseReadDataOperation::ReadData, |
+ base::Unretained(operation.get()))); |
std::string expected = ProduceData(24 * 1024); |
producer_.reset(); |