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 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
997 if (params.is_history_navigation_in_new_child) { | 997 if (params.is_history_navigation_in_new_child) { |
998 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries()); | 998 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries()); |
999 | 999 |
1000 // Try to find a FrameNavigationEntry that matches this frame instead, based | 1000 // Try to find a FrameNavigationEntry that matches this frame instead, based |
1001 // on the frame's unique name. If this can't be found, fall back to the | 1001 // on the frame's unique name. If this can't be found, fall back to the |
1002 // default params using OpenURL below. | 1002 // default params using OpenURL below. |
1003 if (frame_tree_node_->navigator()->NavigateNewChildFrame(this, params.url)) | 1003 if (frame_tree_node_->navigator()->NavigateNewChildFrame(this, params.url)) |
1004 return; | 1004 return; |
1005 } | 1005 } |
1006 | 1006 |
1007 OpenURL(params, GetSiteInstance()); | 1007 OpenURL(params); |
1008 } | 1008 } |
1009 | 1009 |
1010 void RenderFrameHostImpl::OnCancelInitialHistoryLoad() { | 1010 void RenderFrameHostImpl::OnCancelInitialHistoryLoad() { |
1011 // A Javascript navigation interrupted the initial history load. Check if an | 1011 // A Javascript navigation interrupted the initial history load. Check if an |
1012 // initial subframe cross-process navigation needs to be canceled as a result. | 1012 // initial subframe cross-process navigation needs to be canceled as a result. |
1013 // TODO(creis, clamy): Cancel any cross-process navigation in PlzNavigate. | 1013 // TODO(creis, clamy): Cancel any cross-process navigation in PlzNavigate. |
1014 if (GetParent() && !frame_tree_node_->has_committed_real_load() && | 1014 if (GetParent() && !frame_tree_node_->has_committed_real_load() && |
1015 frame_tree_node_->render_manager()->pending_frame_host()) { | 1015 frame_tree_node_->render_manager()->pending_frame_host()) { |
1016 frame_tree_node_->render_manager()->CancelPendingIfNecessary( | 1016 frame_tree_node_->render_manager()->CancelPendingIfNecessary( |
1017 frame_tree_node_->render_manager()->pending_frame_host()); | 1017 frame_tree_node_->render_manager()->pending_frame_host()); |
(...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2346 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), LOFI_OFF, | 2346 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), LOFI_OFF, |
2347 base::TimeTicks::Now(), "GET", nullptr); | 2347 base::TimeTicks::Now(), "GET", nullptr); |
2348 if (IsBrowserSideNavigationEnabled()) { | 2348 if (IsBrowserSideNavigationEnabled()) { |
2349 CommitNavigation(nullptr, nullptr, common_params, RequestNavigationParams(), | 2349 CommitNavigation(nullptr, nullptr, common_params, RequestNavigationParams(), |
2350 false); | 2350 false); |
2351 } else { | 2351 } else { |
2352 Navigate(common_params, StartNavigationParams(), RequestNavigationParams()); | 2352 Navigate(common_params, StartNavigationParams(), RequestNavigationParams()); |
2353 } | 2353 } |
2354 } | 2354 } |
2355 | 2355 |
2356 void RenderFrameHostImpl::OpenURL(const FrameHostMsg_OpenURL_Params& params, | 2356 void RenderFrameHostImpl::OpenURL(const FrameHostMsg_OpenURL_Params& params) { |
Charlie Reis
2016/11/02 17:05:37
Can we combine this with OnOpenURL? Looks like th
alexmos
2016/11/03 06:03:01
Done. Good catch with NavigateNewChildFrame.
| |
2357 SiteInstance* source_site_instance) { | |
2358 GURL validated_url(params.url); | 2357 GURL validated_url(params.url); |
2359 GetProcess()->FilterURL(false, &validated_url); | 2358 GetProcess()->FilterURL(false, &validated_url); |
2360 | 2359 |
2361 TRACE_EVENT1("navigation", "RenderFrameHostImpl::OpenURL", "url", | 2360 TRACE_EVENT1("navigation", "RenderFrameHostImpl::OpenURL", "url", |
2362 validated_url.possibly_invalid_spec()); | 2361 validated_url.possibly_invalid_spec()); |
2363 frame_tree_node_->navigator()->RequestOpenURL( | 2362 frame_tree_node_->navigator()->RequestOpenURL( |
2364 this, validated_url, params.uses_post, params.resource_request_body, | 2363 this, validated_url, params.uses_post, params.resource_request_body, |
2365 params.extra_headers, source_site_instance, params.referrer, | 2364 params.extra_headers, params.referrer, params.disposition, |
2366 params.disposition, params.should_replace_current_entry, | 2365 params.should_replace_current_entry, params.user_gesture); |
2367 params.user_gesture); | |
2368 } | 2366 } |
2369 | 2367 |
2370 void RenderFrameHostImpl::Stop() { | 2368 void RenderFrameHostImpl::Stop() { |
2371 Send(new FrameMsg_Stop(routing_id_)); | 2369 Send(new FrameMsg_Stop(routing_id_)); |
2372 } | 2370 } |
2373 | 2371 |
2374 void RenderFrameHostImpl::DispatchBeforeUnload(bool for_navigation, | 2372 void RenderFrameHostImpl::DispatchBeforeUnload(bool for_navigation, |
2375 bool is_reload) { | 2373 bool is_reload) { |
2376 DCHECK(for_navigation || !is_reload); | 2374 DCHECK(for_navigation || !is_reload); |
2377 | 2375 |
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3183 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 3181 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
3184 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 3182 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
3185 return web_bluetooth_service_.get(); | 3183 return web_bluetooth_service_.get(); |
3186 } | 3184 } |
3187 | 3185 |
3188 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 3186 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
3189 web_bluetooth_service_.reset(); | 3187 web_bluetooth_service_.reset(); |
3190 } | 3188 } |
3191 | 3189 |
3192 } // namespace content | 3190 } // namespace content |
OLD | NEW |