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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 2315573003: Revert of Stop calling blink::shutdown (patchset #9 id:160001 of https://codereview.chromium.org/22… (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/ThreadSpecific.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 7788e23d39496274d0f03de72922196351b52f2b..80f8fcd17814f699b7382783da0b446512dd541c 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -964,12 +964,25 @@ void RenderThreadImpl::Shutdown() {
// objects after Blink shuts down.
renderer_scheduler_->SetRAILModeObserver(nullptr);
renderer_scheduler_->Shutdown();
-
- ChildThreadImpl::ShutdownDiscardableSharedMemoryManager();
-
if (main_message_loop_)
base::RunLoop().RunUntilIdle();
+ if (blink_platform_impl_) {
+ blink_platform_impl_->Shutdown();
+ // This must be at the very end of the shutdown sequence.
+ // blink::shutdown() must be called after all strong references from
+ // Chromium to Blink are cleared.
+ blink::shutdown();
+ }
+
+ // Delay shutting down DiscardableSharedMemoryManager until blink::shutdown
+ // is complete, because blink::shutdown destructs Blink Resources and they
+ // may try to unlock their underlying discardable memory.
+ ChildThreadImpl::ShutdownDiscardableSharedMemoryManager();
+
+ // The message loop must be cleared after shutting down
+ // the DiscardableSharedMemoryManager, which needs to send messages
+ // to the browser process.
main_message_loop_.reset();
lazy_tls.Pointer()->Set(nullptr);
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/ThreadSpecific.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698