| Index: content/renderer/render_frame_impl.cc
|
| diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
| index 9593e50974afa604dd63c1647cf77f3fdbc68044..1e93a2f175ec05438245e5f220c16f97ba2c112e 100644
|
| --- a/content/renderer/render_frame_impl.cc
|
| +++ b/content/renderer/render_frame_impl.cc
|
| @@ -1046,6 +1046,7 @@ RenderFrameImpl::RenderFrameImpl(const CreateParams& params)
|
| render_view_(params.render_view->AsWeakPtr()),
|
| routing_id_(params.routing_id),
|
| proxy_routing_id_(MSG_ROUTING_NONE),
|
| + browser_has_subtree_history_items_(false),
|
| #if defined(ENABLE_PLUGINS)
|
| plugin_power_saver_helper_(nullptr),
|
| plugin_find_handler_(nullptr),
|
| @@ -1176,6 +1177,11 @@ void RenderFrameImpl::Initialize() {
|
| RenderFrameImpl* parent_frame = RenderFrameImpl::FromWebFrame(
|
| frame_->parent());
|
| if (parent_frame) {
|
| + // Inherit knowledge of whether we need to consult the browser process for
|
| + // a history item on the first navigation. This is inherited by further
|
| + // subframes and cleared at didStopLoading.
|
| + browser_has_subtree_history_items_ =
|
| + parent_frame->browser_has_subtree_history_items_;
|
| is_using_lofi_ = parent_frame->IsUsingLoFi();
|
| effective_connection_type_ = parent_frame->getEffectiveConnectionType();
|
| }
|
| @@ -4830,6 +4836,12 @@ void RenderFrameImpl::didStartLoading(bool to_different_document) {
|
| void RenderFrameImpl::didStopLoading() {
|
| TRACE_EVENT1("navigation,rail", "RenderFrameImpl::didStopLoading",
|
| "id", routing_id_);
|
| +
|
| + // Any subframes created after this point won't be considered part of the
|
| + // current history navigation (if this was one), so we don't need to track
|
| + // this state anymore.
|
| + browser_has_subtree_history_items_ = false;
|
| +
|
| render_view_->FrameDidStopLoading(frame_);
|
| Send(new FrameHostMsg_DidStopLoading(routing_id_));
|
| }
|
| @@ -4971,10 +4983,12 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
|
| }
|
|
|
| // In OOPIF-enabled modes, back/forward navigations in newly created subframes
|
| - // should be sent to the browser in case there is a matching
|
| - // FrameNavigationEntry. If none is found, fall back to the default url.
|
| + // should be sent to the browser if there is a chance there is a matching
|
| + // FrameNavigationEntry. If none is found (or if the browser has indicated it
|
| + // has no subtree history items), fall back to loading the default url.
|
| if (SiteIsolationPolicy::UseSubframeNavigationEntries() &&
|
| - info.isHistoryNavigationInNewChildFrame && is_content_initiated) {
|
| + info.isHistoryNavigationInNewChildFrame && is_content_initiated &&
|
| + browser_has_subtree_history_items_) {
|
| // Don't do this if |info| also says it is a client redirect, in which case
|
| // JavaScript on the page is trying to interrupt the history navigation.
|
| if (!info.isClientRedirect) {
|
| @@ -5553,6 +5567,11 @@ void RenderFrameImpl::NavigateInternal(
|
| : blink::WebFrameLoadType::BackForward;
|
| should_load_request = true;
|
|
|
| + // Remember whether we should consult the browser process for any
|
| + // subframes created during this history navigation.
|
| + browser_has_subtree_history_items_ =
|
| + request_params.has_subtree_history_items;
|
| +
|
| // If this is marked as a same document load but we haven't committed
|
| // anything, treat it as a new load. The browser shouldn't let this
|
| // happen. Also treat it as a new load, if the DSN in
|
|
|