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

Unified Diff: content/child/child_thread_impl.cc

Issue 2973723003: Avoid race at shutdown between browser process' IO thread and GPU thread (Closed)
Patch Set: Only let Thread::Stop stop child threads inside the browser process Created 3 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 | « no previous file | no next file » | 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 90e1e698856c11fe28eb36ee3f3320d3feceac77..8dafe6c190705ee1f3d4048c7d4de1f163f1ee3d 100644
--- a/content/child/child_thread_impl.cc
+++ b/content/child/child_thread_impl.cc
@@ -619,7 +619,10 @@ void ChildThreadImpl::OnChannelConnected(int32_t peer_pid) {
void ChildThreadImpl::OnChannelError() {
on_channel_error_called_ = true;
- base::MessageLoop::current()->QuitWhenIdle();
+ // If this thread runs in the browser process, only Thread::Stop should
+ // stop its message loop. Otherwise, QuitWhenIdle could race Thread::Stop.
+ if (!IsInBrowserProcess())
+ base::MessageLoop::current()->QuitWhenIdle();
}
bool ChildThreadImpl::Send(IPC::Message* msg) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698