Chromium Code Reviews| 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 (!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 | |
| 900 if (!IsBrowserSideNavigationEnabled() && navigation_handle_) { | 917 if (!IsBrowserSideNavigationEnabled() && navigation_handle_) { |
|
Charlie Reis
2016/04/12 23:59:17
nit: We already know navigation_handle_ is non-nul
clamy
2016/04/13 12:51:51
Addressed in the other patch.
| |
| 901 navigation_handle_->set_net_error_code( | 918 navigation_handle_->set_net_error_code( |
| 902 static_cast<net::Error>(params.error_code)); | 919 static_cast<net::Error>(params.error_code)); |
| 903 } | 920 } |
| 921 | |
| 904 frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params); | 922 frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params); |
| 905 } | 923 } |
| 906 | 924 |
| 907 void RenderFrameHostImpl::OnDidFailLoadWithError( | 925 void RenderFrameHostImpl::OnDidFailLoadWithError( |
| 908 const GURL& url, | 926 const GURL& url, |
| 909 int error_code, | 927 int error_code, |
| 910 const base::string16& error_description, | 928 const base::string16& error_description, |
| 911 bool was_ignored_by_handler) { | 929 bool was_ignored_by_handler) { |
| 912 GURL validated_url(url); | 930 GURL validated_url(url); |
| 913 GetProcess()->FilterURL(false, &validated_url); | 931 GetProcess()->FilterURL(false, &validated_url); |
| (...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2744 } | 2762 } |
| 2745 | 2763 |
| 2746 void RenderFrameHostImpl::CreateWebBluetoothService( | 2764 void RenderFrameHostImpl::CreateWebBluetoothService( |
| 2747 blink::mojom::WebBluetoothServiceRequest request) { | 2765 blink::mojom::WebBluetoothServiceRequest request) { |
| 2748 DCHECK(!web_bluetooth_service_); | 2766 DCHECK(!web_bluetooth_service_); |
| 2749 web_bluetooth_service_.reset( | 2767 web_bluetooth_service_.reset( |
| 2750 new WebBluetoothServiceImpl(this, std::move(request))); | 2768 new WebBluetoothServiceImpl(this, std::move(request))); |
| 2751 } | 2769 } |
| 2752 | 2770 |
| 2753 } // namespace content | 2771 } // namespace content |
| OLD | NEW |