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

Unified Diff: content/child/child_process.cc

Issue 1336733002: Re-land: cc: Implement shared worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: shutdown fix Created 5 years, 3 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
Index: content/child/child_process.cc
diff --git a/content/child/child_process.cc b/content/child/child_process.cc
index 01675b321f75522a487e83c714780307f89c228e..ec7ecd11f77e63f8a2aec722282c7add39f9c08f 100644
--- a/content/child/child_process.cc
+++ b/content/child/child_process.cc
@@ -54,19 +54,18 @@ ChildProcess::ChildProcess()
ChildProcess::~ChildProcess() {
DCHECK(g_lazy_tls.Pointer()->Get() == this);
+ // Kill the main thread object before nulling child_process, since
+ // destruction code might depend on it.
+ if (main_thread_) // null in unittests.
+ main_thread_->Shutdown();
+
// Signal this event before destroying the child process. That way all
// background threads can cleanup.
// For example, in the renderer the RenderThread instances will be able to
// notice shutdown before the render process begins waiting for them to exit.
shutdown_event_.Signal();
reveman 2015/09/11 22:26:13 This needs to happen after Shutdown() as that migh
- // Kill the main thread object before nulling child_process, since
- // destruction code might depend on it.
- if (main_thread_) { // null in unittests.
- main_thread_->Shutdown();
- main_thread_.reset();
- }
-
+ main_thread_.reset();
g_lazy_tls.Pointer()->Set(NULL);
io_thread_.Stop();
}

Powered by Google App Engine
This is Rietveld 408576698