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

Unified Diff: content/browser/frame_host/navigator_impl.cc

Issue 2661743002: PlzNavigate: Invoke didStartProvisionalLoad() when the renderer initiates a navigation in startLoad( (Closed)
Patch Set: Remove CHECK for redirect chain as the redirects may not be populated for provisional loads for ren… Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/test_runner/web_frame_test_proxy.h ('k') | content/public/renderer/render_frame_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f50df19c3f70b998bbb8f8b5fc00ed3c2de448a7..0c34b760f629ae56c9c4c8fa0b69852949bee897 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -1243,11 +1243,20 @@ void NavigatorImpl::DidStartMainFrameNavigation(
bool has_browser_initiated_pending_entry =
pending_entry && !pending_entry->is_renderer_initiated();
+ // PlzNavigate
+ // A pending navigation entry is created in OnBeginNavigation(). The renderer
+ // sends a provisional load notification after that. We don't want to create
+ // a duplicate navigation entry here.
+ bool renderer_provisional_load_to_pending_url =
+ pending_entry && pending_entry->is_renderer_initiated() &&
+ (pending_entry->GetURL() == url);
+
// If there is a transient entry, creating a new pending entry will result
// in deleting it, which leads to inconsistent state.
bool has_transient_entry = !!controller_->GetTransientEntry();
- if (!has_browser_initiated_pending_entry && !has_transient_entry) {
+ if (!has_browser_initiated_pending_entry && !has_transient_entry &&
+ !renderer_provisional_load_to_pending_url) {
std::unique_ptr<NavigationEntryImpl> entry =
NavigationEntryImpl::FromNavigationEntry(
controller_->CreateNavigationEntry(
« no previous file with comments | « components/test_runner/web_frame_test_proxy.h ('k') | content/public/renderer/render_frame_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698