| 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 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 const base::TimeTicks& navigation_start) { | 1013 const base::TimeTicks& navigation_start) { |
| 1014 frame_tree_node_->navigator()->DidStartProvisionalLoad(this, url, | 1014 frame_tree_node_->navigator()->DidStartProvisionalLoad(this, url, |
| 1015 navigation_start); | 1015 navigation_start); |
| 1016 } | 1016 } |
| 1017 | 1017 |
| 1018 void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( | 1018 void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( |
| 1019 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { | 1019 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { |
| 1020 // TODO(clamy): Kill the renderer with RFH_FAIL_PROVISIONAL_LOAD_NO_HANDLE and | 1020 // TODO(clamy): Kill the renderer with RFH_FAIL_PROVISIONAL_LOAD_NO_HANDLE and |
| 1021 // return early if navigation_handle_ is null, once we prevent that case from | 1021 // return early if navigation_handle_ is null, once we prevent that case from |
| 1022 // happening in practice. | 1022 // happening in practice. |
| 1023 if (IsBrowserSideNavigationEnabled() && navigation_handle_ && | |
| 1024 navigation_handle_->GetNetErrorCode() == net::OK) { | |
| 1025 // The renderer should not be sending this message unless asked to commit | |
| 1026 // an error page. | |
| 1027 // TODO(clamy): Stop sending DidFailProvisionalLoad IPCs at all when enough | |
| 1028 // observers have moved to DidFinishNavigation. | |
| 1029 bad_message::ReceivedBadMessage( | |
| 1030 GetProcess(), bad_message::RFH_FAIL_PROVISIONAL_LOAD_NO_ERROR); | |
| 1031 return; | |
| 1032 } | |
| 1033 | 1023 |
| 1034 // Update the error code in the NavigationHandle of the navigation. | 1024 // Update the error code in the NavigationHandle of the navigation. |
| 1035 // PlzNavigate: this has already done in NavigationRequest::OnRequestFailed. | 1025 if (navigation_handle_) { |
| 1036 if (!IsBrowserSideNavigationEnabled() && navigation_handle_) { | |
| 1037 navigation_handle_->set_net_error_code( | 1026 navigation_handle_->set_net_error_code( |
| 1038 static_cast<net::Error>(params.error_code)); | 1027 static_cast<net::Error>(params.error_code)); |
| 1039 } | 1028 } |
| 1040 | 1029 |
| 1041 frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params); | 1030 frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params); |
| 1042 } | 1031 } |
| 1043 | 1032 |
| 1044 void RenderFrameHostImpl::OnDidFailLoadWithError( | 1033 void RenderFrameHostImpl::OnDidFailLoadWithError( |
| 1045 const GURL& url, | 1034 const GURL& url, |
| 1046 int error_code, | 1035 int error_code, |
| (...skipping 2021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3068 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 3057 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
| 3069 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 3058 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
| 3070 return web_bluetooth_service_.get(); | 3059 return web_bluetooth_service_.get(); |
| 3071 } | 3060 } |
| 3072 | 3061 |
| 3073 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 3062 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
| 3074 web_bluetooth_service_.reset(); | 3063 web_bluetooth_service_.reset(); |
| 3075 } | 3064 } |
| 3076 | 3065 |
| 3077 } // namespace content | 3066 } // namespace content |
| OLD | NEW |