| 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_manager.h" | 5 #include "content/browser/frame_host/render_frame_host_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 pending_nav_params_.reset(new PendingNavigationParams( | 341 pending_nav_params_.reset(new PendingNavigationParams( |
| 342 global_request_id, cross_site_transferring_request.Pass(), | 342 global_request_id, cross_site_transferring_request.Pass(), |
| 343 transfer_url_chain, referrer, page_transition, | 343 transfer_url_chain, referrer, page_transition, |
| 344 pending_render_frame_host->GetRoutingID(), | 344 pending_render_frame_host->GetRoutingID(), |
| 345 should_replace_current_entry)); | 345 should_replace_current_entry)); |
| 346 | 346 |
| 347 // Run the unload handler of the current page. | 347 // Run the unload handler of the current page. |
| 348 SwapOutOldPage(); | 348 SwapOutOldPage(); |
| 349 } | 349 } |
| 350 | 350 |
| 351 void RenderFrameHostManager::OnDeferredAfterResponseStarted( |
| 352 const GlobalRequestID& global_request_id, |
| 353 RenderFrameHostImpl* pending_render_frame_host) { |
| 354 DCHECK(!response_started_id_.get()); |
| 355 |
| 356 response_started_id_.reset(new GlobalRequestID(global_request_id)); |
| 357 } |
| 358 |
| 359 void RenderFrameHostManager::ResumeResponseDeferredAtStart() { |
| 360 DCHECK(response_started_id_.get()); |
| 361 |
| 362 RenderProcessHostImpl* process = |
| 363 static_cast<RenderProcessHostImpl*>(render_frame_host_->GetProcess()); |
| 364 process->ResumeResponseDeferredAtStart(*response_started_id_); |
| 365 |
| 366 render_frame_host_->SetHasPendingTransitionRequest(false); |
| 367 |
| 368 response_started_id_.reset(); |
| 369 } |
| 370 |
| 351 void RenderFrameHostManager::SwappedOut( | 371 void RenderFrameHostManager::SwappedOut( |
| 352 RenderFrameHostImpl* render_frame_host) { | 372 RenderFrameHostImpl* render_frame_host) { |
| 353 // Make sure this is from our current RFH, and that we have a pending | 373 // Make sure this is from our current RFH, and that we have a pending |
| 354 // navigation from OnCrossSiteResponse. (There may be no pending navigation | 374 // navigation from OnCrossSiteResponse. (There may be no pending navigation |
| 355 // for data URLs that don't make network requests, for example.) If not, | 375 // for data URLs that don't make network requests, for example.) If not, |
| 356 // just return early and ignore. | 376 // just return early and ignore. |
| 357 if (render_frame_host != render_frame_host_ || !pending_nav_params_.get()) { | 377 if (render_frame_host != render_frame_host_ || !pending_nav_params_.get()) { |
| 358 pending_nav_params_.reset(); | 378 pending_nav_params_.reset(); |
| 359 return; | 379 return; |
| 360 } | 380 } |
| (...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 SiteInstance* instance) const { | 1490 SiteInstance* instance) const { |
| 1471 RenderFrameProxyHostMap::const_iterator iter = | 1491 RenderFrameProxyHostMap::const_iterator iter = |
| 1472 proxy_hosts_.find(instance->GetId()); | 1492 proxy_hosts_.find(instance->GetId()); |
| 1473 if (iter != proxy_hosts_.end()) | 1493 if (iter != proxy_hosts_.end()) |
| 1474 return iter->second; | 1494 return iter->second; |
| 1475 | 1495 |
| 1476 return NULL; | 1496 return NULL; |
| 1477 } | 1497 } |
| 1478 | 1498 |
| 1479 } // namespace content | 1499 } // namespace content |
| OLD | NEW |