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

Side by Side Diff: net/base/cookie_monster.cc

Issue 7595007: Revert 95825 - Update asynchronous CookieMonster API to login_utils. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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/base/cookie_monster.h ('k') | net/base/cookie_monster_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) 2011 The Chromium Authors. All rights reserved. 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 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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 const GURL& url, const std::string& name, const std::string& value, 604 const GURL& url, const std::string& name, const std::string& value,
605 const std::string& domain, const std::string& path, 605 const std::string& domain, const std::string& path,
606 const base::Time& expiration_time, bool secure, bool http_only, 606 const base::Time& expiration_time, bool secure, bool http_only,
607 const SetCookiesCallback& callback) { 607 const SetCookiesCallback& callback) {
608 bool success_ = SetCookieWithDetails(url, name, value, domain, path, 608 bool success_ = SetCookieWithDetails(url, name, value, domain, path,
609 expiration_time, secure, http_only); 609 expiration_time, secure, http_only);
610 if (!callback.is_null()) 610 if (!callback.is_null())
611 callback.Run(success_); 611 callback.Run(success_);
612 } 612 }
613 613
614 bool CookieMonster::InitializeFrom(const CookieList& list) { 614 bool CookieMonster::InitializeFrom(CookieMonster* cookie_monster) {
615 net::CookieList list = cookie_monster->GetAllCookies();
616
615 base::AutoLock autolock(lock_); 617 base::AutoLock autolock(lock_);
616 InitIfNecessary(); 618 InitIfNecessary();
617 for (net::CookieList::const_iterator iter = list.begin(); 619 for (net::CookieList::const_iterator iter = list.begin();
618 iter != list.end(); ++iter) { 620 iter != list.end(); ++iter) {
619 scoped_ptr<net::CookieMonster::CanonicalCookie> cookie; 621 scoped_ptr<net::CookieMonster::CanonicalCookie> cookie;
620 cookie.reset(new net::CookieMonster::CanonicalCookie(*iter)); 622 cookie.reset(new net::CookieMonster::CanonicalCookie(*iter));
621 net::CookieOptions options; 623 net::CookieOptions options;
622 options.set_include_httponly(); 624 options.set_include_httponly();
623 if (!SetCanonicalCookie(&cookie, cookie->CreationDate(), 625 if (!SetCanonicalCookie(&cookie, cookie->CreationDate(),
624 options)) { 626 options)) {
(...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after
2274 std::string CookieMonster::CanonicalCookie::DebugString() const { 2276 std::string CookieMonster::CanonicalCookie::DebugString() const {
2275 return base::StringPrintf( 2277 return base::StringPrintf(
2276 "name: %s value: %s domain: %s path: %s creation: %" 2278 "name: %s value: %s domain: %s path: %s creation: %"
2277 PRId64, 2279 PRId64,
2278 name_.c_str(), value_.c_str(), 2280 name_.c_str(), value_.c_str(),
2279 domain_.c_str(), path_.c_str(), 2281 domain_.c_str(), path_.c_str(),
2280 static_cast<int64>(creation_date_.ToTimeT())); 2282 static_cast<int64>(creation_date_.ToTimeT()));
2281 } 2283 }
2282 2284
2283 } // namespace 2285 } // namespace
OLDNEW
« no previous file with comments | « net/base/cookie_monster.h ('k') | net/base/cookie_monster_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698