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

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

Issue 255333003: Renamed namespaces in src/net. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tue 04/29/2014 19:22:06.75 Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « net/cookies/canonical_cookie.cc ('k') | net/dns/dns_config_service_win.cc » ('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 #include "net/cookies/cookie_util.h" 5 #include "net/cookies/cookie_util.h"
6 6
7 #include <cstdio> 7 #include <cstdio>
8 #include <cstdlib> 8 #include <cstdlib>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // We match IE/Firefox in allowing a domain=IPADDR if it matches the url 44 // We match IE/Firefox in allowing a domain=IPADDR if it matches the url
45 // ip address hostname exactly. It should be treated as a host cookie. 45 // ip address hostname exactly. It should be treated as a host cookie.
46 if (domain_string.empty() || 46 if (domain_string.empty() ||
47 (url.HostIsIPAddress() && url_host == domain_string)) { 47 (url.HostIsIPAddress() && url_host == domain_string)) {
48 *result = url_host; 48 *result = url_host;
49 DCHECK(DomainIsHostOnly(*result)); 49 DCHECK(DomainIsHostOnly(*result));
50 return true; 50 return true;
51 } 51 }
52 52
53 // Get the normalized domain specified in cookie line. 53 // Get the normalized domain specified in cookie line.
54 url_canon::CanonHostInfo ignored; 54 url::CanonHostInfo ignored;
55 std::string cookie_domain(CanonicalizeHost(domain_string, &ignored)); 55 std::string cookie_domain(CanonicalizeHost(domain_string, &ignored));
56 if (cookie_domain.empty()) 56 if (cookie_domain.empty())
57 return false; 57 return false;
58 if (cookie_domain[0] != '.') 58 if (cookie_domain[0] != '.')
59 cookie_domain = "." + cookie_domain; 59 cookie_domain = "." + cookie_domain;
60 60
61 // Ensure |url| and |cookie_domain| have the same domain+registry. 61 // Ensure |url| and |cookie_domain| have the same domain+registry.
62 const std::string url_scheme(url.scheme()); 62 const std::string url_scheme(url.scheme());
63 const std::string url_domain_and_registry( 63 const std::string url_domain_and_registry(
64 GetEffectiveDomain(url_scheme, url_host)); 64 GetEffectiveDomain(url_scheme, url_host));
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 return GURL(); 206 return GURL();
207 207
208 const std::string scheme = is_https ? "https" : "http"; 208 const std::string scheme = is_https ? "https" : "http";
209 const std::string host = domain[0] == '.' ? domain.substr(1) : domain; 209 const std::string host = domain[0] == '.' ? domain.substr(1) : domain;
210 return GURL(scheme + "://" + host); 210 return GURL(scheme + "://" + host);
211 } 211 }
212 212
213 } // namespace cookie_utils 213 } // namespace cookie_utils
214 } // namespace net 214 } // namespace net
215 215
OLDNEW
« no previous file with comments | « net/cookies/canonical_cookie.cc ('k') | net/dns/dns_config_service_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698