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

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

Issue 2156483002: Shutdown PeerConnectionDependencyFactory before Blink shutdown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « content/renderer/media/webrtc/peer_connection_dependency_factory.cc ('k') | 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 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 if (devtools_agent_message_filter_.get()) { 888 if (devtools_agent_message_filter_.get()) {
889 RemoveFilter(devtools_agent_message_filter_.get()); 889 RemoveFilter(devtools_agent_message_filter_.get());
890 devtools_agent_message_filter_ = nullptr; 890 devtools_agent_message_filter_ = nullptr;
891 } 891 }
892 892
893 RemoveFilter(audio_input_message_filter_.get()); 893 RemoveFilter(audio_input_message_filter_.get());
894 audio_input_message_filter_ = nullptr; 894 audio_input_message_filter_ = nullptr;
895 895
896 #if defined(ENABLE_WEBRTC) 896 #if defined(ENABLE_WEBRTC)
897 RTCPeerConnectionHandler::DestructAllHandlers(); 897 RTCPeerConnectionHandler::DestructAllHandlers();
898 // |peer_connection_factory_| cannot be deleted until after the main message 898 peer_connection_factory_->ShutDown();
899 // loop has been destroyed. This is because there may be pending tasks that 899 peer_connection_factory_ = nullptr;
900 // hold on to objects produced by the PC factory that depend on threads owned
901 // by the PC factory. Once those tasks have been freed, the factory can be
902 // deleted.
903 #endif 900 #endif
904 RemoveFilter(vc_manager_->video_capture_message_filter()); 901 RemoveFilter(vc_manager_->video_capture_message_filter());
905 vc_manager_.reset(); 902 vc_manager_.reset();
906 903
907 RemoveFilter(db_message_filter_.get()); 904 RemoveFilter(db_message_filter_.get());
908 db_message_filter_ = nullptr; 905 db_message_filter_ = nullptr;
909 906
910 // Shutdown the file thread if it's running. 907 // Shutdown the file thread if it's running.
911 if (file_thread_) 908 if (file_thread_)
912 file_thread_->Stop(); 909 file_thread_->Stop();
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) 2235 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical)
2239 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; 2236 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate;
2240 2237
2241 blink::mainThreadIsolate()->MemoryPressureNotification( 2238 blink::mainThreadIsolate()->MemoryPressureNotification(
2242 v8_memory_pressure_level); 2239 v8_memory_pressure_level);
2243 blink::MemoryPressureNotificationToWorkerThreadIsolates( 2240 blink::MemoryPressureNotificationToWorkerThreadIsolates(
2244 v8_memory_pressure_level); 2241 v8_memory_pressure_level);
2245 } 2242 }
2246 2243
2247 } // namespace content 2244 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc/peer_connection_dependency_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698