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}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.