| 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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 frame_tree_node->current_frame_host()->GetSiteInstance()); | 788 frame_tree_node->current_frame_host()->GetSiteInstance()); |
| 789 navigation_data_.reset(); | 789 navigation_data_.reset(); |
| 790 } | 790 } |
| 791 | 791 |
| 792 navigation_request->BeginNavigation(); | 792 navigation_request->BeginNavigation(); |
| 793 } | 793 } |
| 794 | 794 |
| 795 // PlzNavigate | 795 // PlzNavigate |
| 796 void NavigatorImpl::CommitNavigation(FrameTreeNode* frame_tree_node, | 796 void NavigatorImpl::CommitNavigation(FrameTreeNode* frame_tree_node, |
| 797 ResourceResponse* response, | 797 ResourceResponse* response, |
| 798 scoped_ptr<StreamHandle> body) { | 798 scoped_ptr<StreamHandle> body, |
| 799 mojo::ScopedDataPipeConsumerHandle data_con
sumer_handle) { |
| 799 CHECK(IsBrowserSideNavigationEnabled()); | 800 CHECK(IsBrowserSideNavigationEnabled()); |
| 800 | 801 |
| 801 NavigationRequest* navigation_request = frame_tree_node->navigation_request(); | 802 NavigationRequest* navigation_request = frame_tree_node->navigation_request(); |
| 802 DCHECK(navigation_request); | 803 DCHECK(navigation_request); |
| 803 DCHECK(response || | 804 DCHECK(response || |
| 804 !ShouldMakeNetworkRequestForURL( | 805 !ShouldMakeNetworkRequestForURL( |
| 805 navigation_request->common_params().url)); | 806 navigation_request->common_params().url)); |
| 806 | 807 |
| 807 // HTTP 204 (No Content) and HTTP 205 (Reset Content) responses should not | 808 // HTTP 204 (No Content) and HTTP 205 (Reset Content) responses should not |
| 808 // commit; they leave the frame showing the previous page. | 809 // commit; they leave the frame showing the previous page. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 830 } | 831 } |
| 831 | 832 |
| 832 CheckWebUIRendererDoesNotDisplayNormalURL( | 833 CheckWebUIRendererDoesNotDisplayNormalURL( |
| 833 render_frame_host, navigation_request->common_params().url); | 834 render_frame_host, navigation_request->common_params().url); |
| 834 | 835 |
| 835 navigation_request->TransferNavigationHandleOwnership(render_frame_host); | 836 navigation_request->TransferNavigationHandleOwnership(render_frame_host); |
| 836 render_frame_host->navigation_handle()->ReadyToCommitNavigation( | 837 render_frame_host->navigation_handle()->ReadyToCommitNavigation( |
| 837 render_frame_host, response ? response->head.headers : nullptr); | 838 render_frame_host, response ? response->head.headers : nullptr); |
| 838 render_frame_host->CommitNavigation(response, std::move(body), | 839 render_frame_host->CommitNavigation(response, std::move(body), |
| 839 navigation_request->common_params(), | 840 navigation_request->common_params(), |
| 840 navigation_request->request_params()); | 841 navigation_request->request_params(), |
| 842 std::move(data_consumer_handle)); |
| 841 } | 843 } |
| 842 | 844 |
| 843 // PlzNavigate | 845 // PlzNavigate |
| 844 void NavigatorImpl::FailedNavigation(FrameTreeNode* frame_tree_node, | 846 void NavigatorImpl::FailedNavigation(FrameTreeNode* frame_tree_node, |
| 845 bool has_stale_copy_in_cache, | 847 bool has_stale_copy_in_cache, |
| 846 int error_code) { | 848 int error_code) { |
| 847 CHECK(IsBrowserSideNavigationEnabled()); | 849 CHECK(IsBrowserSideNavigationEnabled()); |
| 848 | 850 |
| 849 NavigationRequest* navigation_request = frame_tree_node->navigation_request(); | 851 NavigationRequest* navigation_request = frame_tree_node->navigation_request(); |
| 850 DCHECK(navigation_request); | 852 DCHECK(navigation_request); |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 entry->set_should_replace_entry(pending_entry->should_replace_entry()); | 1040 entry->set_should_replace_entry(pending_entry->should_replace_entry()); |
| 1039 entry->SetRedirectChain(pending_entry->GetRedirectChain()); | 1041 entry->SetRedirectChain(pending_entry->GetRedirectChain()); |
| 1040 } | 1042 } |
| 1041 controller_->SetPendingEntry(std::move(entry)); | 1043 controller_->SetPendingEntry(std::move(entry)); |
| 1042 if (delegate_) | 1044 if (delegate_) |
| 1043 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 1045 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
| 1044 } | 1046 } |
| 1045 } | 1047 } |
| 1046 | 1048 |
| 1047 } // namespace content | 1049 } // namespace content |
| OLD | NEW |