| 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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 CHECK(IsBrowserSideNavigationEnabled()); | 799 CHECK(IsBrowserSideNavigationEnabled()); |
| 800 | |
| 801 NavigationRequest* navigation_request = frame_tree_node->navigation_request(); | 800 NavigationRequest* navigation_request = frame_tree_node->navigation_request(); |
| 802 DCHECK(navigation_request); | 801 DCHECK(navigation_request); |
| 803 DCHECK(response || | 802 DCHECK(response || |
| 804 !ShouldMakeNetworkRequestForURL( | 803 !ShouldMakeNetworkRequestForURL( |
| 805 navigation_request->common_params().url)); | 804 navigation_request->common_params().url)); |
| 806 | 805 |
| 807 // HTTP 204 (No Content) and HTTP 205 (Reset Content) responses should not | 806 // HTTP 204 (No Content) and HTTP 205 (Reset Content) responses should not |
| 808 // commit; they leave the frame showing the previous page. | 807 // commit; they leave the frame showing the previous page. |
| 809 if (response && response->head.headers.get() && | 808 if (response && response->head.headers.get() && |
| 810 (response->head.headers->response_code() == 204 || | 809 (response->head.headers->response_code() == 204 || |
| (...skipping 227 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 |