OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 #include "content/browser/presentation/presentation_service_impl.h" | 41 #include "content/browser/presentation/presentation_service_impl.h" |
42 #include "content/browser/renderer_host/input/input_router_impl.h" | 42 #include "content/browser/renderer_host/input/input_router_impl.h" |
43 #include "content/browser/renderer_host/input/timeout_monitor.h" | 43 #include "content/browser/renderer_host/input/timeout_monitor.h" |
44 #include "content/browser/renderer_host/render_process_host_impl.h" | 44 #include "content/browser/renderer_host/render_process_host_impl.h" |
45 #include "content/browser/renderer_host/render_view_host_delegate.h" | 45 #include "content/browser/renderer_host/render_view_host_delegate.h" |
46 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 46 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
47 #include "content/browser/renderer_host/render_view_host_impl.h" | 47 #include "content/browser/renderer_host/render_view_host_impl.h" |
48 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 48 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
49 #include "content/browser/renderer_host/render_widget_host_impl.h" | 49 #include "content/browser/renderer_host/render_widget_host_impl.h" |
50 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 50 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 51 #include "content/browser/shared_worker/shared_worker_service_impl.h" |
51 #include "content/browser/wake_lock/wake_lock_service_context.h" | 52 #include "content/browser/wake_lock/wake_lock_service_context.h" |
52 #include "content/browser/websockets/websocket_manager.h" | 53 #include "content/browser/websockets/websocket_manager.h" |
53 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 54 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
54 #include "content/common/accessibility_messages.h" | 55 #include "content/common/accessibility_messages.h" |
55 #include "content/common/frame_messages.h" | 56 #include "content/common/frame_messages.h" |
56 #include "content/common/frame_owner_properties.h" | 57 #include "content/common/frame_owner_properties.h" |
57 #include "content/common/input_messages.h" | 58 #include "content/common/input_messages.h" |
58 #include "content/common/inter_process_time_ticks_converter.h" | 59 #include "content/common/inter_process_time_ticks_converter.h" |
59 #include "content/common/navigation_params.h" | 60 #include "content/common/navigation_params.h" |
60 #include "content/common/site_isolation_policy.h" | 61 #include "content/common/site_isolation_policy.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 const std::vector<base::FilePath>& file_paths) { | 172 const std::vector<base::FilePath>& file_paths) { |
172 ChildProcessSecurityPolicyImpl* policy = | 173 ChildProcessSecurityPolicyImpl* policy = |
173 ChildProcessSecurityPolicyImpl::GetInstance(); | 174 ChildProcessSecurityPolicyImpl::GetInstance(); |
174 | 175 |
175 for (const auto& file : file_paths) { | 176 for (const auto& file : file_paths) { |
176 if (!policy->CanReadFile(child_id, file)) | 177 if (!policy->CanReadFile(child_id, file)) |
177 policy->GrantReadFile(child_id, file); | 178 policy->GrantReadFile(child_id, file); |
178 } | 179 } |
179 } | 180 } |
180 | 181 |
| 182 void NotifyRenderFrameDetachedOnIO(int render_process_id, int render_frame_id) { |
| 183 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 184 SharedWorkerServiceImpl::GetInstance()->RenderFrameDetached(render_process_id, |
| 185 render_frame_id); |
| 186 } |
| 187 |
181 } // namespace | 188 } // namespace |
182 | 189 |
183 // static | 190 // static |
184 RenderFrameHost* RenderFrameHost::FromID(int render_process_id, | 191 RenderFrameHost* RenderFrameHost::FromID(int render_process_id, |
185 int render_frame_id) { | 192 int render_frame_id) { |
186 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id); | 193 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id); |
187 } | 194 } |
188 | 195 |
189 #if defined(OS_ANDROID) | 196 #if defined(OS_ANDROID) |
190 // static | 197 // static |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 } | 308 } |
302 | 309 |
303 RenderFrameHostImpl::~RenderFrameHostImpl() { | 310 RenderFrameHostImpl::~RenderFrameHostImpl() { |
304 // Release the WebUI instances before all else as the WebUI may accesses the | 311 // Release the WebUI instances before all else as the WebUI may accesses the |
305 // RenderFrameHost during cleanup. | 312 // RenderFrameHost during cleanup. |
306 ClearAllWebUI(); | 313 ClearAllWebUI(); |
307 | 314 |
308 GetProcess()->RemoveRoute(routing_id_); | 315 GetProcess()->RemoveRoute(routing_id_); |
309 g_routing_id_frame_map.Get().erase( | 316 g_routing_id_frame_map.Get().erase( |
310 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); | 317 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); |
| 318 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 319 base::Bind(&NotifyRenderFrameDetachedOnIO, |
| 320 GetProcess()->GetID(), routing_id_)); |
311 | 321 |
312 site_instance_->RemoveObserver(this); | 322 site_instance_->RemoveObserver(this); |
313 | 323 |
314 if (delegate_ && render_frame_created_) | 324 if (delegate_ && render_frame_created_) |
315 delegate_->RenderFrameDeleted(this); | 325 delegate_->RenderFrameDeleted(this); |
316 | 326 |
317 // If this was the last active frame in the SiteInstance, the | 327 // If this was the last active frame in the SiteInstance, the |
318 // DecrementActiveFrameCount call will trigger the deletion of the | 328 // DecrementActiveFrameCount call will trigger the deletion of the |
319 // SiteInstance's proxies. | 329 // SiteInstance's proxies. |
320 GetSiteInstance()->DecrementActiveFrameCount(); | 330 GetSiteInstance()->DecrementActiveFrameCount(); |
(...skipping 2723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3044 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 3054 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
3045 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 3055 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
3046 return web_bluetooth_service_.get(); | 3056 return web_bluetooth_service_.get(); |
3047 } | 3057 } |
3048 | 3058 |
3049 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 3059 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
3050 web_bluetooth_service_.reset(); | 3060 web_bluetooth_service_.reset(); |
3051 } | 3061 } |
3052 | 3062 |
3053 } // namespace content | 3063 } // namespace content |
OLD | NEW |