| OLD | NEW |
| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 #endif | 183 #endif |
| 184 | 184 |
| 185 #if defined(OS_WIN) | 185 #if defined(OS_WIN) |
| 186 #include <windows.h> | 186 #include <windows.h> |
| 187 #include <objbase.h> | 187 #include <objbase.h> |
| 188 #else | 188 #else |
| 189 // TODO(port) | 189 // TODO(port) |
| 190 #include "content/child/npapi/np_channel_base.h" | 190 #include "content/child/npapi/np_channel_base.h" |
| 191 #endif | 191 #endif |
| 192 | 192 |
| 193 #if defined(ENABLE_PLUGINS) | |
| 194 #include "content/renderer/npapi/plugin_channel_host.h" | |
| 195 #endif | |
| 196 | |
| 197 #if defined(ENABLE_WEBRTC) | 193 #if defined(ENABLE_WEBRTC) |
| 198 #include "content/renderer/media/peer_connection_tracker.h" | 194 #include "content/renderer/media/peer_connection_tracker.h" |
| 199 #include "content/renderer/media/rtc_peer_connection_handler.h" | 195 #include "content/renderer/media/rtc_peer_connection_handler.h" |
| 200 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" | 196 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" |
| 201 #include "content/renderer/media/webrtc_identity_service.h" | 197 #include "content/renderer/media/webrtc_identity_service.h" |
| 202 #endif | 198 #endif |
| 203 | 199 |
| 204 #ifdef ENABLE_VTUNE_JIT_INTERFACE | 200 #ifdef ENABLE_VTUNE_JIT_INTERFACE |
| 205 #include "v8/src/third_party/vtune/v8-vtune.h" | 201 #include "v8/src/third_party/vtune/v8-vtune.h" |
| 206 #endif | 202 #endif |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 | 937 |
| 942 gpu_factories_.clear(); | 938 gpu_factories_.clear(); |
| 943 | 939 |
| 944 // Context providers must be released prior to destroying the GPU channel. | 940 // Context providers must be released prior to destroying the GPU channel. |
| 945 shared_worker_context_provider_ = nullptr; | 941 shared_worker_context_provider_ = nullptr; |
| 946 shared_main_thread_contexts_ = nullptr; | 942 shared_main_thread_contexts_ = nullptr; |
| 947 | 943 |
| 948 if (gpu_channel_.get()) | 944 if (gpu_channel_.get()) |
| 949 gpu_channel_->DestroyChannel(); | 945 gpu_channel_->DestroyChannel(); |
| 950 | 946 |
| 951 // TODO(port) | |
| 952 #if defined(OS_WIN) | |
| 953 // Clean up plugin channels before this thread goes away. | |
| 954 NPChannelBase::CleanupChannels(); | |
| 955 #endif | |
| 956 | |
| 957 ChildThreadImpl::Shutdown(); | 947 ChildThreadImpl::Shutdown(); |
| 958 | 948 |
| 959 // Shut down the message loop and the renderer scheduler before shutting down | 949 // Shut down the message loop and the renderer scheduler before shutting down |
| 960 // Blink. This prevents a scenario where a pending task in the message loop | 950 // Blink. This prevents a scenario where a pending task in the message loop |
| 961 // accesses Blink objects after Blink shuts down. | 951 // accesses Blink objects after Blink shuts down. |
| 962 renderer_scheduler_->Shutdown(); | 952 renderer_scheduler_->Shutdown(); |
| 963 if (main_message_loop_) | 953 if (main_message_loop_) |
| 964 main_message_loop_->RunUntilIdle(); | 954 main_message_loop_->RunUntilIdle(); |
| 965 | 955 |
| 966 if (blink_platform_impl_) { | 956 if (blink_platform_impl_) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 997 bool pumping_events = false; | 987 bool pumping_events = false; |
| 998 if (msg->is_sync()) { | 988 if (msg->is_sync()) { |
| 999 if (msg->is_caller_pumping_messages()) { | 989 if (msg->is_caller_pumping_messages()) { |
| 1000 pumping_events = true; | 990 pumping_events = true; |
| 1001 } | 991 } |
| 1002 } | 992 } |
| 1003 | 993 |
| 1004 bool notify_webkit_of_modal_loop = true; // default value | 994 bool notify_webkit_of_modal_loop = true; // default value |
| 1005 std::swap(notify_webkit_of_modal_loop, notify_webkit_of_modal_loop_); | 995 std::swap(notify_webkit_of_modal_loop, notify_webkit_of_modal_loop_); |
| 1006 | 996 |
| 1007 #if defined(ENABLE_PLUGINS) | |
| 1008 int render_view_id = MSG_ROUTING_NONE; | |
| 1009 #endif | |
| 1010 | |
| 1011 if (pumping_events) { | 997 if (pumping_events) { |
| 1012 renderer_scheduler_->SuspendTimerQueue(); | 998 renderer_scheduler_->SuspendTimerQueue(); |
| 1013 | 999 |
| 1014 if (notify_webkit_of_modal_loop) | 1000 if (notify_webkit_of_modal_loop) |
| 1015 WebView::willEnterModalLoop(); | 1001 WebView::willEnterModalLoop(); |
| 1016 #if defined(ENABLE_PLUGINS) | |
| 1017 RenderViewImpl* render_view = | |
| 1018 RenderViewImpl::FromRoutingID(msg->routing_id()); | |
| 1019 if (render_view) { | |
| 1020 render_view_id = msg->routing_id(); | |
| 1021 PluginChannelHost::Broadcast( | |
| 1022 new PluginMsg_SignalModalDialogEvent(render_view_id)); | |
| 1023 } | |
| 1024 #endif | |
| 1025 } | 1002 } |
| 1026 | 1003 |
| 1027 bool rv = ChildThreadImpl::Send(msg); | 1004 bool rv = ChildThreadImpl::Send(msg); |
| 1028 | 1005 |
| 1029 if (pumping_events) { | 1006 if (pumping_events) { |
| 1030 #if defined(ENABLE_PLUGINS) | |
| 1031 if (render_view_id != MSG_ROUTING_NONE) { | |
| 1032 PluginChannelHost::Broadcast( | |
| 1033 new PluginMsg_ResetModalDialogEvent(render_view_id)); | |
| 1034 } | |
| 1035 #endif | |
| 1036 | |
| 1037 if (notify_webkit_of_modal_loop) | 1007 if (notify_webkit_of_modal_loop) |
| 1038 WebView::didExitModalLoop(); | 1008 WebView::didExitModalLoop(); |
| 1039 | 1009 |
| 1040 renderer_scheduler_->ResumeTimerQueue(); | 1010 renderer_scheduler_->ResumeTimerQueue(); |
| 1041 } | 1011 } |
| 1042 | 1012 |
| 1043 return rv; | 1013 return rv; |
| 1044 } | 1014 } |
| 1045 | 1015 |
| 1046 IPC::SyncChannel* RenderThreadImpl::GetChannel() { | 1016 IPC::SyncChannel* RenderThreadImpl::GetChannel() { |
| (...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2174 } | 2144 } |
| 2175 | 2145 |
| 2176 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 2146 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
| 2177 size_t erased = | 2147 size_t erased = |
| 2178 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 2148 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
| 2179 routing_id_); | 2149 routing_id_); |
| 2180 DCHECK_EQ(1u, erased); | 2150 DCHECK_EQ(1u, erased); |
| 2181 } | 2151 } |
| 2182 | 2152 |
| 2183 } // namespace content | 2153 } // namespace content |
| OLD | NEW |