| Index: content/child/child_thread_impl.cc
|
| diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
|
| index b6a2eea2b8aa2e4fde1c6d6a0c41023ba0bb5576..9bb754e46e6dc09e1ae0125eebbe54987c224cda 100644
|
| --- a/content/child/child_thread_impl.cc
|
| +++ b/content/child/child_thread_impl.cc
|
| @@ -207,7 +207,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() {
|
| @@ -242,6 +243,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_;
|
| }
|
| @@ -255,14 +263,12 @@ bool ChildThreadImpl::ChildThreadMessageRouter::Send(IPC::Message* msg) {
|
| }
|
|
|
| ChildThreadImpl::ChildThreadImpl()
|
| - : router_(this),
|
| - in_browser_process_(false),
|
| - channel_connected_factory_(this) {
|
| - Init(Options::Builder().Build());
|
| + : ChildThreadImpl(Options::Builder().Build()) {
|
| }
|
|
|
| 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);
|
| @@ -308,8 +314,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());
|
|
|
| @@ -474,6 +479,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));
|
|
|