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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
411 render_frame_host_->ClearPendingTransitionRequestData(); | 411 render_frame_host_->ClearPendingTransitionRequestData(); |
412 | 412 |
413 response_started_id_.reset(); | 413 response_started_id_.reset(); |
414 } | 414 } |
415 | 415 |
416 void RenderFrameHostManager::ClearNavigationTransitionData() { | 416 void RenderFrameHostManager::ClearNavigationTransitionData() { |
417 render_frame_host_->ClearPendingTransitionRequestData(); | 417 render_frame_host_->ClearPendingTransitionRequestData(); |
418 } | 418 } |
419 | 419 |
420 void RenderFrameHostManager::DidNavigateFrame( | 420 void RenderFrameHostManager::DidNavigateFrame( |
421 RenderFrameHostImpl* render_frame_host) { | 421 RenderFrameHostImpl* render_frame_host, |
422 bool was_caused_by_user_gesture) { | |
422 if (!cross_navigation_pending_) { | 423 if (!cross_navigation_pending_) { |
423 DCHECK(!pending_render_frame_host_); | 424 DCHECK(!pending_render_frame_host_); |
424 | 425 |
425 // We should only hear this from our current renderer. | 426 // We should only hear this from our current renderer. |
426 DCHECK_EQ(render_frame_host_, render_frame_host); | 427 DCHECK_EQ(render_frame_host_, render_frame_host); |
427 | 428 |
428 // Even when there is no pending RVH, there may be a pending Web UI. | 429 // Even when there is no pending RVH, there may be a pending Web UI. |
429 if (pending_web_ui()) | 430 if (pending_web_ui()) |
430 CommitPending(); | 431 CommitPending(); |
431 return; | 432 return; |
432 } | 433 } |
433 | 434 |
434 if (render_frame_host == pending_render_frame_host_) { | 435 if (render_frame_host == pending_render_frame_host_) { |
435 // The pending cross-site navigation completed, so show the renderer. | 436 // The pending cross-site navigation completed, so show the renderer. |
436 CommitPending(); | 437 CommitPending(); |
437 cross_navigation_pending_ = false; | 438 cross_navigation_pending_ = false; |
438 } else if (render_frame_host == render_frame_host_) { | 439 } else if (render_frame_host == render_frame_host_ && |
440 was_caused_by_user_gesture) { | |
439 // A navigation in the original page has taken place. Cancel the pending | 441 // A navigation in the original page has taken place. Cancel the pending |
440 // one. | 442 // one. |
Charlie Reis
2014/12/03 21:32:19
Let's update this comment: "Cancel the pending one
| |
441 CancelPending(); | 443 CancelPending(); |
442 cross_navigation_pending_ = false; | 444 cross_navigation_pending_ = false; |
443 } else { | 445 } else { |
444 // No one else should be sending us DidNavigate in this state. | 446 // No one else should be sending us DidNavigate in this state. |
445 DCHECK(false); | 447 DCHECK(!was_caused_by_user_gesture); |
Charlie Reis
2014/12/03 21:32:19
This is confusing, since the DCHECK and comment ar
| |
446 } | 448 } |
447 } | 449 } |
448 | 450 |
449 void RenderFrameHostManager::DidDisownOpener( | 451 void RenderFrameHostManager::DidDisownOpener( |
450 RenderFrameHost* render_frame_host) { | 452 RenderFrameHost* render_frame_host) { |
451 // Notify all RenderFrameHosts but the one that notified us. This is necessary | 453 // Notify all RenderFrameHosts but the one that notified us. This is necessary |
452 // in case a process swap has occurred while the message was in flight. | 454 // in case a process swap has occurred while the message was in flight. |
453 for (RenderFrameProxyHostMap::iterator iter = proxy_hosts_.begin(); | 455 for (RenderFrameProxyHostMap::iterator iter = proxy_hosts_.begin(); |
454 iter != proxy_hosts_.end(); | 456 iter != proxy_hosts_.end(); |
455 ++iter) { | 457 ++iter) { |
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1674 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 1676 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
1675 SiteInstance* instance) { | 1677 SiteInstance* instance) { |
1676 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 1678 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
1677 if (iter != proxy_hosts_.end()) { | 1679 if (iter != proxy_hosts_.end()) { |
1678 delete iter->second; | 1680 delete iter->second; |
1679 proxy_hosts_.erase(iter); | 1681 proxy_hosts_.erase(iter); |
1680 } | 1682 } |
1681 } | 1683 } |
1682 | 1684 |
1683 } // namespace content | 1685 } // namespace content |
OLD | NEW |