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

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

Issue 2381503003: PlzNav: Fix NavigationControllerBrowserTest.EnsureSamePageNavigationUpdatesFrameNaviga… (Closed)
Patch Set: . 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/navigator_impl.h" 5 #include "content/browser/frame_host/navigator_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 base::TimeTicks navigation_start) { 1091 base::TimeTicks navigation_start) {
1092 CHECK(IsBrowserSideNavigationEnabled()); 1092 CHECK(IsBrowserSideNavigationEnabled());
1093 DCHECK(frame_tree_node); 1093 DCHECK(frame_tree_node);
1094 1094
1095 // This value must be set here because creating a NavigationRequest might 1095 // This value must be set here because creating a NavigationRequest might
1096 // change the renderer live/non-live status and change this result. 1096 // change the renderer live/non-live status and change this result.
1097 bool should_dispatch_beforeunload = 1097 bool should_dispatch_beforeunload =
1098 frame_tree_node->current_frame_host()->ShouldDispatchBeforeUnload(); 1098 frame_tree_node->current_frame_host()->ShouldDispatchBeforeUnload();
1099 FrameMsg_Navigate_Type::Value navigation_type = 1099 FrameMsg_Navigate_Type::Value navigation_type =
1100 GetNavigationType(controller_->GetBrowserContext(), entry, reload_type); 1100 GetNavigationType(controller_->GetBrowserContext(), entry, reload_type);
1101 if (navigation_type == FrameMsg_Navigate_Type::NORMAL &&
clamy 2016/10/10 11:48:02 nit: add a comment explaining that a normal load o
scottmg 2016/10/11 19:52:32 Done.
1102 frame_tree_node->current_url() == entry.GetURL() &&
1103 !is_same_document_history_load) {
1104 navigation_type = FrameMsg_Navigate_Type::RELOAD_MAIN_RESOURCE;
nasko 2016/10/10 22:04:22 I think we are best doing this for both current na
scottmg 2016/10/11 19:52:32 I tried this, but Android seems to have some legac
1105 }
1101 std::unique_ptr<NavigationRequest> scoped_request = 1106 std::unique_ptr<NavigationRequest> scoped_request =
1102 NavigationRequest::CreateBrowserInitiated( 1107 NavigationRequest::CreateBrowserInitiated(
1103 frame_tree_node, dest_url, dest_referrer, frame_entry, entry, 1108 frame_tree_node, dest_url, dest_referrer, frame_entry, entry,
1104 navigation_type, lofi_state, is_same_document_history_load, 1109 navigation_type, lofi_state, is_same_document_history_load,
1105 is_history_navigation_in_new_child, navigation_start, controller_); 1110 is_history_navigation_in_new_child, navigation_start, controller_);
1106 NavigationRequest* navigation_request = scoped_request.get(); 1111 NavigationRequest* navigation_request = scoped_request.get();
1107 1112
1108 // Navigation to a javascript URL is not a "real" navigation so there is no 1113 // Navigation to a javascript URL is not a "real" navigation so there is no
1109 // need to create a NavigationHandle. The navigation commits immediately and 1114 // need to create a NavigationHandle. The navigation commits immediately and
1110 // the NavigationRequest is not assigned to the FrameTreeNode as navigating to 1115 // the NavigationRequest is not assigned to the FrameTreeNode as navigating to
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 if (navigation_handle) 1234 if (navigation_handle)
1230 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); 1235 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID());
1231 1236
1232 controller_->SetPendingEntry(std::move(entry)); 1237 controller_->SetPendingEntry(std::move(entry));
1233 if (delegate_) 1238 if (delegate_)
1234 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); 1239 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL);
1235 } 1240 }
1236 } 1241 }
1237 1242
1238 } // namespace content 1243 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698