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

Unified Diff: content/child/web_data_consumer_handle_impl_unittest.cc

Issue 1142063003: content/child: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fix. Created 5 years, 7 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 | « content/child/threaded_data_provider.cc ('k') | content/child/webmessageportchannel_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « content/child/threaded_data_provider.cc ('k') | content/child/webmessageportchannel_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698