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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 const std::vector<base::FilePath>& file_paths) { | 173 const std::vector<base::FilePath>& file_paths) { |
173 ChildProcessSecurityPolicyImpl* policy = | 174 ChildProcessSecurityPolicyImpl* policy = |
174 ChildProcessSecurityPolicyImpl::GetInstance(); | 175 ChildProcessSecurityPolicyImpl::GetInstance(); |
175 | 176 |
176 for (const auto& file : file_paths) { | 177 for (const auto& file : file_paths) { |
177 if (!policy->CanReadFile(child_id, file)) | 178 if (!policy->CanReadFile(child_id, file)) |
178 policy->GrantReadFile(child_id, file); | 179 policy->GrantReadFile(child_id, file); |
179 } | 180 } |
180 } | 181 } |
181 | 182 |
| 183 void NotifyRenderFrameDetachedOnIO(int render_process_id, int render_frame_id) { |
| 184 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 185 SharedWorkerServiceImpl::GetInstance()->RenderFrameDetached(render_process_id, |
| 186 render_frame_id); |
| 187 } |
| 188 |
182 } // namespace | 189 } // namespace |
183 | 190 |
184 // static | 191 // static |
185 RenderFrameHost* RenderFrameHost::FromID(int render_process_id, | 192 RenderFrameHost* RenderFrameHost::FromID(int render_process_id, |
186 int render_frame_id) { | 193 int render_frame_id) { |
187 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id); | 194 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id); |
188 } | 195 } |
189 | 196 |
190 #if defined(OS_ANDROID) | 197 #if defined(OS_ANDROID) |
191 // static | 198 // static |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 } | 309 } |
303 | 310 |
304 RenderFrameHostImpl::~RenderFrameHostImpl() { | 311 RenderFrameHostImpl::~RenderFrameHostImpl() { |
305 // Release the WebUI instances before all else as the WebUI may accesses the | 312 // Release the WebUI instances before all else as the WebUI may accesses the |
306 // RenderFrameHost during cleanup. | 313 // RenderFrameHost during cleanup. |
307 ClearAllWebUI(); | 314 ClearAllWebUI(); |
308 | 315 |
309 GetProcess()->RemoveRoute(routing_id_); | 316 GetProcess()->RemoveRoute(routing_id_); |
310 g_routing_id_frame_map.Get().erase( | 317 g_routing_id_frame_map.Get().erase( |
311 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); | 318 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); |
| 319 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 320 base::Bind(&NotifyRenderFrameDetachedOnIO, |
| 321 GetProcess()->GetID(), routing_id_)); |
312 | 322 |
313 site_instance_->RemoveObserver(this); | 323 site_instance_->RemoveObserver(this); |
314 | 324 |
315 if (delegate_ && render_frame_created_) | 325 if (delegate_ && render_frame_created_) |
316 delegate_->RenderFrameDeleted(this); | 326 delegate_->RenderFrameDeleted(this); |
317 | 327 |
318 // If this was the last active frame in the SiteInstance, the | 328 // If this was the last active frame in the SiteInstance, the |
319 // DecrementActiveFrameCount call will trigger the deletion of the | 329 // DecrementActiveFrameCount call will trigger the deletion of the |
320 // SiteInstance's proxies. | 330 // SiteInstance's proxies. |
321 GetSiteInstance()->DecrementActiveFrameCount(); | 331 GetSiteInstance()->DecrementActiveFrameCount(); |
(...skipping 2724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3046 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 3056 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
3047 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 3057 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
3048 return web_bluetooth_service_.get(); | 3058 return web_bluetooth_service_.get(); |
3049 } | 3059 } |
3050 | 3060 |
3051 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 3061 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
3052 web_bluetooth_service_.reset(); | 3062 web_bluetooth_service_.reset(); |
3053 } | 3063 } |
3054 | 3064 |
3055 } // namespace content | 3065 } // namespace content |
OLD | NEW |