| Index: content/child/child_thread_impl.cc
|
| diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
|
| index f62222c7d419964c4db8807720ae140706697450..247728ebf9fc9947703115c7ee8ced596e4c70ad 100644
|
| --- a/content/child/child_thread_impl.cc
|
| +++ b/content/child/child_thread_impl.cc
|
| @@ -245,7 +245,8 @@ ChildThreadImpl::Options::Options()
|
| : channel_name(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
| switches::kProcessChannelID)),
|
| use_mojo_channel(false),
|
| - in_browser_process(false) {
|
| + in_browser_process(false),
|
| + task_runner(base::MessageLoopProxy::current()) {
|
| }
|
|
|
| ChildThreadImpl::Options::~Options() {
|
| @@ -280,6 +281,13 @@ ChildThreadImpl::Options::Builder::AddStartupFilter(
|
| return *this;
|
| }
|
|
|
| +ChildThreadImpl::Options::Builder&
|
| +ChildThreadImpl::Options::Builder::WithTaskRunner(
|
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
|
| + options_.task_runner = task_runner;
|
| + return *this;
|
| +}
|
| +
|
| ChildThreadImpl::Options ChildThreadImpl::Options::Builder::Build() {
|
| return options_;
|
| }
|
| @@ -294,6 +302,7 @@ bool ChildThreadImpl::ChildThreadMessageRouter::Send(IPC::Message* msg) {
|
|
|
| ChildThreadImpl::ChildThreadImpl()
|
| : router_(this),
|
| + task_runner_(base::MessageLoopProxy::current()),
|
| in_browser_process_(false),
|
| channel_connected_factory_(this) {
|
| Init(Options::Builder().Build());
|
| @@ -301,6 +310,7 @@ ChildThreadImpl::ChildThreadImpl()
|
|
|
| ChildThreadImpl::ChildThreadImpl(const Options& options)
|
| : router_(this),
|
| + task_runner_(options.task_runner),
|
| in_browser_process_(options.in_browser_process),
|
| channel_connected_factory_(this) {
|
| Init(options);
|
| @@ -358,8 +368,7 @@ void ChildThreadImpl::Init(const Options& options) {
|
| thread_safe_sender_ = new ThreadSafeSender(
|
| base::MessageLoopProxy::current().get(), sync_message_filter_.get());
|
|
|
| - resource_dispatcher_.reset(new ResourceDispatcher(
|
| - this, message_loop()->task_runner()));
|
| + resource_dispatcher_.reset(new ResourceDispatcher(this, GetTaskRunner()));
|
| websocket_dispatcher_.reset(new WebSocketDispatcher);
|
| file_system_dispatcher_.reset(new FileSystemDispatcher());
|
|
|
| @@ -524,6 +533,10 @@ bool ChildThreadImpl::Send(IPC::Message* msg) {
|
| return channel_->Send(msg);
|
| }
|
|
|
| +scoped_refptr<base::SingleThreadTaskRunner> ChildThreadImpl::GetTaskRunner() {
|
| + return task_runner_;
|
| +}
|
| +
|
| #if defined(OS_WIN)
|
| void ChildThreadImpl::PreCacheFont(const LOGFONT& log_font) {
|
| Send(new ChildProcessHostMsg_PreCacheFont(log_font));
|
|
|