| 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::SetHasPendingTransitionRequest( |
| 360 bool has_pending_transition) { |
| 361 render_frame_host_->SetHasPendingTransitionRequest(has_pending_transition); |
| 362 } |
| 363 |
| 364 void RenderFrameHostManager::ResumeResponseDeferredAtStart() { |
| 365 DCHECK(response_started_id_.get()); |
| 366 |
| 367 RenderProcessHostImpl* process = |
| 368 static_cast<RenderProcessHostImpl*>(render_frame_host_->GetProcess()); |
| 369 process->ResumeResponseDeferredAtStart(*response_started_id_); |
| 370 |
| 371 render_frame_host_->SetHasPendingTransitionRequest(false); |
| 372 |
| 373 response_started_id_.reset(); |
| 374 } |
| 375 |
| 351 void RenderFrameHostManager::SwappedOut( | 376 void RenderFrameHostManager::SwappedOut( |
| 352 RenderFrameHostImpl* render_frame_host) { | 377 RenderFrameHostImpl* render_frame_host) { |
| 353 // Make sure this is from our current RFH, and that we have a pending | 378 // Make sure this is from our current RFH, and that we have a pending |
| 354 // navigation from OnCrossSiteResponse. (There may be no pending navigation | 379 // navigation from OnCrossSiteResponse. (There may be no pending navigation |
| 355 // for data URLs that don't make network requests, for example.) If not, | 380 // for data URLs that don't make network requests, for example.) If not, |
| 356 // just return early and ignore. | 381 // just return early and ignore. |
| 357 if (render_frame_host != render_frame_host_ || !pending_nav_params_.get()) { | 382 if (render_frame_host != render_frame_host_ || !pending_nav_params_.get()) { |
| 358 pending_nav_params_.reset(); | 383 pending_nav_params_.reset(); |
| 359 return; | 384 return; |
| 360 } | 385 } |
| (...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 SiteInstance* instance) const { | 1495 SiteInstance* instance) const { |
| 1471 RenderFrameProxyHostMap::const_iterator iter = | 1496 RenderFrameProxyHostMap::const_iterator iter = |
| 1472 proxy_hosts_.find(instance->GetId()); | 1497 proxy_hosts_.find(instance->GetId()); |
| 1473 if (iter != proxy_hosts_.end()) | 1498 if (iter != proxy_hosts_.end()) |
| 1474 return iter->second; | 1499 return iter->second; |
| 1475 | 1500 |
| 1476 return NULL; | 1501 return NULL; |
| 1477 } | 1502 } |
| 1478 | 1503 |
| 1479 } // namespace content | 1504 } // namespace content |
| OLD | NEW |