0
Commit Graph

8 Commits

Author SHA1 Message Date
Charlie Reis
4c53a96c20 Replace ReloadType::ORIGINAL_REQUEST_URL with LoadOriginalRequestURL.
When reloading the current NavigationEntry using the original request's
URL, it is safer to treat it as a new navigation to the URL with
replacement, rather than using any of the state from the
NavigationEntry for a different URL.

Bug: 1427288
Change-Id: Iceae630f17bc8091637d500512f887fa5796070c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4370988
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Charlie Reis <creis@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Reviewed-by: Chris Bookholt <bookholt@chromium.org>
Reviewed-by: Theresa Sullivan <twellington@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1160920}
2023-06-21 23:17:53 +00:00
Nate Chapin
da1fc681df Treat restore navigations as a subset of history navigations
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}
2023-03-20 18:14:36 +00:00
Avi Drissman
4e1b7bc33d Update copyright headers in content/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: I8c0f009d16350271f07d8e5e561085822cc9dd27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3895935
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047456}
2022-09-15 14:03:50 +00:00
Minggang Wang
b9f3fa96cf Reland "[OnionSoup] Move navigation_params.mojom into blink"
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}
2021-07-01 15:30:31 +00:00
Anatoliy Potapchuk
27278cce28 Revert "[OnionSoup] Move navigation_params.mojom into blink"
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}
2021-06-30 09:45:31 +00:00
Minggang Wang
1a14cf6947 [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}
2021-06-30 09:17:19 +00:00
Rakina Zata Amni
e65284c449 Calculate should_replace_current_entry in the browser
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}
2021-04-22 12:24:50 +00:00
Lucas Furukawa Gadani
ef8290afc5 Convert content::CommonNavigationParams to mojom.
Bug: 984550
Change-Id: Id0acde76f86c50a2568d050c7b082d6510c3c108
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1700291
Reviewed-by: Tao Bai <michaelbai@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681955}
2019-07-29 20:27:51 +00:00