Commit e683ce90 authored by Dylan Cutler's avatar Dylan Cutler Committed by Chromium LUCI CQ

Make CanonicalCookie's constructor private.

This constructor does not check that that the resulting cookie
is canonical, and CanonicalCookie instances should be created
using one of the static factory methods.

Bug: 1102874
Change-Id: I910729a0a399de78f5722fe488a38e12befd03bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2586238Reviewed-by: default avatarMaksim Orlovich <morlovich@chromium.org>
Commit-Queue: Dylan Cutler <dylancutler@google.com>
Cr-Commit-Position: refs/heads/master@{#841518}
parent 1b0283a5
......@@ -60,27 +60,6 @@ class NET_EXPORT CanonicalCookie {
CanonicalCookie();
CanonicalCookie(const CanonicalCookie& other);
// This constructor does not validate or canonicalize their inputs;
// the resulting CanonicalCookies should not be relied on to be canonical
// unless the caller has done appropriate validation and canonicalization
// themselves.
// NOTE: Prefer using CreateSanitizedCookie() over directly using this
// constructor.
CanonicalCookie(const std::string& name,
const std::string& value,
const std::string& domain,
const std::string& path,
const base::Time& creation,
const base::Time& expiration,
const base::Time& last_access,
bool secure,
bool httponly,
CookieSameSite same_site,
CookiePriority priority,
bool same_party,
CookieSourceScheme scheme_secure = CookieSourceScheme::kUnset,
int source_port = url::PORT_UNSPECIFIED);
~CanonicalCookie();
// Supports the default copy constructor.
......@@ -371,6 +350,27 @@ class NET_EXPORT CanonicalCookie {
private:
FRIEND_TEST_ALL_PREFIXES(CanonicalCookieTest, TestPrefixHistograms);
// This constructor does not validate or canonicalize their inputs;
// the resulting CanonicalCookies should not be relied on to be canonical
// unless the caller has done appropriate validation and canonicalization
// themselves.
// NOTE: Prefer using CreateSanitizedCookie() over directly using this
// constructor.
CanonicalCookie(const std::string& name,
const std::string& value,
const std::string& domain,
const std::string& path,
const base::Time& creation,
const base::Time& expiration,
const base::Time& last_access,
bool secure,
bool httponly,
CookieSameSite same_site,
CookiePriority priority,
bool same_party,
CookieSourceScheme scheme_secure = CookieSourceScheme::kUnset,
int source_port = url::PORT_UNSPECIFIED);
// The special cookie prefixes as defined in
// https://tools.ietf.org/html/draft-west-cookie-prefixes
//
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment