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

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

Issue 2392283005: Reland "Merge of CrossSiteResourceHandler and NavigationResourceThrottle." (Closed)
Patch Set: Added debugging code from issue 2393903002 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
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"
11 #include "base/containers/hash_tables.h" 11 #include "base/containers/hash_tables.h"
12 #include "base/debug/dump_without_crashing.h"
12 #include "base/lazy_instance.h" 13 #include "base/lazy_instance.h"
13 #include "base/memory/ptr_util.h" 14 #include "base/memory/ptr_util.h"
14 #include "base/metrics/histogram_macros.h" 15 #include "base/metrics/histogram_macros.h"
15 #include "base/process/kill.h" 16 #include "base/process/kill.h"
16 #include "base/time/time.h" 17 #include "base/time/time.h"
17 #include "build/build_config.h" 18 #include "build/build_config.h"
18 #include "content/browser/accessibility/accessibility_mode_helper.h" 19 #include "content/browser/accessibility/accessibility_mode_helper.h"
19 #include "content/browser/accessibility/ax_tree_id_registry.h" 20 #include "content/browser/accessibility/ax_tree_id_registry.h"
20 #include "content/browser/accessibility/browser_accessibility_manager.h" 21 #include "content/browser/accessibility/browser_accessibility_manager.h"
21 #include "content/browser/accessibility/browser_accessibility_state_impl.h" 22 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
22 #include "content/browser/bluetooth/web_bluetooth_service_impl.h" 23 #include "content/browser/bluetooth/web_bluetooth_service_impl.h"
23 #include "content/browser/child_process_security_policy_impl.h" 24 #include "content/browser/child_process_security_policy_impl.h"
24 #include "content/browser/devtools/render_frame_devtools_agent_host.h" 25 #include "content/browser/devtools/render_frame_devtools_agent_host.h"
25 #include "content/browser/download/mhtml_generation_manager.h" 26 #include "content/browser/download/mhtml_generation_manager.h"
26 #include "content/browser/frame_host/cross_process_frame_connector.h" 27 #include "content/browser/frame_host/cross_process_frame_connector.h"
27 #include "content/browser/frame_host/cross_site_transferring_request.h"
28 #include "content/browser/frame_host/debug_urls.h" 28 #include "content/browser/frame_host/debug_urls.h"
29 #include "content/browser/frame_host/frame_tree.h" 29 #include "content/browser/frame_host/frame_tree.h"
30 #include "content/browser/frame_host/frame_tree_node.h" 30 #include "content/browser/frame_host/frame_tree_node.h"
31 #include "content/browser/frame_host/navigation_entry_impl.h" 31 #include "content/browser/frame_host/navigation_entry_impl.h"
32 #include "content/browser/frame_host/navigation_handle_impl.h" 32 #include "content/browser/frame_host/navigation_handle_impl.h"
33 #include "content/browser/frame_host/navigation_request.h" 33 #include "content/browser/frame_host/navigation_request.h"
34 #include "content/browser/frame_host/navigator.h" 34 #include "content/browser/frame_host/navigator.h"
35 #include "content/browser/frame_host/navigator_impl.h" 35 #include "content/browser/frame_host/navigator_impl.h"
36 #include "content/browser/frame_host/render_frame_host_delegate.h" 36 #include "content/browser/frame_host/render_frame_host_delegate.h"
37 #include "content/browser/frame_host/render_frame_proxy_host.h" 37 #include "content/browser/frame_host/render_frame_proxy_host.h"
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 return GlobalFrameRoutingId(GetProcess()->GetID(), GetRoutingID()); 1291 return GlobalFrameRoutingId(GetProcess()->GetID(), GetRoutingID());
1292 } 1292 }
1293 1293
1294 int RenderFrameHostImpl::GetEnabledBindings() { 1294 int RenderFrameHostImpl::GetEnabledBindings() {
1295 return render_view_host_->GetEnabledBindings(); 1295 return render_view_host_->GetEnabledBindings();
1296 } 1296 }
1297 1297
1298 void RenderFrameHostImpl::SetNavigationHandle( 1298 void RenderFrameHostImpl::SetNavigationHandle(
1299 std::unique_ptr<NavigationHandleImpl> navigation_handle) { 1299 std::unique_ptr<NavigationHandleImpl> navigation_handle) {
1300 navigation_handle_ = std::move(navigation_handle); 1300 navigation_handle_ = std::move(navigation_handle);
1301 if (navigation_handle_) 1301
1302 navigation_handle_->set_render_frame_host(this); 1302 // TODO(clamy): Remove this debug code once we understand better how we get to
1303 // the point of attempting to transfer a navigation from a RFH that is no
1304 // longer active.
1305 if (navigation_handle_ && !is_active())
1306 base::debug::DumpWithoutCrashing();
1303 } 1307 }
1304 1308
1305 std::unique_ptr<NavigationHandleImpl> 1309 std::unique_ptr<NavigationHandleImpl>
1306 RenderFrameHostImpl::PassNavigationHandleOwnership() { 1310 RenderFrameHostImpl::PassNavigationHandleOwnership() {
1307 DCHECK(!IsBrowserSideNavigationEnabled()); 1311 DCHECK(!IsBrowserSideNavigationEnabled());
1308 if (navigation_handle_) 1312 if (navigation_handle_)
1309 navigation_handle_->set_is_transferring(true); 1313 navigation_handle_->set_is_transferring(true);
1310 return std::move(navigation_handle_); 1314 return std::move(navigation_handle_);
1311 } 1315 }
1312 1316
1313 void RenderFrameHostImpl::OnCrossSiteResponse(
1314 const GlobalRequestID& global_request_id,
1315 std::unique_ptr<CrossSiteTransferringRequest>
1316 cross_site_transferring_request,
1317 const std::vector<GURL>& transfer_url_chain,
1318 const Referrer& referrer,
1319 ui::PageTransition page_transition,
1320 bool should_replace_current_entry) {
1321 frame_tree_node_->render_manager()->OnCrossSiteResponse(
1322 this, global_request_id, std::move(cross_site_transferring_request),
1323 transfer_url_chain, referrer, page_transition,
1324 should_replace_current_entry);
1325 }
1326
1327 void RenderFrameHostImpl::SwapOut( 1317 void RenderFrameHostImpl::SwapOut(
1328 RenderFrameProxyHost* proxy, 1318 RenderFrameProxyHost* proxy,
1329 bool is_loading) { 1319 bool is_loading) {
1330 // The end of this event is in OnSwapOutACK when the RenderFrame has completed 1320 // The end of this event is in OnSwapOutACK when the RenderFrame has completed
1331 // the operation and sends back an IPC message. 1321 // the operation and sends back an IPC message.
1332 // The trace event may not end properly if the ACK times out. We expect this 1322 // The trace event may not end properly if the ACK times out. We expect this
1333 // to be fixed when RenderViewHostImpl::OnSwapOut moves to RenderFrameHost. 1323 // to be fixed when RenderViewHostImpl::OnSwapOut moves to RenderFrameHost.
1334 TRACE_EVENT_ASYNC_BEGIN0("navigation", "RenderFrameHostImpl::SwapOut", this); 1324 TRACE_EVENT_ASYNC_BEGIN0("navigation", "RenderFrameHostImpl::SwapOut", this);
1335 1325
1336 // If this RenderFrameHost is already pending deletion, it must have already 1326 // If this RenderFrameHost is already pending deletion, it must have already
(...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after
3111 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( 3101 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind(
3112 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); 3102 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this)));
3113 return web_bluetooth_service_.get(); 3103 return web_bluetooth_service_.get();
3114 } 3104 }
3115 3105
3116 void RenderFrameHostImpl::DeleteWebBluetoothService() { 3106 void RenderFrameHostImpl::DeleteWebBluetoothService() {
3117 web_bluetooth_service_.reset(); 3107 web_bluetooth_service_.reset();
3118 } 3108 }
3119 3109
3120 } // namespace content 3110 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/frame_host/render_frame_host_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698