Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2403813002: Do not create NavigationHandles for inactive RenderFrameHosts (Closed)
Patch Set: Addressed commments + Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 base::TimeDelta::FromMinutes(10), 100); 1031 base::TimeDelta::FromMinutes(10), 100);
1032 } 1032 }
1033 // This message is only sent for top-level frames. TODO(avi): when frame tree 1033 // This message is only sent for top-level frames. TODO(avi): when frame tree
1034 // mirroring works correctly, add a check here to enforce it. 1034 // mirroring works correctly, add a check here to enforce it.
1035 delegate_->DocumentOnLoadCompleted(this); 1035 delegate_->DocumentOnLoadCompleted(this);
1036 } 1036 }
1037 1037
1038 void RenderFrameHostImpl::OnDidStartProvisionalLoad( 1038 void RenderFrameHostImpl::OnDidStartProvisionalLoad(
1039 const GURL& url, 1039 const GURL& url,
1040 const base::TimeTicks& navigation_start) { 1040 const base::TimeTicks& navigation_start) {
1041 // TODO(clamy): Check if other navigation methods (OpenURL,
1042 // DidFailProvisionalLoad, ...) should also be ignored if the RFH is no longer
1043 // active.
1044 if (!is_active())
1045 return;
1041 frame_tree_node_->navigator()->DidStartProvisionalLoad(this, url, 1046 frame_tree_node_->navigator()->DidStartProvisionalLoad(this, url,
1042 navigation_start); 1047 navigation_start);
1043 } 1048 }
1044 1049
1045 void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( 1050 void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
1046 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { 1051 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) {
1047 // TODO(clamy): Kill the renderer with RFH_FAIL_PROVISIONAL_LOAD_NO_HANDLE and 1052 // TODO(clamy): Kill the renderer with RFH_FAIL_PROVISIONAL_LOAD_NO_HANDLE and
1048 // return early if navigation_handle_ is null, once we prevent that case from 1053 // return early if navigation_handle_ is null, once we prevent that case from
1049 // happening in practice. 1054 // happening in practice.
1050 1055
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
1785 void RenderFrameHostImpl::OnUpdateEncoding(const std::string& encoding_name) { 1790 void RenderFrameHostImpl::OnUpdateEncoding(const std::string& encoding_name) {
1786 // This message is only sent for top-level frames. TODO(avi): when frame tree 1791 // This message is only sent for top-level frames. TODO(avi): when frame tree
1787 // mirroring works correctly, add a check here to enforce it. 1792 // mirroring works correctly, add a check here to enforce it.
1788 delegate_->UpdateEncoding(this, encoding_name); 1793 delegate_->UpdateEncoding(this, encoding_name);
1789 } 1794 }
1790 1795
1791 void RenderFrameHostImpl::OnBeginNavigation( 1796 void RenderFrameHostImpl::OnBeginNavigation(
1792 const CommonNavigationParams& common_params, 1797 const CommonNavigationParams& common_params,
1793 const BeginNavigationParams& begin_params) { 1798 const BeginNavigationParams& begin_params) {
1794 CHECK(IsBrowserSideNavigationEnabled()); 1799 CHECK(IsBrowserSideNavigationEnabled());
1800 if (!is_active())
1801 return;
1795 CommonNavigationParams validated_params = common_params; 1802 CommonNavigationParams validated_params = common_params;
1796 GetProcess()->FilterURL(false, &validated_params.url); 1803 GetProcess()->FilterURL(false, &validated_params.url);
1797 frame_tree_node()->navigator()->OnBeginNavigation( 1804 frame_tree_node()->navigator()->OnBeginNavigation(
1798 frame_tree_node(), validated_params, begin_params); 1805 frame_tree_node(), validated_params, begin_params);
1799 } 1806 }
1800 1807
1801 void RenderFrameHostImpl::OnDispatchLoad() { 1808 void RenderFrameHostImpl::OnDispatchLoad() {
1802 CHECK(SiteIsolationPolicy::AreCrossProcessFramesPossible()); 1809 CHECK(SiteIsolationPolicy::AreCrossProcessFramesPossible());
1803 1810
1804 // Don't forward the load event if this RFH is pending deletion. This can 1811 // Don't forward the load event if this RFH is pending deletion. This can
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after
3107 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( 3114 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind(
3108 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); 3115 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this)));
3109 return web_bluetooth_service_.get(); 3116 return web_bluetooth_service_.get();
3110 } 3117 }
3111 3118
3112 void RenderFrameHostImpl::DeleteWebBluetoothService() { 3119 void RenderFrameHostImpl::DeleteWebBluetoothService() {
3113 web_bluetooth_service_.reset(); 3120 web_bluetooth_service_.reset();
3114 } 3121 }
3115 3122
3116 } // namespace content 3123 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698