Chromium Code Reviews| Index: content/renderer/render_frame_impl.cc |
| diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc |
| index 361093328fa14c5bef4a6bdd64d30120784e44be..f19c550937dc920f65bf7908ce96508c7e8a53b9 100644 |
| --- a/content/renderer/render_frame_impl.cc |
| +++ b/content/renderer/render_frame_impl.cc |
| @@ -3423,8 +3423,8 @@ void RenderFrameImpl::didCreateDataSource(blink::WebLocalFrame* frame, |
| content_initiated)); |
| } |
| -void RenderFrameImpl::didStartProvisionalLoad( |
| - blink::WebDataSource* data_source) { |
| +void RenderFrameImpl::didStartProvisionalLoad(blink::WebDataSource* data_source, |
| + blink::WebURLRequest& request) { |
| // In fast/loader/stop-provisional-loads.html, we abort the load before this |
| // callback is invoked. |
| if (!data_source) |
| @@ -3433,6 +3433,27 @@ void RenderFrameImpl::didStartProvisionalLoad( |
| TRACE_EVENT2("navigation,benchmark,rail", |
| "RenderFrameImpl::didStartProvisionalLoad", "id", routing_id_, |
| "url", data_source->getRequest().url().string().utf8()); |
| + |
| + // PlzNavigate: |
| + // If we have pending navigation to be sent to the browser, do it here. |
| + if (pending_navigation_info_.get()) { |
|
clamy
2017/03/09 14:12:09
Could we reset the pending_navigation_info_ at the
ananta
2017/03/09 21:54:36
Done.
|
| + DCHECK(IsBrowserSideNavigationEnabled()); |
| + NavigationPolicyInfo info(request); |
| + info.navigationType = pending_navigation_info_->navigation_type; |
| + info.defaultPolicy = pending_navigation_info_->policy; |
| + info.replacesCurrentHistoryItem = |
| + pending_navigation_info_->replaces_current_history_item; |
| + info.isHistoryNavigationInNewChildFrame = |
| + pending_navigation_info_->history_navigation_in_new_child_frame; |
| + info.isClientRedirect = pending_navigation_info_->client_redirect; |
| + info.isCacheDisabled = pending_navigation_info_->cache_disabled; |
| + info.form = pending_navigation_info_->form; |
| + |
| + pending_navigation_info_.reset(nullptr); |
| + |
| + BeginNavigation(info); |
| + } |
| + |
| DocumentState* document_state = DocumentState::FromDataSource(data_source); |
| NavigationStateImpl* navigation_state = static_cast<NavigationStateImpl*>( |
| document_state->navigation_state()); |
| @@ -5477,7 +5498,9 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( |
| info.urlRequest.checkForBrowserSideNavigation() && |
| ShouldMakeNetworkRequestForURL(url)) { |
| if (info.defaultPolicy == blink::WebNavigationPolicyCurrentTab) { |
| - BeginNavigation(info); |
| + // The BeginNavigation() call happens in didStartProvisionalLoad(). We |
| + // need to save information about the navigation here. |
| + pending_navigation_info_.reset(new PendingNavigationInfo(info)); |
| return blink::WebNavigationPolicyHandledByClient; |
| } else { |
| LoadURLExternally(info.urlRequest, info.defaultPolicy); |