0
Files
src/net
Dylan Cutler b63c414661 Add methods to CanonicalCookie to serialize/deserialize partition keys
to/from strings.

The serialization scheme for a cookie partition key
(absl::optional<net::SchemefulSite) is as follows:

- If the key is absl::nullopt, the output is net::kEmptyPartitionKey
- If the key contains a file origin, the output is
  SchemefulSite::SerializeFileSiteWithHost().
- Otherwise the output is SchemefulSite::Serialize().

The serialization method returns false if the partition key is invalid
or the SchemefulSite's origin is opaque. If this method returns false
the cookie should not be saved to disk.

The deserialization scheme works as follows:
- If the input is net::kEmptyPartitionKey, the output is absl::nullopt
- Otherwise return SchemefulSite::Deserialize(input)

The deserialization method returns false if the serialized key is
invalid. If this method returns false the cookie should not be loaded
from disk into a CanonicalCookie and should be deleted.

This CL also adds the method SerializeFile[Origin|Site]WithHost
to url::Origin and net::SchemefulSite respectively. Unlike Serialize,
this method should only be called on file origins and preserves the
origins' host.

Bug: 1225444
Change-Id: Ic113b693dfc450857a43cbf2ca645a5adf6b016e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3032294
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Lily Chen <chlily@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Commit-Queue: Dylan Cutler <dylancutler@google.com>
Cr-Commit-Position: refs/heads/master@{#905372}
2021-07-26 19:42:29 +00:00
..
2021-07-05 19:36:18 +00:00
2021-06-25 17:58:19 +00:00
2021-07-24 01:12:28 +00:00
2021-07-16 05:26:37 +00:00

Chrome Networking Stack

This directory contains the code behind Chrome's networking stack. It is documented here.