Currently, restores usually (but not always) end up being treated as
back/forward navigations in the renderer,
but HistoryTypeUtils::IsHistory() returns false for restore
NavigationTypes. Add IsRestore() to IsHistory(), and ensure that
restores are always treated as back/forward in the renderer.
Fixed: 1423100
Change-Id: Ie13f6b7a7454c410f68760d429006b94189d7215
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4342495
Commit-Queue: Nate Chapin <japhet@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1119475}
This is a reland of 1a14cf6947
The previous breakage was caused by a recent commit
41094f7533, which uses the mojom structs
defined in navigation_params.mojom, but these structs have been moved
into blink by the reverted commit, which means we have to use these
structs with namespace blink instead of content.
This reland patch corrects the namespace.
Original change's description:
> [OnionSoup] Move navigation_params.mojom into blink
>
> Per OnionSoup project, we are going to move the NavigationBodyLoader
> into blink finally. In order to achieve that we have to move the
> navigation_params.mojom first, on which the NavigationBodyLoader
> depends.
>
> This patch moves the structs/enums defined in navigation_params.mojom
> to //third_party/blink/public/mojom/navigation/. Along with the
> relocation, some changes have been made to it:
>
> - The original struct Impression with Native attribute is replaced with
> blink.mojom.Impression that typemaps to blink::Impression.
> - The original struct PageState with Native attribute is replaced with
> type of string, which is the encoded version of blink::PageState.
> Methods CreateFromEncodedData()/ToEncodedData() of the PageState will
> be used to convert from/to std::string.
> - The original enum PageTransition with Native attribute is replaced
> with int32. We don't define another enum in mojom, because the member
> `transition` is not always assigned with an enumerator value, instead,
> sometimes it's the result of bitwise OR that takes the values of
> ui::PageTransition, which will fail the enum validation in mojom
> (although we could mark it as [Extensible], it's not suitable for this
> case). The method ui::PageTransitionFromInt() is used to
> convert int32_t to ui::PageTransition.
>
>
> Bug: 860403
> Change-Id: I8027a6e421a06dc526ad218099238e93fa4ddc17
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2925990
> Commit-Queue: Minggang Wang <minggang.wang@intel.com>
> Reviewed-by: Colin Blundell <blundell@chromium.org>
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#897296}
Bug: 860403
Change-Id: I61889a52a195d4e024e43a2b01f256b0c003dc96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2997326
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Minggang Wang <minggang.wang@intel.com>
Cr-Commit-Position: refs/heads/master@{#897778}
This reverts commit 1a14cf6947.
Reason for revert: this cl seems to break the tree 1/3
Original change's description:
> [OnionSoup] Move navigation_params.mojom into blink
>
> Per OnionSoup project, we are going to move the NavigationBodyLoader
> into blink finally. In order to achieve that we have to move the
> navigation_params.mojom first, on which the NavigationBodyLoader
> depends.
>
> This patch moves the structs/enums defined in navigation_params.mojom
> to //third_party/blink/public/mojom/navigation/. Along with the
> relocation, some changes have been made to it:
>
> - The original struct Impression with Native attribute is replaced with
> blink.mojom.Impression that typemaps to blink::Impression.
> - The original struct PageState with Native attribute is replaced with
> type of string, which is the encoded version of blink::PageState.
> Methods CreateFromEncodedData()/ToEncodedData() of the PageState will
> be used to convert from/to std::string.
> - The original enum PageTransition with Native attribute is replaced
> with int32. We don't define another enum in mojom, because the member
> `transition` is not always assigned with an enumerator value, instead,
> sometimes it's the result of bitwise OR that takes the values of
> ui::PageTransition, which will fail the enum validation in mojom
> (although we could mark it as [Extensible], it's not suitable for this
> case). The method ui::PageTransitionFromInt() is used to
> convert int32_t to ui::PageTransition.
>
>
> Bug: 860403
> Change-Id: I8027a6e421a06dc526ad218099238e93fa4ddc17
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2925990
> Commit-Queue: Minggang Wang <minggang.wang@intel.com>
> Reviewed-by: Colin Blundell <blundell@chromium.org>
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#897296}
Bug: 860403
Change-Id: I2f97fa762a32aa41379470faa1f3c94f16b8aefe
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2996123
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Swapnil Gupta <swapnilgupta@google.com>
Commit-Queue: Anatoliy Potapchuk <apotapchuk@chromium.org>
Owners-Override: Anatoliy Potapchuk <apotapchuk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#897307}
Per OnionSoup project, we are going to move the NavigationBodyLoader
into blink finally. In order to achieve that we have to move the
navigation_params.mojom first, on which the NavigationBodyLoader
depends.
This patch moves the structs/enums defined in navigation_params.mojom
to //third_party/blink/public/mojom/navigation/. Along with the
relocation, some changes have been made to it:
- The original struct Impression with Native attribute is replaced with
blink.mojom.Impression that typemaps to blink::Impression.
- The original struct PageState with Native attribute is replaced with
type of string, which is the encoded version of blink::PageState.
Methods CreateFromEncodedData()/ToEncodedData() of the PageState will
be used to convert from/to std::string.
- The original enum PageTransition with Native attribute is replaced
with int32. We don't define another enum in mojom, because the member
`transition` is not always assigned with an enumerator value, instead,
sometimes it's the result of bitwise OR that takes the values of
ui::PageTransition, which will fail the enum validation in mojom
(although we could mark it as [Extensible], it's not suitable for this
case). The method ui::PageTransitionFromInt() is used to
convert int32_t to ui::PageTransition.
Bug: 860403
Change-Id: I8027a6e421a06dc526ad218099238e93fa4ddc17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2925990
Commit-Queue: Minggang Wang <minggang.wang@intel.com>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#897296}
It's possible to determine which navigations would result in replacement
completely on the browser side. This CL calculates the value of
DidCommitParams' should_replace_current_entry in the browser and
compares it against the actual result from the renderer.
This CL also helps us remove any changes to the navigation type
(whether it would do a replacement/reload) in the renderer during commit
through FrameLoader::DetermineFrameLoadType(), which is removed in
crrev.com/c/2790000.
Bug: 1068965, 1131832
Change-Id: Ic69004892b2a8e3b158a7965ce6621ab997ecfda
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2793205
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Alex Turner <alexmt@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#875126}