diff options
author | tfarina <tfarina@chromium.org> | 2016-03-24 08:55:54 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-24 15:58:42 +0000 |
commit | b1eaeaefa02ccc5a8fe79b2776a6aa34b14a24e0 (patch) | |
tree | eec7a7700ac5a2cd9f0b729bbaf339b9795c94ba /net | |
parent | b53b38cca6a4e89d3e9b1a2762ee6d7ebb2b77d2 (diff) | |
download | chromium_src-b1eaeaefa02ccc5a8fe79b2776a6aa34b14a24e0.zip chromium_src-b1eaeaefa02ccc5a8fe79b2776a6aa34b14a24e0.tar.gz chromium_src-b1eaeaefa02ccc5a8fe79b2776a6aa34b14a24e0.tar.bz2 |
net: remove CanonicalCookie ctor that takes two parameters
The problem of using the constructor is that with it there
is no way to return an error if bad arguments are passed in.
That can be done by using the static method Create, that
does some validation and returns null if an attribute value
is invalid.
BUG=57061
TEST=unit_tests, net_unittests
R=mmenke@chromium.org
TBR=bauerb@chromium.org,msw@chromium.org
Review URL: https://codereview.chromium.org/1833483002
Cr-Commit-Position: refs/heads/master@{#383069}
Diffstat (limited to 'net')
-rw-r--r-- | net/cookies/canonical_cookie.cc | 28 | ||||
-rw-r--r-- | net/cookies/canonical_cookie.h | 5 |
2 files changed, 0 insertions, 33 deletions
diff --git a/net/cookies/canonical_cookie.cc b/net/cookies/canonical_cookie.cc index 89b5b4d..bce2b54 100644 --- a/net/cookies/canonical_cookie.cc +++ b/net/cookies/canonical_cookie.cc @@ -149,34 +149,6 @@ CanonicalCookie::CanonicalCookie(const GURL& url, same_site_(same_site), priority_(priority) {} -CanonicalCookie::CanonicalCookie(const GURL& url, const ParsedCookie& pc) - : source_(url.SchemeIsFile() ? url : url.GetOrigin()), - name_(pc.Name()), - value_(pc.Value()), - path_(CanonPath(url, pc)), - creation_date_(Time::Now()), - last_access_date_(Time()), - secure_(pc.IsSecure()), - httponly_(pc.IsHttpOnly()), - same_site_(pc.SameSite()), - priority_(pc.Priority()) { - if (pc.HasExpires()) - expiry_date_ = CanonExpiration(pc, creation_date_, creation_date_); - - // Do the best we can with the domain. - std::string cookie_domain; - std::string domain_string; - if (pc.HasDomain()) { - domain_string = pc.Domain(); - } - bool result - = cookie_util::GetCookieDomainWithString(url, domain_string, - &cookie_domain); - // Caller is responsible for passing in good arguments. - DCHECK(result); - domain_ = cookie_domain; -} - CanonicalCookie::CanonicalCookie(const CanonicalCookie& other) = default; CanonicalCookie::~CanonicalCookie() { diff --git a/net/cookies/canonical_cookie.h b/net/cookies/canonical_cookie.h index e14cf2e..f95501c 100644 --- a/net/cookies/canonical_cookie.h +++ b/net/cookies/canonical_cookie.h @@ -41,11 +41,6 @@ class NET_EXPORT CanonicalCookie { CookieSameSite same_site, CookiePriority priority); - // This constructor does canonicalization but not validation. - // The result of this constructor should not be relied on in contexts - // in which pre-validation of the ParsedCookie has not been done. - CanonicalCookie(const GURL& url, const ParsedCookie& pc); - CanonicalCookie(const CanonicalCookie& other); ~CanonicalCookie(); |