| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/navigation_handle_impl.h" | 5 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "content/browser/browsing_data/clear_site_data_throttle.h" | 10 #include "content/browser/browsing_data/clear_site_data_throttle.h" |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 | 638 |
| 639 // PlzNavigate: the final RenderFrameHost handling this navigation has been | 639 // PlzNavigate: the final RenderFrameHost handling this navigation has been |
| 640 // decided before calling WillProcessResponse in | 640 // decided before calling WillProcessResponse in |
| 641 // NavigationRequest::OnResponseStarted. | 641 // NavigationRequest::OnResponseStarted. |
| 642 // TODO(clamy): See if PlzNavigate could use this code to check whether to | 642 // TODO(clamy): See if PlzNavigate could use this code to check whether to |
| 643 // use the RFH determined at the start of the navigation or to switch to | 643 // use the RFH determined at the start of the navigation or to switch to |
| 644 // another one. | 644 // another one. |
| 645 if (IsBrowserSideNavigationEnabled()) | 645 if (IsBrowserSideNavigationEnabled()) |
| 646 return true; | 646 return true; |
| 647 | 647 |
| 648 // A navigation from a RenderFrame that is no longer active should not attempt |
| 649 // to transfer. |
| 650 CHECK(render_frame_host_->is_active()); |
| 651 |
| 648 // Subframes shouldn't swap processes unless out-of-process iframes are | 652 // Subframes shouldn't swap processes unless out-of-process iframes are |
| 649 // possible. | 653 // possible. |
| 650 if (!IsInMainFrame() && !SiteIsolationPolicy::AreCrossProcessFramesPossible()) | 654 if (!IsInMainFrame() && !SiteIsolationPolicy::AreCrossProcessFramesPossible()) |
| 651 return true; | 655 return true; |
| 652 | 656 |
| 653 // If this is a download, do not do a cross-site check. The renderer will | 657 // If this is a download, do not do a cross-site check. The renderer will |
| 654 // see it is a download and abort the request. | 658 // see it is a download and abort the request. |
| 655 // | 659 // |
| 656 // Similarly, HTTP 204 (No Content) responses leave the renderer showing the | 660 // Similarly, HTTP 204 (No Content) responses leave the renderer showing the |
| 657 // previous page. The navigation should be allowed to finish without running | 661 // previous page. The navigation should be allowed to finish without running |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 throttles_to_register.end()); | 737 throttles_to_register.end()); |
| 734 throttles_to_register.weak_clear(); | 738 throttles_to_register.weak_clear(); |
| 735 } | 739 } |
| 736 } | 740 } |
| 737 | 741 |
| 738 bool NavigationHandleImpl::WasStartedFromContextMenu() const { | 742 bool NavigationHandleImpl::WasStartedFromContextMenu() const { |
| 739 return started_from_context_menu_; | 743 return started_from_context_menu_; |
| 740 } | 744 } |
| 741 | 745 |
| 742 } // namespace content | 746 } // namespace content |
| OLD | NEW |