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

Unified Diff: content/child/threaded_data_provider.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/thread_safe_sender.cc ('k') | content/child/web_data_consumer_handle_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/threaded_data_provider.cc
diff --git a/content/child/threaded_data_provider.cc b/content/child/threaded_data_provider.cc
index eea420a44a17aef56c0b73268fc665ef2cf41617..5e0fe9702c0299c1e6826a6484b92341292875b1 100644
--- a/content/child/threaded_data_provider.cc
+++ b/content/child/threaded_data_provider.cc
@@ -4,6 +4,8 @@
#include "content/child/threaded_data_provider.h"
+#include "base/location.h"
+#include "base/single_thread_task_runner.h"
#include "components/scheduler/child/webthread_impl_for_worker_scheduler.h"
#include "content/child/child_process.h"
#include "content/child/child_thread_impl.h"
@@ -21,7 +23,7 @@ namespace {
class DataProviderMessageFilter : public IPC::MessageFilter {
public:
DataProviderMessageFilter(
- const scoped_refptr<base::MessageLoopProxy>& io_message_loop,
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner,
const scheduler::WebThreadImplForWorkerScheduler& background_thread,
const base::WeakPtr<ThreadedDataProvider>&
@@ -39,7 +41,7 @@ class DataProviderMessageFilter : public IPC::MessageFilter {
void OnReceivedData(int request_id, int data_offset, int data_length,
int encoded_data_length);
- const scoped_refptr<base::MessageLoopProxy> io_message_loop_;
+ const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
const scheduler::WebThreadImplForWorkerScheduler& background_thread_;
// This weakptr can only be dereferenced on the background thread.
@@ -52,14 +54,14 @@ class DataProviderMessageFilter : public IPC::MessageFilter {
};
DataProviderMessageFilter::DataProviderMessageFilter(
- const scoped_refptr<base::MessageLoopProxy>& io_message_loop,
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner,
const scheduler::WebThreadImplForWorkerScheduler& background_thread,
const base::WeakPtr<ThreadedDataProvider>&
background_thread_resource_provider,
const base::WeakPtr<ThreadedDataProvider>& main_thread_resource_provider,
int request_id)
- : io_message_loop_(io_message_loop),
+ : io_task_runner_(io_task_runner),
main_thread_task_runner_(main_thread_task_runner),
background_thread_(background_thread),
background_thread_resource_provider_(background_thread_resource_provider),
@@ -69,7 +71,7 @@ DataProviderMessageFilter::DataProviderMessageFilter(
}
void DataProviderMessageFilter::OnFilterAdded(IPC::Sender* sender) {
- DCHECK(io_message_loop_->BelongsToCurrentThread());
+ DCHECK(io_task_runner_->BelongsToCurrentThread());
main_thread_task_runner_->PostTask(
FROM_HERE,
@@ -79,7 +81,7 @@ void DataProviderMessageFilter::OnFilterAdded(IPC::Sender* sender) {
bool DataProviderMessageFilter::OnMessageReceived(
const IPC::Message& message) {
- DCHECK(io_message_loop_->BelongsToCurrentThread());
+ DCHECK(io_task_runner_->BelongsToCurrentThread());
if (message.type() != ResourceMsg_DataReceived::ID)
return false;
@@ -107,7 +109,7 @@ void DataProviderMessageFilter::OnReceivedData(int request_id,
int data_offset,
int data_length,
int encoded_data_length) {
- DCHECK(io_message_loop_->BelongsToCurrentThread());
+ DCHECK(io_task_runner_->BelongsToCurrentThread());
background_thread_.TaskRunner()->PostTask(
FROM_HERE,
base::Bind(&ThreadedDataProvider::OnReceivedDataOnBackgroundThread,
@@ -143,9 +145,8 @@ ThreadedDataProvider::ThreadedDataProvider(
new base::WeakPtrFactory<ThreadedDataProvider>(this));
filter_ = new DataProviderMessageFilter(
- ChildProcess::current()->io_message_loop_proxy(),
- main_thread_task_runner_, background_thread_,
- background_thread_weak_factory_->GetWeakPtr(),
+ ChildProcess::current()->io_task_runner(), main_thread_task_runner_,
+ background_thread_, background_thread_weak_factory_->GetWeakPtr(),
main_thread_weak_factory_.GetWeakPtr(), request_id);
ChildThreadImpl::current()->channel()->AddFilter(filter_.get());
« no previous file with comments | « content/child/thread_safe_sender.cc ('k') | content/child/web_data_consumer_handle_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698