| 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_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 | 890 |
| 891 void RenderFrameHostImpl::OnDidStartProvisionalLoad( | 891 void RenderFrameHostImpl::OnDidStartProvisionalLoad( |
| 892 const GURL& url, | 892 const GURL& url, |
| 893 const base::TimeTicks& navigation_start) { | 893 const base::TimeTicks& navigation_start) { |
| 894 frame_tree_node_->navigator()->DidStartProvisionalLoad(this, url, | 894 frame_tree_node_->navigator()->DidStartProvisionalLoad(this, url, |
| 895 navigation_start); | 895 navigation_start); |
| 896 } | 896 } |
| 897 | 897 |
| 898 void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( | 898 void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( |
| 899 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { | 899 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { |
| 900 if (!IsBrowserSideNavigationEnabled() && navigation_handle_) { | 900 if (!navigation_handle_) { |
| 901 bad_message::ReceivedBadMessage( |
| 902 GetProcess(), bad_message::RFH_FAIL_PROVISIONAL_LOAD_NO_HANDLE); |
| 903 return; |
| 904 } |
| 905 |
| 906 if (IsBrowserSideNavigationEnabled() && |
| 907 navigation_handle_->GetNetErrorCode() == net::OK) { |
| 908 // The renderer should not be sending this message unless asked to commit |
| 909 // an error page. |
| 910 // TODO(clamy): Stop sending DidFailProvisionalLoad IPCs at all when enough |
| 911 // observers have moved to DidFinishNavigation. |
| 912 bad_message::ReceivedBadMessage( |
| 913 GetProcess(), bad_message::RFH_FAIL_PROVISIONAL_LOAD_NO_ERROR); |
| 914 return; |
| 915 } |
| 916 |
| 917 // Update the error code in the NavigationHandle of the navigation. |
| 918 // PlzNavigate: this has already done in NavigationRequest::OnRequestFailed. |
| 919 if (!IsBrowserSideNavigationEnabled()) { |
| 901 navigation_handle_->set_net_error_code( | 920 navigation_handle_->set_net_error_code( |
| 902 static_cast<net::Error>(params.error_code)); | 921 static_cast<net::Error>(params.error_code)); |
| 903 } | 922 } |
| 923 |
| 904 frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params); | 924 frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params); |
| 905 } | 925 } |
| 906 | 926 |
| 907 void RenderFrameHostImpl::OnDidFailLoadWithError( | 927 void RenderFrameHostImpl::OnDidFailLoadWithError( |
| 908 const GURL& url, | 928 const GURL& url, |
| 909 int error_code, | 929 int error_code, |
| 910 const base::string16& error_description, | 930 const base::string16& error_description, |
| 911 bool was_ignored_by_handler) { | 931 bool was_ignored_by_handler) { |
| 912 GURL validated_url(url); | 932 GURL validated_url(url); |
| 913 GetProcess()->FilterURL(false, &validated_url); | 933 GetProcess()->FilterURL(false, &validated_url); |
| (...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2735 } | 2755 } |
| 2736 | 2756 |
| 2737 void RenderFrameHostImpl::CreateWebBluetoothService( | 2757 void RenderFrameHostImpl::CreateWebBluetoothService( |
| 2738 blink::mojom::WebBluetoothServiceRequest request) { | 2758 blink::mojom::WebBluetoothServiceRequest request) { |
| 2739 DCHECK(!web_bluetooth_service_); | 2759 DCHECK(!web_bluetooth_service_); |
| 2740 web_bluetooth_service_.reset( | 2760 web_bluetooth_service_.reset( |
| 2741 new WebBluetoothServiceImpl(this, std::move(request))); | 2761 new WebBluetoothServiceImpl(this, std::move(request))); |
| 2742 } | 2762 } |
| 2743 | 2763 |
| 2744 } // namespace content | 2764 } // namespace content |
| OLD | NEW |