Chromium Code Reviews| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 const std::vector<base::FilePath>& file_paths) { | 191 const std::vector<base::FilePath>& file_paths) { |
| 192 ChildProcessSecurityPolicyImpl* policy = | 192 ChildProcessSecurityPolicyImpl* policy = |
| 193 ChildProcessSecurityPolicyImpl::GetInstance(); | 193 ChildProcessSecurityPolicyImpl::GetInstance(); |
| 194 | 194 |
| 195 for (const auto& file : file_paths) { | 195 for (const auto& file : file_paths) { |
| 196 if (!policy->CanReadFile(child_id, file)) | 196 if (!policy->CanReadFile(child_id, file)) |
| 197 policy->GrantReadFile(child_id, file); | 197 policy->GrantReadFile(child_id, file); |
| 198 } | 198 } |
| 199 } | 199 } |
| 200 | 200 |
| 201 void NotifyRenderFrameDetachedOnIO(int render_process_id, int render_frame_id) { | 201 void NotifyRenderFrameDetachedOnIO(int render_process_id, |
| 202 int render_frame_id, | |
| 203 GlobalRequestID transfer_request_id) { | |
| 202 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 204 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 203 SharedWorkerServiceImpl::GetInstance()->RenderFrameDetached(render_process_id, | 205 SharedWorkerServiceImpl::GetInstance()->RenderFrameDetached(render_process_id, |
| 204 render_frame_id); | 206 render_frame_id); |
| 207 if (transfer_request_id.child_id != -1) { | |
|
Charlie Reis
2016/11/18 04:52:24
Let's add a comment saying that we need to clean u
| |
| 208 ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get(); | |
| 209 DCHECK(rdh); | |
| 210 rdh->CancelRequest(transfer_request_id.child_id, | |
| 211 transfer_request_id.request_id); | |
| 212 } | |
| 205 } | 213 } |
| 206 | 214 |
| 207 } // namespace | 215 } // namespace |
| 208 | 216 |
| 209 // static | 217 // static |
| 210 RenderFrameHost* RenderFrameHost::FromID(int render_process_id, | 218 RenderFrameHost* RenderFrameHost::FromID(int render_process_id, |
| 211 int render_frame_id) { | 219 int render_frame_id) { |
| 212 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id); | 220 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id); |
| 213 } | 221 } |
| 214 | 222 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 348 } | 356 } |
| 349 | 357 |
| 350 RenderFrameHostImpl::~RenderFrameHostImpl() { | 358 RenderFrameHostImpl::~RenderFrameHostImpl() { |
| 351 // Release the WebUI instances before all else as the WebUI may accesses the | 359 // Release the WebUI instances before all else as the WebUI may accesses the |
| 352 // RenderFrameHost during cleanup. | 360 // RenderFrameHost during cleanup. |
| 353 ClearAllWebUI(); | 361 ClearAllWebUI(); |
| 354 | 362 |
| 355 GetProcess()->RemoveRoute(routing_id_); | 363 GetProcess()->RemoveRoute(routing_id_); |
| 356 g_routing_id_frame_map.Get().erase( | 364 g_routing_id_frame_map.Get().erase( |
| 357 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); | 365 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); |
| 366 | |
| 367 GlobalRequestID transfer_navigation_id; | |
| 368 if (navigation_handle_ && navigation_handle_->is_transferring()) { | |
| 369 transfer_navigation_id = navigation_handle_->GetGlobalRequestID(); | |
| 370 } | |
| 358 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 371 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 359 base::Bind(&NotifyRenderFrameDetachedOnIO, | 372 base::Bind(&NotifyRenderFrameDetachedOnIO, |
| 360 GetProcess()->GetID(), routing_id_)); | 373 GetProcess()->GetID(), routing_id_, |
| 374 transfer_navigation_id)); | |
| 361 | 375 |
| 362 site_instance_->RemoveObserver(this); | 376 site_instance_->RemoveObserver(this); |
| 363 | 377 |
| 364 if (delegate_ && render_frame_created_) | 378 if (delegate_ && render_frame_created_) |
| 365 delegate_->RenderFrameDeleted(this); | 379 delegate_->RenderFrameDeleted(this); |
| 366 | 380 |
| 367 // If this was the last active frame in the SiteInstance, the | 381 // If this was the last active frame in the SiteInstance, the |
| 368 // DecrementActiveFrameCount call will trigger the deletion of the | 382 // DecrementActiveFrameCount call will trigger the deletion of the |
| 369 // SiteInstance's proxies. | 383 // SiteInstance's proxies. |
| 370 GetSiteInstance()->DecrementActiveFrameCount(); | 384 GetSiteInstance()->DecrementActiveFrameCount(); |
| (...skipping 2890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3261 // There is no pending NavigationEntry in these cases, so pass 0 as the | 3275 // There is no pending NavigationEntry in these cases, so pass 0 as the |
| 3262 // pending_nav_entry_id. If the previous handle was a prematurely aborted | 3276 // pending_nav_entry_id. If the previous handle was a prematurely aborted |
| 3263 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. | 3277 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. |
| 3264 return NavigationHandleImpl::Create( | 3278 return NavigationHandleImpl::Create( |
| 3265 params.url, frame_tree_node_, is_renderer_initiated, | 3279 params.url, frame_tree_node_, is_renderer_initiated, |
| 3266 params.was_within_same_page, params.is_srcdoc, base::TimeTicks::Now(), | 3280 params.was_within_same_page, params.is_srcdoc, base::TimeTicks::Now(), |
| 3267 entry_id_for_data_nav, false); // started_from_context_menu | 3281 entry_id_for_data_nav, false); // started_from_context_menu |
| 3268 } | 3282 } |
| 3269 | 3283 |
| 3270 } // namespace content | 3284 } // namespace content |
| OLD | NEW |