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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
564 params.url : frame_tree_node_->frame_tree()->root()->current_url(); | 564 params.url : frame_tree_node_->frame_tree()->root()->current_url(); |
565 info.is_main_frame = frame_tree_node_->IsMainFrame(); | 565 info.is_main_frame = frame_tree_node_->IsMainFrame(); |
566 info.parent_is_main_frame = !frame_tree_node_->parent() ? | 566 info.parent_is_main_frame = !frame_tree_node_->parent() ? |
567 false : frame_tree_node_->parent()->IsMainFrame(); | 567 false : frame_tree_node_->parent()->IsMainFrame(); |
568 info.is_showing = GetRenderWidgetHostView()->IsShowing(); | 568 info.is_showing = GetRenderWidgetHostView()->IsShowing(); |
569 | 569 |
570 // TODO(clamy): Check if the current RFH should be initialized (in case it has | 570 // TODO(clamy): Check if the current RFH should be initialized (in case it has |
571 // crashed) not to display a sad tab while navigating. | 571 // crashed) not to display a sad tab while navigating. |
572 // TODO(clamy): Spawn a speculative renderer process if we do not have one to | 572 // TODO(clamy): Spawn a speculative renderer process if we do not have one to |
573 // use for the navigation. | 573 // use for the navigation. |
574 navigation_request_.reset(new NavigationRequest( | 574 navigation_request_.reset(new NavigationRequest( |
nasko
2014/08/21 21:53:44
nit: I'd add a comment here to say that deleting t
carlosk
2014/08/22 13:43:03
Comment added.
But note that right now we're "ca
nasko
2014/08/22 14:00:34
If the navigation was committed, I would expect th
carlosk
2014/08/22 16:54:41
I did talk with clamy about this specific thing an
| |
575 info, frame_tree_node_->frame_tree_node_id())); | 575 info, frame_tree_node_->frame_tree_node_id())); |
576 navigation_request_->BeginNavigation(params.request_body); | 576 navigation_request_->BeginNavigation(params.request_body); |
577 } | 577 } |
578 | 578 |
579 // PlzNavigate | 579 // PlzNavigate |
580 void RenderFrameHostManager::CommitNavigation( | 580 void RenderFrameHostManager::CommitNavigation( |
581 const NavigationBeforeCommitInfo& info) { | 581 const NavigationBeforeCommitInfo& info) { |
582 CHECK(CommandLine::ForCurrentProcess()->HasSwitch( | 582 CHECK(CommandLine::ForCurrentProcess()->HasSwitch( |
583 switches::kEnableBrowserSideNavigation)); | 583 switches::kEnableBrowserSideNavigation)); |
584 DCHECK(navigation_request_.get()); | |
585 // Ignores navigation commits if the request ID doesn't match the current | |
586 // active request. | |
587 if (navigation_request_->navigation_request_id() != | |
588 info.navigation_request_id) { | |
589 return; | |
590 } | |
591 | |
584 // Pick the right RenderFrameHost to commit the navigation. | 592 // Pick the right RenderFrameHost to commit the navigation. |
585 SiteInstance* current_instance = render_frame_host_->GetSiteInstance(); | 593 SiteInstance* current_instance = render_frame_host_->GetSiteInstance(); |
586 // TODO(clamy): Replace the default values by the right ones. This may require | 594 // TODO(clamy): Replace the default values by the right ones. This may require |
587 // some storing in RequestNavigation. | 595 // some storing in RequestNavigation. |
588 SiteInstance* new_instance = GetSiteInstanceForNavigation( | 596 SiteInstance* new_instance = GetSiteInstanceForNavigation( |
589 info.navigation_url, | 597 info.navigation_url, |
590 NULL, | 598 NULL, |
591 navigation_request_->info().navigation_params.transition_type, | 599 navigation_request_->info().navigation_params.transition_type, |
592 false, | 600 false, |
593 false); | 601 false); |
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1650 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 1658 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
1651 SiteInstance* instance) { | 1659 SiteInstance* instance) { |
1652 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 1660 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
1653 if (iter != proxy_hosts_.end()) { | 1661 if (iter != proxy_hosts_.end()) { |
1654 delete iter->second; | 1662 delete iter->second; |
1655 proxy_hosts_.erase(iter); | 1663 proxy_hosts_.erase(iter); |
1656 } | 1664 } |
1657 } | 1665 } |
1658 | 1666 |
1659 } // namespace content | 1667 } // namespace content |
OLD | NEW |