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/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 586 const Referrer& referrer, | 586 const Referrer& referrer, |
| 587 WindowOpenDisposition disposition, | 587 WindowOpenDisposition disposition, |
| 588 bool should_replace_current_entry, | 588 bool should_replace_current_entry, |
| 589 bool user_gesture) { | 589 bool user_gesture) { |
| 590 // This call only makes sense for subframes if OOPIFs are possible. | 590 // This call only makes sense for subframes if OOPIFs are possible. |
| 591 DCHECK(!render_frame_host->GetParent() || | 591 DCHECK(!render_frame_host->GetParent() || |
| 592 SiteIsolationPolicy::AreCrossProcessFramesPossible()); | 592 SiteIsolationPolicy::AreCrossProcessFramesPossible()); |
| 593 | 593 |
| 594 // If this came from a swapped out RenderFrameHost, we only allow the request | 594 // If this came from a swapped out RenderFrameHost, we only allow the request |
| 595 // if we are still in the same BrowsingInstance. | 595 // if we are still in the same BrowsingInstance. |
| 596 // TODO(creis): Move this to RenderFrameProxyHost::OpenURL. | |
|
alexmos
2016/02/20 02:42:47
I'm assuming this check will have to stay in addit
Charlie Reis
2016/02/21 05:47:23
Sure, we can remove it when Nasko removes the rest
| |
| 597 SiteInstance* current_site_instance = render_frame_host->frame_tree_node() | 596 SiteInstance* current_site_instance = render_frame_host->frame_tree_node() |
| 598 ->current_frame_host() | 597 ->current_frame_host() |
| 599 ->GetSiteInstance(); | 598 ->GetSiteInstance(); |
| 600 if (render_frame_host->is_swapped_out() && | 599 if (render_frame_host->is_swapped_out() && |
| 601 !render_frame_host->GetSiteInstance()->IsRelatedSiteInstance( | 600 !render_frame_host->GetSiteInstance()->IsRelatedSiteInstance( |
| 602 current_site_instance)) { | 601 current_site_instance)) { |
| 603 return; | 602 return; |
| 604 } | 603 } |
| 605 | 604 |
| 606 // TODO(creis): Pass the redirect_chain into this method to support client | 605 // TODO(creis): Pass the redirect_chain into this method to support client |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 652 params.is_renderer_initiated = false; | 651 params.is_renderer_initiated = false; |
| 653 } | 652 } |
| 654 | 653 |
| 655 if (delegate_) | 654 if (delegate_) |
| 656 delegate_->RequestOpenURL(render_frame_host, params); | 655 delegate_->RequestOpenURL(render_frame_host, params); |
| 657 } | 656 } |
| 658 | 657 |
| 659 void NavigatorImpl::RequestTransferURL( | 658 void NavigatorImpl::RequestTransferURL( |
| 660 RenderFrameHostImpl* render_frame_host, | 659 RenderFrameHostImpl* render_frame_host, |
| 661 const GURL& url, | 660 const GURL& url, |
| 661 SiteInstance* source_site_instance, | |
| 662 const std::vector<GURL>& redirect_chain, | 662 const std::vector<GURL>& redirect_chain, |
| 663 const Referrer& referrer, | 663 const Referrer& referrer, |
| 664 ui::PageTransition page_transition, | 664 ui::PageTransition page_transition, |
| 665 const GlobalRequestID& transferred_global_request_id, | 665 const GlobalRequestID& transferred_global_request_id, |
| 666 bool should_replace_current_entry) { | 666 bool should_replace_current_entry) { |
| 667 // This call only makes sense for subframes if OOPIFs are possible. | 667 // This call only makes sense for subframes if OOPIFs are possible. |
| 668 DCHECK(!render_frame_host->GetParent() || | 668 DCHECK(!render_frame_host->GetParent() || |
| 669 SiteIsolationPolicy::AreCrossProcessFramesPossible()); | 669 SiteIsolationPolicy::AreCrossProcessFramesPossible()); |
| 670 | 670 |
| 671 // Allow the delegate to cancel the transfer. | 671 // Allow the delegate to cancel the transfer. |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 696 // want web sites to see a referrer of "chrome://blah" (and some | 696 // want web sites to see a referrer of "chrome://blah" (and some |
| 697 // chrome: URLs might have search terms or other stuff we don't want to | 697 // chrome: URLs might have search terms or other stuff we don't want to |
| 698 // send to the site), so we send no referrer. | 698 // send to the site), so we send no referrer. |
| 699 referrer_to_use = Referrer(); | 699 referrer_to_use = Referrer(); |
| 700 | 700 |
| 701 // Navigations in Web UI pages count as browser-initiated navigations. | 701 // Navigations in Web UI pages count as browser-initiated navigations. |
| 702 is_renderer_initiated = false; | 702 is_renderer_initiated = false; |
| 703 } | 703 } |
| 704 | 704 |
| 705 NavigationController::LoadURLParams load_url_params(dest_url); | 705 NavigationController::LoadURLParams load_url_params(dest_url); |
| 706 // The source_site_instance only matters for navigations via RenderFrameProxy, | 706 // The source_site_instance may matter for navigations via RenderFrameProxy. |
| 707 // which go through RequestOpenURL. | 707 load_url_params.source_site_instance = source_site_instance; |
| 708 load_url_params.source_site_instance = nullptr; | |
| 709 load_url_params.transition_type = page_transition; | 708 load_url_params.transition_type = page_transition; |
| 710 load_url_params.frame_tree_node_id = node->frame_tree_node_id(); | 709 load_url_params.frame_tree_node_id = node->frame_tree_node_id(); |
| 711 load_url_params.referrer = referrer_to_use; | 710 load_url_params.referrer = referrer_to_use; |
| 712 load_url_params.redirect_chain = redirect_chain; | 711 load_url_params.redirect_chain = redirect_chain; |
| 713 load_url_params.is_renderer_initiated = is_renderer_initiated; | 712 load_url_params.is_renderer_initiated = is_renderer_initiated; |
| 714 load_url_params.transferred_global_request_id = transferred_global_request_id; | 713 load_url_params.transferred_global_request_id = transferred_global_request_id; |
| 715 load_url_params.should_replace_current_entry = should_replace_current_entry; | 714 load_url_params.should_replace_current_entry = should_replace_current_entry; |
| 716 | 715 |
| 717 controller_->LoadURLWithParams(load_url_params); | 716 controller_->LoadURLWithParams(load_url_params); |
| 718 } | 717 } |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1038 entry->set_should_replace_entry(pending_entry->should_replace_entry()); | 1037 entry->set_should_replace_entry(pending_entry->should_replace_entry()); |
| 1039 entry->SetRedirectChain(pending_entry->GetRedirectChain()); | 1038 entry->SetRedirectChain(pending_entry->GetRedirectChain()); |
| 1040 } | 1039 } |
| 1041 controller_->SetPendingEntry(std::move(entry)); | 1040 controller_->SetPendingEntry(std::move(entry)); |
| 1042 if (delegate_) | 1041 if (delegate_) |
| 1043 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 1042 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
| 1044 } | 1043 } |
| 1045 } | 1044 } |
| 1046 | 1045 |
| 1047 } // namespace content | 1046 } // namespace content |
| OLD | NEW |