Chromium Code Reviews| Index: content/browser/frame_host/navigator_impl.cc |
| diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc |
| index 8466c51d4c00648f191c0630572ff4778a6fbd2d..905931133337519ae60a2912a87a7844f6b23b45 100644 |
| --- a/content/browser/frame_host/navigator_impl.cc |
| +++ b/content/browser/frame_host/navigator_impl.cc |
| @@ -55,8 +55,10 @@ namespace { |
| FrameMsg_Navigate_Type::Value GetNavigationType( |
| BrowserContext* browser_context, |
| + const FrameTreeNode* frame_tree_node, |
| const NavigationEntryImpl& entry, |
| - ReloadType reload_type) { |
| + ReloadType reload_type, |
| + bool is_same_document_history_load) { |
| switch (reload_type) { |
| case ReloadType::NORMAL: |
| return FrameMsg_Navigate_Type::RELOAD; |
| @@ -79,6 +81,13 @@ FrameMsg_Navigate_Type::Value GetNavigationType( |
| return FrameMsg_Navigate_Type::RESTORE; |
| } |
| + // A normal load of the current URL should be treated as a reload. |
| + if (frame_tree_node->current_url() == entry.GetURL() && |
|
clamy
2016/10/12 11:28:32
Sanity check: this is only called for browser-init
|
| + entry.GetHistoryURLForDataURL().is_empty() && !entry.GetHasPostData() && |
| + !is_same_document_history_load) { |
| + return FrameMsg_Navigate_Type::RELOAD_MAIN_RESOURCE; |
|
Charlie Reis
2016/10/15 00:00:49
I'm curious, does this list of conditions correspo
|
| + } |
| + |
| return FrameMsg_Navigate_Type::NORMAL; |
| } |
| @@ -391,8 +400,9 @@ bool NavigatorImpl::NavigateToEntry( |
| navigation_data_.reset(new NavigationMetricsData( |
| navigation_start, dest_url, entry.restore_type())); |
| // Create the navigation parameters. |
| - FrameMsg_Navigate_Type::Value navigation_type = GetNavigationType( |
| - controller_->GetBrowserContext(), entry, reload_type); |
| + FrameMsg_Navigate_Type::Value navigation_type = |
| + GetNavigationType(controller_->GetBrowserContext(), frame_tree_node, |
| + entry, reload_type, is_same_document_history_load); |
| dest_render_frame_host->Navigate( |
| entry.ConstructCommonNavigationParams( |
| frame_entry, post_body, dest_url, dest_referrer, navigation_type, |
| @@ -1097,7 +1107,8 @@ void NavigatorImpl::RequestNavigation(FrameTreeNode* frame_tree_node, |
| bool should_dispatch_beforeunload = |
| frame_tree_node->current_frame_host()->ShouldDispatchBeforeUnload(); |
| FrameMsg_Navigate_Type::Value navigation_type = |
| - GetNavigationType(controller_->GetBrowserContext(), entry, reload_type); |
| + GetNavigationType(controller_->GetBrowserContext(), frame_tree_node, |
| + entry, reload_type, is_same_document_history_load); |
| std::unique_ptr<NavigationRequest> scoped_request = |
| NavigationRequest::CreateBrowserInitiated( |
| frame_tree_node, dest_url, dest_referrer, frame_entry, entry, |