| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NET_BASE_COOKIE_UTILS_H_ | |
| 6 #define NET_BASE_COOKIE_UTILS_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <string> | |
| 10 | |
| 11 class GURL; | |
| 12 | |
| 13 namespace net { | |
| 14 namespace cookie_utils { | |
| 15 | |
| 16 // Returns the effective TLD+1 for a given host. This only makes sense for http | |
| 17 // and https schemes. For other schemes, the host will be returned unchanged | |
| 18 // (minus any leading period). | |
| 19 std::string GetEffectiveDomain(const std::string& scheme, | |
| 20 const std::string& host); | |
| 21 | |
| 22 // Determine the actual cookie domain based on the domain string passed | |
| 23 // (if any) and the URL from which the cookie came. | |
| 24 // On success returns true, and sets cookie_domain to either a | |
| 25 // -host cookie domain (ex: "google.com") | |
| 26 // -domain cookie domain (ex: ".google.com") | |
| 27 bool GetCookieDomainWithString(const GURL& url, | |
| 28 const std::string& domain_string, | |
| 29 std::string* result); | |
| 30 | |
| 31 // Returns true if a domain string represents a host-only cookie, | |
| 32 // i.e. it doesn't begin with a leading '.' character. | |
| 33 bool DomainIsHostOnly(const std::string& domain_string); | |
| 34 | |
| 35 } // namspace cookie_utils | |
| 36 } // namespace net | |
| 37 | |
| 38 #endif // NET_BASE_COOKIE_UTILS_H_ | |
| OLD | NEW |