Track same-document navigation source with DidCommitSameDocumentNavigationParams
Introduces DidCommitSameDocumentNavigationParams, which currently only
contains one field: is_history_api_navigation, to distinguish history
API vs fragment change same-document navigations. This is needed to
determine the "method" value for same-document navigations - the history
API would override the method to "GET", while fragment navigations will
reuse the method from the last navigation (for more details, see
DocumentLoader::UpdateForSameDocumentNavigation).
This CL also fixes code that either assumed all same-document
navigations use GET (NavigationRequest::CreateForCommit), or all
same-document navigations reuse last navigation's method
(RenderFrameHostImpl::DidCommitNewDocument).
See same-document navigation refactor doc:
https: //docs.google.com/document/d/1a2rBxTR5vN6WD-LfJrF0FdEzMmFn_WVgeUS4I9z041k/edit?usp=sharing
Bug: 1133115, 1131832
Change-Id: I85c5ab6b7ac75597a459a1faf9845000551e2314
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2556732
Commit-Queue: Rakina Zata Amni <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Nasko Oskov <[email protected]>
Cr-Commit-Position: refs/heads/master@{#833252}
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
index 6867426..8c41fa6 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -464,7 +464,8 @@
// Sent by the renderer to indicate that a same document navigation
// committed in the renderer process.
DidCommitSameDocumentNavigation(
- DidCommitProvisionalLoadParams params);
+ DidCommitProvisionalLoadParams params,
+ DidCommitSameDocumentNavigationParams same_document_params);
// Sent by the renderer to request a navigation.
// |blob_url_token| should be non-null when this is a navigation to a blob: