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

Unified Diff: content/child/child_thread_impl.cc

Issue 1227303002: Set listener task runner before connect channel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix trybot error. Created 5 years, 5 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/child_thread_impl.h ('k') | content/renderer/in_process_renderer_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/child_thread_impl.cc
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
index bb3cd6d79179a22543958a498ebf77b4e0e59176..88ffed79bd83f5896ced6a96863c660ec377e302 100644
--- a/content/child/child_thread_impl.cc
+++ b/content/child/child_thread_impl.cc
@@ -297,6 +297,13 @@ ChildThreadImpl::Options::Builder::AddStartupFilter(
return *this;
}
+ChildThreadImpl::Options::Builder&
+ChildThreadImpl::Options::Builder::ListenerTaskRunner(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
+ options_.listener_task_runner = task_runner;
+ return *this;
+}
+
ChildThreadImpl::Options ChildThreadImpl::Options::Builder::Build() {
return options_;
}
@@ -443,6 +450,10 @@ void ChildThreadImpl::Init(const Options& options) {
channel_->AddFilter(startup_filter);
}
+ // Set listener task runner before connect channel to avoid data race.
+ if (options.listener_task_runner) {
+ channel_->SetListenerTaskRunner(options.listener_task_runner);
+ }
ConnectChannel(options.use_mojo_channel);
int connection_timeout = kConnectionTimeoutS;
« no previous file with comments | « content/child/child_thread_impl.h ('k') | content/renderer/in_process_renderer_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698