Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: net/cookies/canonical_cookie.cc

Issue 2908443002: Initial implementation of Cookie service.
Patch Set: Partially written test. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/test/BUILD.gn ('k') | net/cookies/cookie_options.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Portions of this code based on Mozilla: 5 // Portions of this code based on Mozilla:
6 // (netwerk/cookie/src/nsCookieService.cpp) 6 // (netwerk/cookie/src/nsCookieService.cpp)
7 /* ***** BEGIN LICENSE BLOCK ***** 7 /* ***** BEGIN LICENSE BLOCK *****
8 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 8 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
9 * 9 *
10 * The contents of this file are subject to the Mozilla Public License Version 10 * The contents of this file are subject to the Mozilla Public License Version
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 diff = a.Domain().compare(b.Domain()); 86 diff = a.Domain().compare(b.Domain());
87 if (diff != 0) 87 if (diff != 0)
88 return diff; 88 return diff;
89 89
90 return a.Path().compare(b.Path()); 90 return a.Path().compare(b.Path());
91 } 91 }
92 92
93 } // namespace 93 } // namespace
94 94
95 // Keep defaults here in sync with content/common/cookie.mojom.
95 CanonicalCookie::CanonicalCookie() 96 CanonicalCookie::CanonicalCookie()
96 : secure_(false), 97 : secure_(false),
97 httponly_(false) { 98 httponly_(false) {
98 } 99 }
99 100
100 CanonicalCookie::CanonicalCookie(const CanonicalCookie& other) = default; 101 CanonicalCookie::CanonicalCookie(const CanonicalCookie& other) = default;
101 102
102 CanonicalCookie::CanonicalCookie(const std::string& name, 103 CanonicalCookie::CanonicalCookie(const std::string& name,
103 const std::string& value, 104 const std::string& value,
104 const std::string& domain, 105 const std::string& domain,
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 return true; 495 return true;
495 } 496 }
496 497
497 std::string CanonicalCookie::DomainWithoutDot() const { 498 std::string CanonicalCookie::DomainWithoutDot() const {
498 if (domain_.empty() || domain_[0] != '.') 499 if (domain_.empty() || domain_[0] != '.')
499 return domain_; 500 return domain_;
500 return domain_.substr(1); 501 return domain_.substr(1);
501 } 502 }
502 503
503 } // namespace net 504 } // namespace net
OLDNEW
« no previous file with comments | « content/test/BUILD.gn ('k') | net/cookies/cookie_options.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698