0
Commit Graph

102 Commits

Author SHA1 Message Date
Yao Xiao
08d1543f81 [shared storage] Implement the batch with_lock option for response header
Parse "options;with_lock=xxx" into the `with_lock` parameter. If
multiple "options" Items appear in the List, the last one will be
used. The parsed value is passed to the browser process's
`BatchUpdate()` API in the lock manager.

This allows developers to perform multiple Shared Storage operations
atomically within a single lock, as part of the Web Lock integration
proposal:
- https://github.com/WICG/shared-storage/pull/199
- https://github.com/WICG/shared-storage/pull/205

Bug: 373899210
Change-Id: Id041e92075b22988656a3db4f1a74792312ee422
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072742
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1397664}
2024-12-17 16:56:36 -08:00
Yao Xiao
7177f6736f [shared storage] Implement with_lock option for methods from response headers
Explainer PR(s):
- https://github.com/WICG/shared-storage/pull/199
- https://github.com/WICG/shared-storage/pull/205

How:
- Add the parameter parsing logic in the network service, and send the
  final request to the browser process's central
  SharedStorageLockManager component.
- Since SharedStorageLockManager::SharedStorageUpdate() hides the
  exact database result, we update observer's OnMethodFinished()'s
  parameters accordingly. In the test observer, the error message is
  further transformed into a boolean 'success' result. This callback
  is only used in tests and it's not important to assert the detailed
  result anyway.
- A new test, `SharedStorageHeaderObserverTest.Append_NoCapacity`,
  has been added to demonstrate the case where `SharedStorageUpdate`
  encounters an error.

Bug: 373899210
Change-Id: I4588c83174d465e7248cc1f41c9b7a693aa326f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6042601
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1388298}
2024-11-26 17:22:50 +00:00
Yao Xiao
504f31d14b [shared storage] Use the common mojom type for OnSharedStorageHeaderReceived()
Refactor OnSharedStorageHeaderReceived() to utilize the common
mojom union type for shared storage headers. This alignment
eliminates code duplication, reducing maintenance overhead and the
risk of inconsistencies between the network service and Blink.

As part of this refactor, some validation is moved to the network
service (e.g. `key` length validation). There's no behavior change
overall: Unrecognized methods and parameters continue to be skipped,
and valid methods are processed as before.

Additionally, to resolve a "duplicate symbol" link error on Windows,
(due to url_loader_base now depends on mojom_shared_storage, and
blink's mojom_platform depends on url_loader_base) we include the
`mojom_shared_storage` target in mojom("mojom_modules")'s
overridden_deps_blink, and switch to PLATFORM_EXPORT from
MODULES_EXPORT for relevant files.

Bug: 373899210
Change-Id: I8fda87ad6bea7994d84ac1100e4d96a138cb444f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5990970
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1385815}
2024-11-20 19:32:15 +00:00
Dan McArdle
a9fa67478c GlobalRequestID: Avoid unwanted inlining and narrowing int conversions
This CL moves the definition of GlobalRequestID::MakeBrowserInitiated()
out of the header file to prevent inlining. The method relies on a
static local atomic to guarantee that it vends unique IDs. Although a
statically-linked binary would only have a single definition for
MakeBrowserInitiated(), component builds could be problematic. If there
were multiple copies of MakeBrowserInitiated(), it would not be
guaranteed to vend unique IDs.

Separately, this CL also sidesteps some implementation-defined narrowing
integer conversions related to the `child_id` and `request_id` fields.

Bug: 352690892, 40065303
Change-Id: I49ac933a663bbce225b1098f38c8d4e5dfe3d237
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5702737
Reviewed-by: Joe Downing <joedow@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Adam Rice <ricea@chromium.org>
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1328175}
2024-07-16 15:13:50 +00:00
Jonathan Hao
3e33cb08b8 [Private Network Access] Log UseCounter for WebSocket
Delegate the OnConnected from net to the network service, which then
makes an IPC call to content browser which can then log the use counter
to the right frame.

Bug: 40234396
Change-Id: Ie9cf91aad6614ac28b117a5c51009e096d1fed7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5291080
Auto-Submit: Jonathan Hao <phao@chromium.org>
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Commit-Queue: Jonathan Hao <phao@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Theresa Sullivan <twellington@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1269153}
2024-03-06 19:36:01 +00:00
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
Yifan Luo
4d98cd6999 [Private Network Access] Turn id and name into optional
`Private-Network-Access-Name` and `Private-Network-Access-Id` can be
optional. In this case, the IP address will be shown on the permission
prompt.

Bug: 1338439
Change-Id: Icd1fcd39b13de4e3a1d2c5415a2c516e4f4f594c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4919478
Commit-Queue: Yifan Luo <lyf@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Camille Lamy <clamy@chromium.org>
Reviewed-by: Yifan Luo <lyf@chromium.org>
Auto-Submit: Yifan Luo <lyf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1209322}
2023-10-13 10:22:43 +00:00
Liza Burakova
1595a781b3 Reland "Remove USE_SOCKET_BROKER buildflag"
This is a reland of commit 4f0b23a34a

Original change's description:
> Remove USE_SOCKET_BROKER buildflag
>
> The USE_SOCKET_BROKER flag was just "is_android || is_win" and since
> the network service sandbox will not run on android this flag can be
> replaced with just IS_WIN
>
> Bug: 1485298
> Change-Id: I8f153aa4ce3afc6442f47ce62db675385e9ff7e5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4880087
> Commit-Queue: Liza Burakova <liza@chromium.org>
> Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1201616}

Bug: 1485298
Change-Id: I8b304773a4433fdac38fc2ee6ce8850f8196eb51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4894375
Commit-Queue: Liza Burakova <liza@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1201983}
2023-09-27 15:03:32 +00:00
luci-bisection@appspot.gserviceaccount.com
8e8f67232b Revert "Remove USE_SOCKET_BROKER buildflag"
This reverts commit 4f0b23a34a.

Reason for revert:
LUCI Bisection identified this CL as the culprit of a build failure. See the analysis: https://luci-bisection.appspot.com/analysis/b/8768877340792539265

Sample failed build: https://ci.chromium.org/b/8768877340792539265

If this is a false positive, please report it at https://bugs.chromium.org/p/chromium/issues/entry?comment=Analysis%3A+https%3A%2F%2Fluci-bisection.appspot.com%2Fanalysis%2Fb%2F8768877340792539265&components=Tools%3ETest%3EFindit&labels=LUCI-Bisection-Wrong%2CPri-3%2CType-Bug&status=Available&summary=Wrongly+blamed+https%3A%2F%2Fchromium-review.googlesource.com%2Fc%2Fchromium%2Fsrc%2F%2B%2F4880087

Original change's description:
> Remove USE_SOCKET_BROKER buildflag
>
> The USE_SOCKET_BROKER flag was just "is_android || is_win" and since
> the network service sandbox will not run on android this flag can be
> replaced with just IS_WIN
>
> Bug: 1485298
> Change-Id: I8f153aa4ce3afc6442f47ce62db675385e9ff7e5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4880087
> Commit-Queue: Liza Burakova <liza@chromium.org>
> Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1201616}
>

Bug: 1485298
Change-Id: I81062da7919b4ea40a8138d51356bc7af1f3b9f9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4893896
Commit-Queue: luci-bisection@appspot.gserviceaccount.com <luci-bisection@appspot.gserviceaccount.com>
Bot-Commit: luci-bisection@appspot.gserviceaccount.com <luci-bisection@appspot.gserviceaccount.com>
Owners-Override: luci-bisection@appspot.gserviceaccount.com <luci-bisection@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1201634}
2023-09-26 16:22:48 +00:00
Liza Burakova
4f0b23a34a Remove USE_SOCKET_BROKER buildflag
The USE_SOCKET_BROKER flag was just "is_android || is_win" and since
the network service sandbox will not run on android this flag can be
replaced with just IS_WIN

Bug: 1485298
Change-Id: I8f153aa4ce3afc6442f47ce62db675385e9ff7e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4880087
Commit-Queue: Liza Burakova <liza@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1201616}
2023-09-26 15:58:02 +00:00
Yifan Luo
e91e9fba0a [Private Network Access] Trigger Permission Prompt
This CL added a new function `OnPrivateNetworkAccessPermissionRequired`,
to `URLLoaderNetworkServiceObserver` to trigger the private network
access permission prompt from `CorsUrlLoader` after receiving a valid
PNA preflight response.

The permission prompt is triggered only when a request created from a
secure context to a non-secure local device. `private-network-access-id` and `private-network-access-name` are required in the preflight response header to trigger the permission prompt. Otherwise the request will be
denied.

See more: https://docs.google.com/document/d/1Q18g4fZoDIYQ9IuxlZTaItgkzfiz_tCqaEAI8J3Y1WY/edit?usp=sharing

Bug: 1338439
Change-Id: I03586272cd404cc6dbceeaada09d21382760c4c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4593350
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Commit-Queue: Yifan Luo <lyf@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1160770}
2023-06-21 18:47:23 +00:00
Matt Mueller
70e3c429b0 Split CertDatabase notifications between trust changes and client cert changes
Bug: 915463
Change-Id: Ieda96f9e17ac69238c8c19f6737e5930c3acb312
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4596317
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Chris Thompson <cthomp@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: Chad Duffin <chadduffin@chromium.org>
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: Pavol Marko <pmarko@chromium.org>
Commit-Queue: Matt Mueller <mattm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1157277}
2023-06-14 00:21:03 +00:00
Camillia Smith Barnes
76d6da969c Reland "Shared Storage: Add mojo method for observing response headers"
This is a reland of commit 8313ecff25

The original had tests in shared_storage_header_observer_unittest.cc
failing on bots where DCHECK was disabled, as the test suite class
performed UTF conversion inside the DCHECK (and hence the conversion
was not happening on these bots).

We fix the erroneous test class methods so that the conversions
happen regardless of whether DCHECK is enabled, by verifying that
the conversion was successful with an EXPECT_TRUE instead.

Original change's description:
> Shared Storage: Add mojo method for observing response headers
>
> We are adding support for writing to Shared Storage from response
> headers. In a later CL, we will add code in the network service to
> parse the response headers. The parsed Shared Storage response headers
> will then be sent to the `StoragePartitionImpl` in the browser process
> via the  `network::mojom::URLLoaderNetworkServiceObserverObserver`
> interface. From there, the information from the headers will be
> forwarded to the new `SharedStorageHeaderObserver` class, where, if
> valid, they will trigger calls to actual shared storage operations.
>
> Integration tests will be added in the follow-up CL
> https://crrev.com/c/4519162.
>
> This is part of a project to add support to writing to shared storage
> from response headers. See
> https://github.com/WICG/shared-storage/pull/70 for more information
> and https://crrev.com/c/4444068 for a working prototype for `fetch()`.
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 1434529,1218540
> Change-Id: I02cc34eede4dab32360ee09c5e05b02bc96e1325
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4519161
> Reviewed-by: Eric Orth <ericorth@chromium.org>
> Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1151469}

Fuchsia-Binary-Size: Size increase is unavoidable.
Bug: 1434529,1218540
Change-Id: I6a4bacb014a4ef4089750bfd2573aac63e6aa56d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4576878
Reviewed-by: Eric Orth <ericorth@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1152032}
2023-06-01 18:54:27 +00:00
Solomon Kinard
ddf0627055 Revert "Shared Storage: Add mojo method for observing response headers"
This reverts commit 8313ecff25.

Reason for revert: Suspected test failures https://ci.chromium.org/ui/p/chromium/builders/ci/fuchsia-arm64-rel/6790/overview. Cammie asked for the revert after a larger chat.

Original change's description:
> Shared Storage: Add mojo method for observing response headers
>
> We are adding support for writing to Shared Storage from response
> headers. In a later CL, we will add code in the network service to
> parse the response headers. The parsed Shared Storage response headers
> will then be sent to the `StoragePartitionImpl` in the browser process
> via the  `network::mojom::URLLoaderNetworkServiceObserverObserver`
> interface. From there, the information from the headers will be
> forwarded to the new `SharedStorageHeaderObserver` class, where, if
> valid, they will trigger calls to actual shared storage operations.
>
> Integration tests will be added in the follow-up CL
> https://crrev.com/c/4519162.
>
> This is part of a project to add support to writing to shared storage
> from response headers. See
> https://github.com/WICG/shared-storage/pull/70 for more information
> and https://crrev.com/c/4444068 for a working prototype for `fetch()`.
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 1434529,1218540
> Change-Id: I02cc34eede4dab32360ee09c5e05b02bc96e1325
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4519161
> Reviewed-by: Eric Orth <ericorth@chromium.org>
> Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1151469}

Bug: 1434529,1218540
Change-Id: Id8e25be6000204c848d2d1d80e6b44ad8b568dfb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4577370
Reviewed-by: David Bertoni <dbertoni@chromium.org>
Commit-Queue: Solomon Kinard <solomonkinard@google.com>
Auto-Submit: Solomon Kinard <solomonkinard@chromium.org>
Owners-Override: Solomon Kinard <solomonkinard@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1151564}
2023-05-31 23:58:52 +00:00
Camillia Smith Barnes
8313ecff25 Shared Storage: Add mojo method for observing response headers
We are adding support for writing to Shared Storage from response
headers. In a later CL, we will add code in the network service to
parse the response headers. The parsed Shared Storage response headers
will then be sent to the `StoragePartitionImpl` in the browser process
via the  `network::mojom::URLLoaderNetworkServiceObserverObserver`
interface. From there, the information from the headers will be
forwarded to the new `SharedStorageHeaderObserver` class, where, if
valid, they will trigger calls to actual shared storage operations.

Integration tests will be added in the follow-up CL
https://crrev.com/c/4519162.

This is part of a project to add support to writing to shared storage
from response headers. See
https://github.com/WICG/shared-storage/pull/70 for more information
and https://crrev.com/c/4444068 for a working prototype for `fetch()`.

Fuchsia-Binary-Size: Size increase is unavoidable.
Bug: 1434529,1218540
Change-Id: I02cc34eede4dab32360ee09c5e05b02bc96e1325
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4519161
Reviewed-by: Eric Orth <ericorth@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1151469}
2023-05-31 21:06:52 +00:00
Matthew Denton
ce1ba15499 Linux: Use NetworkChangeNotifierPassive in network service
Currently, the network service is using NetworkChangeNotifierLinux,
which uses AddressTrackerLinux. Usage of AddressTrackerLinux is being
moved out of the network service as part of the network service sandbox
project, as AddressTrackerLinux uses netlink sockets which shouldn't be
allowed in the sandbox.

This CL syncs changes from a NetworkChangeNotifierLinux that runs in
the browser process to a NetworkChangeNotifierPassive that runs in the
network, which is identical to Android's mechanism (when it is running
an out-of-process network service).

This feature comes with a kill switch.

Bug: 1312226
Change-Id: I390d61b519eb93798bd46eb402e50740c7295b61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4025032
Reviewed-by: Adam Rice <ricea@chromium.org>
Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1126816}
2023-04-05 20:58:26 +00:00
Dylan Cutler
72ac5509c7 Reland "Make Clear-Site-Data: "cookies" respect third-party cookie blocking"
The failure in the rollback [1] is because one cookie was not cleared when the first CSD header is sent in clear_site_data_handler_browsertest.cc. This should only be possible if 3P cookie blocking is already enabled at the beginning of the test.

To patch this, I explicitly disable 3PCB at the start of the test.

To be conservative, I also explicitly enable the partitioned cookies feature so that it does not rely on the environment's default. Right now, partitioned cookies are enabled via the field trial testing config.

[1]: https://ci.chromium.org/ui/p/chrome/builders/ci/linux-chromeos-chrome/31221/overview

This is a reland of commit d27d50661e

Original change's description:
> Make Clear-Site-Data: "cookies" respect third-party cookie blocking
>
> This will prevent Clear-Site-Data from being abused for cross-site
> tracking [1] when partitioned cookies are enabled by default.
>
> [1]: https://github.com/privacycg/storage-partitioning/issues/11
>
> Old behavior: Clear-Site-Data could clear unpartitioned cookies from any context.
>
> New behavior: Clear-Site-Data cannot clear unpartitioned cookies if it came from a response where 3P cookie blocking applies.
>
> In both cases, CSD will delete partitioned cookies in the current partition.
>
> Low-Coverage-Reason:Some files have trial changes that do not impact behavior.
>
> Bug: 1416655
> Change-Id: Ieed1e050f8f376b7d7704b4948c8f59adc21a17f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4312585
> Reviewed-by: Nasko Oskov <nasko@chromium.org>
> Reviewed-by: Andrey Zaytsev <andzaytsev@google.com>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Reviewed-by: Daniel Murphy <dmurph@chromium.org>
> Commit-Queue: Dylan Cutler <dylancutler@google.com>
> Reviewed-by: Christian Dullweber <dullweber@chromium.org>
> Reviewed-by: Oleh Lamzin <lamzin@google.com>
> Cr-Commit-Position: refs/heads/main@{#1118080}

Bug: 1416655
Change-Id: I10e54ba18587c7c9a838e79dd52a535b5e8ff751
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4346675
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Commit-Queue: Dylan Cutler <dylancutler@google.com>
Reviewed-by: Oleh Lamzin <lamzin@google.com>
Reviewed-by: Andrey Zaytsev <andzaytsev@google.com>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1119580}
2023-03-20 20:54:05 +00:00
Marijn Kruisselbrink
726c5b195c Revert "Make Clear-Site-Data: "cookies" respect third-party cookie blocking"
This reverts commit d27d50661e.

Reason for revert: New test is failing on https://ci.chromium.org/ui/p/chrome/builders/ci/linux-chromeos-chrome/31221/overview

clear_site_data_handler_browsertest.cc(788): Expected equality of these values:
  0u
    Which is: 0
  cookies.size()
    Which is: 1

Original change's description:
> Make Clear-Site-Data: "cookies" respect third-party cookie blocking
>
> This will prevent Clear-Site-Data from being abused for cross-site
> tracking [1] when partitioned cookies are enabled by default.
>
> [1]: https://github.com/privacycg/storage-partitioning/issues/11
>
> Old behavior: Clear-Site-Data could clear unpartitioned cookies from any context.
>
> New behavior: Clear-Site-Data cannot clear unpartitioned cookies if it came from a response where 3P cookie blocking applies.
>
> In both cases, CSD will delete partitioned cookies in the current partition.
>
> Low-Coverage-Reason:Some files have trial changes that do not impact behavior.
>
> Bug: 1416655
> Change-Id: Ieed1e050f8f376b7d7704b4948c8f59adc21a17f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4312585
> Reviewed-by: Nasko Oskov <nasko@chromium.org>
> Reviewed-by: Andrey Zaytsev <andzaytsev@google.com>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Reviewed-by: Daniel Murphy <dmurph@chromium.org>
> Commit-Queue: Dylan Cutler <dylancutler@google.com>
> Reviewed-by: Christian Dullweber <dullweber@chromium.org>
> Reviewed-by: Oleh Lamzin <lamzin@google.com>
> Cr-Commit-Position: refs/heads/main@{#1118080}

Bug: 1416655
Change-Id: I029da51c8049fff9b8a2d49ac53b3243b2e3435c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4346993
Owners-Override: Marijn Kruisselbrink <mek@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1118169}
2023-03-16 17:15:09 +00:00
Dylan Cutler
d27d50661e Make Clear-Site-Data: "cookies" respect third-party cookie blocking
This will prevent Clear-Site-Data from being abused for cross-site
tracking [1] when partitioned cookies are enabled by default.

[1]: https://github.com/privacycg/storage-partitioning/issues/11

Old behavior: Clear-Site-Data could clear unpartitioned cookies from any context.

New behavior: Clear-Site-Data cannot clear unpartitioned cookies if it came from a response where 3P cookie blocking applies.

In both cases, CSD will delete partitioned cookies in the current partition.

Low-Coverage-Reason:Some files have trial changes that do not impact behavior.

Bug: 1416655
Change-Id: Ieed1e050f8f376b7d7704b4948c8f59adc21a17f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4312585
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Andrey Zaytsev <andzaytsev@google.com>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Commit-Queue: Dylan Cutler <dylancutler@google.com>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Oleh Lamzin <lamzin@google.com>
Cr-Commit-Position: refs/heads/main@{#1118080}
2023-03-16 14:21:00 +00:00
Yoichi Osato
0803e4be63 Remove net::NetworkChangeNotifier::DNSObserver interface from NetworkServiceClient.
This pass was introduced to enable out-of-process network service for
Android 3 years ago ([1]).
However, the flags is not yet enabled and no bots has not tested the
out-of-process flag.
As a result of other code change, turning the flag caused the network
service crash, which means no one use this pass any longer.
To enable the OOP flag again, remove this pass.
FYI, DNS observing will be implemented in another way ([2]).

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1469063
[2] https://docs.google.com/document/d/1-rRP9ENaTrrU-RGuR9xZ1_Ei8dJe9o2u8Gk_335AxqE


Bug: 1360699
Change-Id: I4631589007aa7601f24e2984de0f177385f91f58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3970277
Auto-Submit: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1062031}
2022-10-21 11:14:42 +00:00
Takashi Toyoshima
bfc3b28143 NetworkService: move content/browser/net to content/browser/network
As now the content/browser/net directory is more like services/network
code base, I'd rename it as content/browser/network and add the
//services/network/OWNERS.

Bug: n/a
Change-Id: I71f78a7184399f245d6f6df6ab0790e6e124961b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3934080
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1056576}
2022-10-07 23:51:37 +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
Will Harris
e20990e149 Add Windows support to network socket brokering.
This enables brokering on Windows for supported socket types (TCP).

BrokeredClientSocketFactory is also updated to delegate to
non-brokered sockets for SSL and UDP in order for the browser
to function.

Currently all TCP sockets are brokered but a future CL will add
a filter to only broker sockets that are intended for communications
with services bound to local network interfaces.

This CL also enables all the tests for Windows.

BUG=1295463,841001

Change-Id: I44ca9c99950560476a0fcd7d136589edc92b796c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3868532
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1045125}
2022-09-09 15:38:43 +00:00
Will Harris
7bcc5283f5 Change socket broker to depend on build flag rather than directly on OS.
Socket broker support will soon be expanded to OS other than Android.
In order to facilitate this, this CL defines a buildflag for the
supported OS, and replaces IS_ANDROID with this flag.

This CL also fixes a case where sandbox might be enabled by policy and
the broker would not be emplaced in this situation.

BUG=1348331

Change-Id: I3b06720849ffe6069796a1dd6f305ef78c982fa9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3792907
Commit-Queue: Will Harris <wfh@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1029554}
2022-07-29 00:51:03 +00:00
Liza Burakova
2707060709 Connect the network service to the socket broker in the browser process.
When the network service sandbox is enabled on Android, this will create
a socket broker instance associated with the NetworkContext and pass it
to the network service. This also adds an end-to-end test for TCP socket
brokering.

Bug: 1295460
Change-Id: Id52fbe93b681ff04423ea6efd4995577407df131
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3638642
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Liza Burakova <liza@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1019960}
2022-07-01 05:27:40 +00:00
Yutaka Hirano
136bd91bc5 Call NetworkService::GetNetworkChangeManager after initialization
Currently we call network::mojom::NetworkService::GetNetworkChangeManager
before calling NetworkService::SetParams, which is problematic. This
change fixes that by adding
NetworkServiceClient::OnNetworkServiceInitialized().

Bug: 1291971
Change-Id: If909f9f8dd72cb062080691ecba866c92ae5deea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3423726
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/main@{#965215}
2022-01-31 16:26:11 +00:00
Xiaohan Wang
1ecfd006fd content: Use BUILDFLAG for OS checking
Use BUILDFLAG(IS_XXX) instead of defined(OS_XXX).

Generated by `os_buildflag_migration.py` (https://crrev.com/c/3311983).

R=thakis@chromium.org

Bug: 1234043
Test: No functionality change
Change-Id: Ia0eae6f9396065e190929d42600012c9324c07e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3399774
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Owners-Override: Xiaohan Wang <xhwang@chromium.org>
Auto-Submit: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#961157}
2022-01-19 22:33:10 +00:00
Dylan Cutler
108a4192b4 Clear-Site-Data support for partitioned cookies
Currently, when a site sends the Clear-Site-Data response header with
the "cookies" string, we clear all cookies for the request URL's domain.

After CHIPS, https://github.com/WICG/CHIPS, we want the Clear-Site-Data
to clear cookies set with the Partitioned attribute only if their
cookie partition key matches the partition key derived from the
request's NetworkIsolationKey. This additional constraint prevents sites
abusing the Partitioned attribute and Clear-Site-Data in order to
construct a cross-site identifier. For more information on this vector
for abuse, see
https://github.com/privacycg/storage-partitioning/issues/11
which discusses it in the context of partitioned storage since the same
principle applies to cookies.

Bug: 1225444
Change-Id: Icee3bc17d5ac1559e9591c0c90c466043bd22696
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3249211
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Oleh Lamzin <lamzin@google.com>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Finnur Thorarinsson <finnur@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Commit-Queue: Dylan Cutler <dylancutler@google.com>
Cr-Commit-Position: refs/heads/main@{#955781}
2022-01-05 18:16:23 +00:00
Lei Zhang
ed9be3a428 Remove many unneeded CONTENT_EXPORT entries.
Many classes within content don't need CONTENT_EXPORT because they are
not in content/public and they are not directly used from tests.

Change-Id: I22696b3840ab7a89371184e866b05d0b4980e7dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3288753
Auto-Submit: Lei Zhang <thestig@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#942828}
2021-11-17 22:01:18 +00:00
Peter Boström
1d6a095400 Remove unused "base/macros.h" in content/
Removes `#include "base/macros.h"` from files in content/ that do not
contain `ignore_result(`.

Bug: 1010217
No-Try: true
Change-Id: I887403408704241047e3bd66e953ff7df195368b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3274993
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#940781}
2021-11-11 16:07:03 +00:00
Peter Boström
828b902994 Replace DISALLOW_COPY_AND_ASSIGN in content/
This replaces DISALLOW_COPY_AND_ASSIGN with explicit constructor deletes
where a local script is able to detect its insertion place (~Foo() is
public => insert before this line).

This is incomplete as not all classes have a public ~Foo() declared, so
not all DISALLOW_COPY_AND_ASSIGN occurrences are replaced.

IWYU cleanup is left as a separate pass that is easier when these macros
go away.

Bug: 1010217
Change-Id: Iea478401b7580682c7b9f195f7af9cbbdb6ce315
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3167292
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923194}
2021-09-21 02:28:43 +00:00
Sigurd Schneider
a3b0258cae Create new mojo target to prevent traits header spreading
This CL creates a new mojo target for three files that don't
need the large url_request_mojom_traits.h traits header.

On my machine, this reduces the total build size from
236,200,425,638 to 234,822,552,595 bytes, a reduction
by 1.37 GB or 0.6%.

Bug: 1227131, 242216
Change-Id: Ib2f729edb62880e16183408966d429e8b06c496d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3048296
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Hans Wennborg <hans@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#905715}
2021-07-27 13:51:37 +00:00
Hans Wennborg
ae6fc97556 Pre-commit added header includes for an upcoming mojo bindings change
This adds includes (and some forward declarations) for things currently
provided transitively through mojom.h files. After
https://chromium-review.googlesource.com/c/chromium/src/+/2902821
mojom.h files will use forward declarations more aggressively, and
then "include what you use" becomes necessary for these things.

Bug: 1208786
Change-Id: I3c5364fb482ab0be8c8bb9d188541c2ce46daf4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2903451
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#884433}
2021-05-19 12:59:01 +00:00
Anton Bikineev
f62d1bf48e content: Replace base::Optional and friends with absl counterparts
This replaces:
- base::Optional -> absl::optional
- include "base/optional.h"
  ->
  include "third_party/abseil-cpp/absl/types/optional.h"
- base::nullopt -> absl::nullopt
- base::make_optional -> absl::make_optional

Bug: 1202909
Change-Id: Ie9f37bcbf6115632a19f4d063387d07b3723926f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2897246
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#883270}
2021-05-15 17:56:07 +00:00
Lei Zhang
02a0ad7f4a Fix header guards in content/.
Generated mechanically as follows:

git ls-files '*.h' | grep -E '^content/' | \
    xargs parallel cpplint.py --filter=-,+build/header_guard -- 2>&1 | \
    grep build/header_guard | tools/apply_cpplint_header_guard.py

Bug: 1200694
Change-Id: Iaf6b1c84150d617c3eecc69fb0751ad76dd7fe3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2839364
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#874577}
2021-04-21 05:26:08 +00:00
Dave Tapuska
69f89252c1 Move OnDataUseUpdate to URLLoaderNetworkServiceObserver.
Currently these messages are not scoped to the frame ID, but in order
to remove the GetTotalNetworkUsages() method in the future we scope the
DataUseUpdate to have some context. Since this is the last method on
the NetworkServiceClient we can remove that interface. To make sure
that OnDataUseUpdate is not possibly skipped because an URLLoaderFactory
may not provide a URLLoaderNetworkServiceObserver a default one is
added to the construction of the NetworkService.

BUG=1173710

Change-Id: If385cce47e343c02239e3c6e0895499945515044
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2732792
Reviewed-by: Yoshiki Iguchi <yoshiki@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Mahmoud Gawad <mgawad@google.com>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#861597}
2021-03-10 17:11:37 +00:00
Dave Tapuska
e1a08aaf24 Move LoadInfo to AuthAndCertificateObserver.
In order to remove the use of routing IDs in the network service move
LoadInfo sending to an associated observer. This however prevents
batched messages from being sent and coalesced so the logic in
WebContentsImpl is improved to handle these cases.

BUG=1173710

Change-Id: Ia2de69262d1885534e689ead7b5794bcedecc283
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2725151
Reviewed-by: Mahmoud Gawad <mgawad@google.com>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#860294}
2021-03-05 18:31:59 +00:00
Dave Tapuska
2a6046a4bf Move devtools callbacks on NetworkServiceClient to new interface.
This new interface provides additional framework to remove routing IDs
from the network service in the future. Messages are dispatched
directly to interested agent and there is no need for the process id
or routing id in these devtools messages now.

Add a new DevToolsObserver interface. Since this new interface is now
dependent on URLRequest separate those structs out into an individual
mojom file. Mojo doesn't support forward defines of interfaces so they
all need to be in the same file.

Pass a DevToolsObserver interface into URLLoaderFactory and the
URLLoader so we can associated requests against the associated
DevToolsAgentHost. The DevToolsAgentHost is either bound based on a
service worker or the FrameTreeNode.

BUG=1173710

Change-Id: I76bbea3d4d44cd178a38498fa417842060508441
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2713968
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#858738}
2021-03-01 22:42:52 +00:00
Sigurd Schneider
ea9cd8e3cc Report CORS RFC-1918 issues
This CL reports CORS RFC-1918 problems from the network service to
DevTools without sharing any information with the renderer. In contrast
to approaches that file issues in the renderer this has several
advantages:
 - The issues are filed right where the checking logic bottleneck is
   thus we are guaranteed to not miss any issues.
 - The issue details are not shared with the renderer process, thus
   we can attach information that we don't want to share, or rather
   wouldn't share with the renderer.

The issues are reported even if DevTools is closed, but only introduce
overhead if either an upcoming deprecation is detected, or an actual
error is encountered.

Change-Id: If32d3429845b19f681a8b42116028729e3fc1b9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2663547
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Titouan Rigoudy <titouan@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#852549}
2021-02-10 08:54:47 +00:00
Sigurd Schneider
0a2ed2f296 Report resource IPAddressSpace to DevTools
This CL reports the IPAddressSpace as computed by the URLLoader
to DevTools via the responseReceivedExtraInfo CDP message. This
is useful for the non-error path (many error paths abort the
request earlier, and the responseReceivedExtraInfo is not sent).
In the case of an error, the error reports this information.

Bug: chromium:1141824
Change-Id: I38db7bb8a7a493c6443d44425d8ec798c09bd531
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2640533
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Titouan Rigoudy <titouan@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#848167}
2021-01-28 17:58:21 +00:00
Sigurd Schneider
eede65132d Report request associated with preflight request to DevTools
Bug: chromium:1141824
Change-Id: Ia354d48a878c061bd0d90fb3e2b5f11cfc3d664d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2556863
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831313}
2020-11-26 11:58:03 +00:00
Simon Zünd
f60b2a2b4f [devtools] Instrument Trust Token operations in network service
This CL adds a new "TrustTokenOperationResult" mojo structure that
is emitted in a new NetworkServiceClient event. The structure is used
to convey the exact operation status as well as additional
operation-dependent data to DevTools to allow better Trust Token
debugging.

Follow up CLs will pipe the event all the way through to the DevTools
network handler and instrument the redemption and signing operations.

R=davidvc@chromium.org

Bug: chromium:1126824
Change-Id: I04dd881a74221b3f96a9eea74e39b2d50c9ee20c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2513593
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: David Van Cleve <davidvc@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830530}
2020-11-24 10:54:24 +00:00
Sigurd Schneider
9a937ca102 Report client security state for RFC-1918 DevTools support
This CL reports the IP address space of the initiator in the
requestWillBeSentExtraInfo event as well as the applied
PrivateNetworkRequestPolicy. This is one CL in a series that allows
DevTools to surface relevant information for debugging RFC-1918
violations.

Bug: chromium:1128885
Change-Id: I93d93ad00ac4e4705eeef6bd9f49224782fd30a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2494944
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829613}
2020-11-20 11:18:03 +00:00
Lukasz Anforowicz
28ca79675f Removing logging of UKM and UMA metrics for CORS-for-content-scripts.
CORS-for-content-scripts has shipped in M85 - afterwards, the UKM and
UMA metrics should only be logged for allowlisted extensions.  In M87 we
have removed the allowlist (r807240) which means that the metrics can't
be utilized going forward.  Additionally, we would proceed with
deprecating the allowlist, even if the metrics would show that some
extensions might still be _hypothetically_ affected.

For the reasons listed above, this CL removes the UKM and UMA metrics
for CORS-for-content-scripts.  This corresponds roughly to reverting the
following CLs: r739693 (UMA) and r750700 (UKM).  Note that Rappor has
been added in r746508, but has been already removed in r768003 (and
therefore this CL doesn't touch any Rappor-related code or files).

Bug: 920638, 1125776
Change-Id: I5b410d9e17a19ae0d3eec8727317ae940bf1896c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2396712
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: Jesse Doherty <jwd@chromium.org>
Commit-Queue: Jesse Doherty <jwd@chromium.org>
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808464}
2020-09-18 19:23:21 +00:00
Ayu Ishii
2e3998904a Cookies: Update OnCookiesAccessed to return CookieAccessResultList
This change updates CookieObserver OnCookiesAccessed to take in
CookieAccessResultList instead of CookieStatusList in efforts to
consistently start return CookieAccessResult across the code and
cleanup CookieStatusList. This change is related to [1],
so CookieStore will eventually be able to return EffectiveSameSite
for SameSite across all its endpoints.

[1] https://crbug.com/1092695

Bug: 1091846
Change-Id: I023d53551971b09944145fb41025df2e358d278c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2284225
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Maksim Orlovich <morlovich@chromium.org>
Reviewed-by: Lily Chen <chlily@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#788262}
2020-07-14 18:22:30 +00:00
Ayu Ishii
bc6fdb0a98 GetCookieList to return CookieAccessResultList
This change changes GetCookieList to return a list of a new struct
called CookieWithAccessResult instead of CookieWithStatus which
includes CookieEffectiveSameSite data as well as CookieInclusionStatus
but makes it available for extensibility to include other data from
cookie access time as well. The struct looks as follows.

struct CookieAccessResult {
  CookieEffectiveSameSite effective_same_site;
  CookieInclusionStatus status;
}

struct CookieWithAccessResult {
  CanonicalCookie cookie;
  CookieAccessResult access_result;
};

Bug: 1065010
Change-Id: I7ac01827fff511b422f5ff5a712d50d5a3885d17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2212697
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Maksim Orlovich <morlovich@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Denis Kuznetsov [CET] <antrim@chromium.org>
Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Robert Ogden <robertogden@chromium.org>
Reviewed-by: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: David Dorwin <ddorwin@chromium.org>
Reviewed-by: Lily Chen <chlily@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776249}
2020-06-08 22:59:19 +00:00
Lukasz Anforowicz
1feeba18e6 UKM metrics for CorbAllowlistAlsoAppliesToOorCors breakage.
This CL logs UKM events that hopefully will aid in proactively
identifying extensions that might be impacted by the changes behind
the CorbAllowlistAlsoAppliesToOorCors feature.

New UKM collection review (Google-internal):
https://docs.google.com/document/d/1RyAO8Con16my4lPkIVe2d1V89HMAISp9uO9h8tHfcNs

Bug: 1057232
Change-Id: I6c35c26ec418e1876c088e08d36a1aeeb12ffa47
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2097020
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Martin Barbella <mbarbella@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Steven Holte <holte@chromium.org>
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Martin Barbella <mbarbella@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750700}
2020-03-16 20:32:02 +00:00
Lukasz Anforowicz
b691453204 Rappor metrics for CorbAllowlistAlsoAppliesToOorCors breakage.
This CL logs Rappor samples that hopefully will aid in proactively
identifying extensions that might be impacted by the changes behind
the CorbAllowlistAlsoAppliesToOorCors feature.

Bug: 920638
Change-Id: I40dec28c99673b8096170e1f1fce92c417ca0c16
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2076425
Reviewed-by: Steven Holte <holte@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746508}
2020-03-03 20:50:25 +00:00
Tsuyoshi Horo
3ca54b1752 Show CORS preflight request in DevTools
Currently CORS preflight OPTIONS requests are not shown in DevTools.
When OutOfBlinkCORS is not enabled, Blink’s ThreadableLoader fetches
the CORS preflight requests, and  the preflight request information is
sent to DevTools from ThreadableLoader
(http://trac.webkit.org/changeset/90340).
But when OutOfBlinkCORS is enabled, the CORS preflight requests are
fetched from the network process. And the preflight request
information is not sent to DevTools.

To fix this problem, this CL introduces 3 methods
(OnCorsPreflightRequest/Response/RequestCompleted) to
NetworkServiceClient mojo interface. PreflightLoader in the network
process calls these methods to pass the preflight request information
to the browser process. NetworkServiceClient in the browser process
receives the information and passes it to DevTools.

Bug: 941297
Change-Id: I56c1b5acd06ba06380986f054ea60473ab80ff52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2054468
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745781}
2020-03-01 04:49:23 +00:00
Julie Jeongeun Kim
f962da30c9 Clean up old Mojo types for network::mojom::NetworkChangeManager
This CL cleans up old Mojo types for
network::mojom::NetworkChangeManager from WebRtcVideoCaptureBrowserTest
using Remote and updates comments
with new Mojo types.

Bug: 955171
Change-Id: I7c9fb2e49cbf1307c994533e8480a207e9162a94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1939528
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720247}
2019-11-29 17:43:25 +00:00