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

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

Issue 1602283002: Convert some raw CanonicalCookie ptrs to scoped_ptr<CanonicalCookie>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix missed CanonicalCookie::Create() callsite in ios/net/cookies/cookie_store_ios_unittest.mm Created 4 years, 11 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 | « net/cookies/canonical_cookie_unittest.cc ('k') | net/cookies/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) 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 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 bool enforce_strict_secure, 1146 bool enforce_strict_secure,
1147 CookiePriority priority) { 1147 CookiePriority priority) {
1148 base::AutoLock autolock(lock_); 1148 base::AutoLock autolock(lock_);
1149 1149
1150 if (!HasCookieableScheme(url)) 1150 if (!HasCookieableScheme(url))
1151 return false; 1151 return false;
1152 1152
1153 Time creation_time = CurrentTime(); 1153 Time creation_time = CurrentTime();
1154 last_time_seen_ = creation_time; 1154 last_time_seen_ = creation_time;
1155 1155
1156 scoped_ptr<CanonicalCookie> cc; 1156 scoped_ptr<CanonicalCookie> cc(CanonicalCookie::Create(
1157 cc.reset(CanonicalCookie::Create(
1158 url, name, value, domain, path, creation_time, expiration_time, secure, 1157 url, name, value, domain, path, creation_time, expiration_time, secure,
1159 http_only, first_party_only, enforce_strict_secure, priority)); 1158 http_only, first_party_only, enforce_strict_secure, priority));
1160 1159
1161 if (!cc.get()) 1160 if (!cc.get())
1162 return false; 1161 return false;
1163 1162
1164 CookieOptions options; 1163 CookieOptions options;
1165 options.set_include_httponly(); 1164 options.set_include_httponly();
1166 options.set_include_first_party_only_cookies(); 1165 options.set_include_first_party_only_cookies();
1167 if (enforce_strict_secure) 1166 if (enforce_strict_secure)
(...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after
2494 it != hook_map_.end(); ++it) { 2493 it != hook_map_.end(); ++it) {
2495 std::pair<GURL, std::string> key = it->first; 2494 std::pair<GURL, std::string> key = it->first;
2496 if (cookie.IncludeForRequestURL(key.first, opts) && 2495 if (cookie.IncludeForRequestURL(key.first, opts) &&
2497 cookie.Name() == key.second) { 2496 cookie.Name() == key.second) {
2498 it->second->Notify(cookie, removed); 2497 it->second->Notify(cookie, removed);
2499 } 2498 }
2500 } 2499 }
2501 } 2500 }
2502 2501
2503 } // namespace net 2502 } // namespace net
OLDNEW
« no previous file with comments | « net/cookies/canonical_cookie_unittest.cc ('k') | net/cookies/cookie_monster_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698