0
Commit Graph

5 Commits

Author SHA1 Message Date
Arthur Sonzogni
c686e8f4fd Rename {absl => std}::optional in //content/
Automated patch, intended to be effectively a no-op.

Context:
https://groups.google.com/a/chromium.org/g/cxx/c/nBD_1LaanTc/m/ghh-ZZhWAwAJ?utm_medium=email&utm_source=footer

As of https://crrev.com/1204351, absl::optional is now a type alias for
std::optional. We should migrate toward it.

Script:
```
function replace {
  echo "Replacing $1 by $2"
  git grep -l "$1" \
    | cut -f1 -d: \
    | grep \
      -e "^content" \
    | sort \
    | uniq \
    | grep \
      -e "\.h" \
      -e "\.cc" \
      -e "\.mm" \
      -e "\.py" \
    | xargs sed -i "s/$1/$2/g"
}
replace "absl::make_optional" "std::make_optional"
replace "absl::optional" "std::optional"
replace "absl::nullopt" "std::nullopt"
replace "absl::in_place" "std::in_place"
replace "absl::in_place_t" "std::in_place_t"
replace "\"third_party\/abseil-cpp\/absl\/types\/optional.h\"" "<optional>"
git cl format
```

# Skipping unrelated "check_network_annotation" errors.
NOTRY=True

Bug: chromium:1500249
Change-Id: Icfd31a71d8faf63a2e8d5401127e7ee74cc1c413
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5185537
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1245739}
2024-01-11 08:36:37 +00:00
Camillia Smith Barnes
0e416b3d3b Shared Storage: Browser PermissionsPolicy check for headers
We pay down some tech debt by adding a browser-side
`PermissionsPolicy` check for the
`blink::mojom::PermissionsPolicyFeature::kSharedStorage` feature
in the cases where the initial check was done by the renderer.

For the iframe navigation case, however, since the initial
permissions policy check for shared storage writing from an iframe
navigation request already occurs in the browser process in
`NavigationRequest`, it's not absolutely necessary to do a double
check, and so if we are unable to perform one due to not being able
to obtain the parent policy, we skip the check and proceed with the
operation(s). Whereas, in non-navigation-initiated cases, if we are
unable to perform the check, we drop any operation(s).

While we're at it, we pass in the `NavigationOrDocumentHandle` to
`SharedStorageHeaderObserver::HeaderReceived()` instead of the
`RenderFrameHost`, and add a method
`NavigationOrDocumentHandle::GetTopFrameOrigin()`, to try to avoid
having to create a new opaque origin for the user profile preferences
check in the case when a `RenderFrameHost` is not available to help us
access the main frame's last committed origin.

We also add a couple of metrics related to the above.

Note that in "SharedStorageHeaderObserverTest", we swap out the
`ContentBrowserClient` for a derived `MockContentBrowserClient`
instance to control the return value of
`MockContentBrowserClient::IsSharedStorageAllowed()`.

Bug: 1434529,1218540
Change-Id: I7020626511215bbfc1972e6a3fddef5432b95cd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4944272
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1239898}
2023-12-20 23:40:10 +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
Yeunjoo Choi
2ffd21cc9e [mparch] Use the correct navigation controller in SSLManager::OnSSLCertificateError
Since SSLManager is bound to NavigationController not WebContents,
it should get the associated navigation controller instead of the
primary navigation controller. Therefore this CL passes
NavigationOrDocumentHandle to SSLManager::OnSSLCertificateError, so
that SSLManager plumbs the correct navigation controller.

Bug: 1284189
Change-Id: Iaca620f12798e7f99312d22f9c72e1a6942f919b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3366165
Reviewed-by: Adam Langley <agl@chromium.org>
Reviewed-by: Kevin McNee <mcnee@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Yeunjoo Choi <ychoi@igalia.com>
Cr-Commit-Position: refs/heads/main@{#990269}
2022-04-08 05:26:33 +00:00
Julie Jeongeun Kim
4a5fef2495 Improve FrameTreeNode tracking in URLLoaderNetworkContext
In the current code, URLLoaderNetworkContext in StoragePartitionImpl
is created for a document, service worker, or a navigation. For a
document, it's tracking with RenderFrameHostImpl and, for navigation,
it's tracking with a FrameTreeNode ID.
It has three different incompatible uses of Routing ID for navigation
request, a frame, or service worker.
Here, we're also using the FrameTreeNode id as a proxy, but it's not
ideal as the navigation can be canceled and another navigation can
start in the same FrameTreeNode.

This CL introduces NavigationOrDocumentHandle that has a weak ptr
to RenderFrameHostImpl or NavigationRequest and
URLLoaderNetworkContext is created with it.

It includes several changes,
- it introduces NavigationOrDocumentHandle to support a seamless
transfer from a navigation to a committed document. It has
RenderFrameHost or NavigationRequest for the network context.
If the context is created for a navigation request, its
RenderFrameHost member is populated when the navigation is
committed.
- it incorporates two CancelIfPrerendering() helpers, one with
`frame_tree_node_id` and the other with `render_frame_host_id`,
by taking NavigationOrDocumentHandle.
- RenderFrameHost and NavigationRequest create
NavigationOrDocumentHandle and URLLoaderNetworkContext refers to
them when they are created.

This is a follow-up CL of https://crrev.com/c/3261291

Bug: 1241836, 1239554
Change-Id: I2c6abe17436c276c460e1721fc8b1ef2b38a5ae0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3341866
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Julie Jeongeun Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/main@{#988227}
2022-04-02 02:08:38 +00:00