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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 2314613002: Revert of Stop shutting down the message loop when the renderer stops (patchset #1 id:1 of https://… (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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 960
961 // Shut down the message loop (if provided when the RenderThreadImpl was 961 // Shut down the message loop (if provided when the RenderThreadImpl was
962 // constructed) and the renderer scheduler before shutting down Blink. This 962 // constructed) and the renderer scheduler before shutting down Blink. This
963 // prevents a scenario where a pending task in the message loop accesses Blink 963 // prevents a scenario where a pending task in the message loop accesses Blink
964 // objects after Blink shuts down. 964 // objects after Blink shuts down.
965 renderer_scheduler_->SetRAILModeObserver(nullptr); 965 renderer_scheduler_->SetRAILModeObserver(nullptr);
966 renderer_scheduler_->Shutdown(); 966 renderer_scheduler_->Shutdown();
967 967
968 ChildThreadImpl::ShutdownDiscardableSharedMemoryManager(); 968 ChildThreadImpl::ShutdownDiscardableSharedMemoryManager();
969 969
970 if (main_message_loop_)
971 base::RunLoop().RunUntilIdle();
972
973 main_message_loop_.reset();
974
970 lazy_tls.Pointer()->Set(nullptr); 975 lazy_tls.Pointer()->Set(nullptr);
971 } 976 }
972 977
973 bool RenderThreadImpl::Send(IPC::Message* msg) { 978 bool RenderThreadImpl::Send(IPC::Message* msg) {
974 // There are cases where we want to pump asynchronous messages while waiting 979 // There are cases where we want to pump asynchronous messages while waiting
975 // synchronously for the replies to the message to be sent here. However, this 980 // synchronously for the replies to the message to be sent here. However, this
976 // may create an opportunity for re-entrancy into WebKit and other subsystems, 981 // may create an opportunity for re-entrancy into WebKit and other subsystems,
977 // so we need to take care to disable callbacks, timers, and pending network 982 // so we need to take care to disable callbacks, timers, and pending network
978 // loads that could trigger such callbacks. 983 // loads that could trigger such callbacks.
979 bool pumping_events = false; 984 bool pumping_events = false;
(...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after
2208 if (blink::mainThreadIsolate()) { 2213 if (blink::mainThreadIsolate()) {
2209 blink::mainThreadIsolate()->MemoryPressureNotification( 2214 blink::mainThreadIsolate()->MemoryPressureNotification(
2210 v8::MemoryPressureLevel::kCritical); 2215 v8::MemoryPressureLevel::kCritical);
2211 blink::MemoryPressureNotificationToWorkerThreadIsolates( 2216 blink::MemoryPressureNotificationToWorkerThreadIsolates(
2212 v8::MemoryPressureLevel::kCritical); 2217 v8::MemoryPressureLevel::kCritical);
2213 } 2218 }
2214 } 2219 }
2215 2220
2216 2221
2217 } // namespace content 2222 } // namespace content
OLDNEW
« 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