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

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

Issue 11308270: Remove unused parameter from the method IsDomainMatch of the class CanonicalCookie (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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.h ('k') | net/cookies/canonical_cookie_unittest.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 // 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 // in the url path. Since we know that the url path length is greater 331 // in the url path. Since we know that the url path length is greater
332 // than the cookie path length, it's safe to index one byte past. 332 // than the cookie path length, it's safe to index one byte past.
333 if (path_.length() != url_path.length() && 333 if (path_.length() != url_path.length() &&
334 path_[path_.length() - 1] != '/' && 334 path_[path_.length() - 1] != '/' &&
335 url_path[path_.length()] != '/') 335 url_path[path_.length()] != '/')
336 return false; 336 return false;
337 337
338 return true; 338 return true;
339 } 339 }
340 340
341 bool CanonicalCookie::IsDomainMatch(const std::string& scheme, 341 bool CanonicalCookie::IsDomainMatch(const std::string& host) const {
342 const std::string& host) const {
343 // Can domain match in two ways; as a domain cookie (where the cookie 342 // Can domain match in two ways; as a domain cookie (where the cookie
344 // domain begins with ".") or as a host cookie (where it doesn't). 343 // domain begins with ".") or as a host cookie (where it doesn't).
345 344
346 // Some consumers of the CookieMonster expect to set cookies on 345 // Some consumers of the CookieMonster expect to set cookies on
347 // URLs like http://.strange.url. To retrieve cookies in this instance, 346 // URLs like http://.strange.url. To retrieve cookies in this instance,
348 // we allow matching as a host cookie even when the domain_ starts with 347 // we allow matching as a host cookie even when the domain_ starts with
349 // a period. 348 // a period.
350 if (host == domain_) 349 if (host == domain_)
351 return true; 350 return true;
352 351
(...skipping 22 matching lines...) Expand all
375 std::string CanonicalCookie::DebugString() const { 374 std::string CanonicalCookie::DebugString() const {
376 return base::StringPrintf( 375 return base::StringPrintf(
377 "name: %s value: %s domain: %s path: %s creation: %" 376 "name: %s value: %s domain: %s path: %s creation: %"
378 PRId64, 377 PRId64,
379 name_.c_str(), value_.c_str(), 378 name_.c_str(), value_.c_str(),
380 domain_.c_str(), path_.c_str(), 379 domain_.c_str(), path_.c_str(),
381 static_cast<int64>(creation_date_.ToTimeT())); 380 static_cast<int64>(creation_date_.ToTimeT()));
382 } 381 }
383 382
384 } // namespace net 383 } // namespace net
OLDNEW
« no previous file with comments | « net/cookies/canonical_cookie.h ('k') | net/cookies/canonical_cookie_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698