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

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

Issue 2595703002: Expand net::CookieStore::ChangeCause::EXPLICIT for debugging. (Closed)
Patch Set: better names for enum values Created 4 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
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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 267
268 // Mapping between DeletionCause and CookieStore::ChangeCause; the 268 // Mapping between DeletionCause and CookieStore::ChangeCause; the
269 // mapping also provides a boolean that specifies whether or not an 269 // mapping also provides a boolean that specifies whether or not an
270 // OnCookieChanged notification ought to be generated. 270 // OnCookieChanged notification ought to be generated.
271 typedef struct ChangeCausePair_struct { 271 typedef struct ChangeCausePair_struct {
272 CookieStore::ChangeCause cause; 272 CookieStore::ChangeCause cause;
273 bool notify; 273 bool notify;
274 } ChangeCausePair; 274 } ChangeCausePair;
275 const ChangeCausePair kChangeCauseMapping[] = { 275 const ChangeCausePair kChangeCauseMapping[] = {
276 // DELETE_COOKIE_EXPLICIT 276 // DELETE_COOKIE_EXPLICIT
277 {CookieStore::ChangeCause::EXPLICIT, true}, 277 {CookieStore::ChangeCause::EXPLICIT_DELETE, true},
278 // DELETE_COOKIE_OVERWRITE 278 // DELETE_COOKIE_OVERWRITE
279 {CookieStore::ChangeCause::OVERWRITE, true}, 279 {CookieStore::ChangeCause::OVERWRITE, true},
280 // DELETE_COOKIE_EXPIRED 280 // DELETE_COOKIE_EXPIRED
281 {CookieStore::ChangeCause::EXPIRED, true}, 281 {CookieStore::ChangeCause::EXPIRED, true},
282 // DELETE_COOKIE_EVICTED 282 // DELETE_COOKIE_EVICTED
283 {CookieStore::ChangeCause::EVICTED, true}, 283 {CookieStore::ChangeCause::EVICTED, true},
284 // DELETE_COOKIE_DUPLICATE_IN_BACKING_STORE 284 // DELETE_COOKIE_DUPLICATE_IN_BACKING_STORE
285 {CookieStore::ChangeCause::EXPLICIT, false}, 285 {CookieStore::ChangeCause::EXPLICIT_DUPLICATE_IN_BACKING_STORE, false},
286 // DELETE_COOKIE_DONT_RECORD 286 // DELETE_COOKIE_DONT_RECORD
287 {CookieStore::ChangeCause::EXPLICIT, false}, 287 {CookieStore::ChangeCause::EXPLICIT_DONT_RECORD, false},
288 // DELETE_COOKIE_EVICTED_DOMAIN 288 // DELETE_COOKIE_EVICTED_DOMAIN
289 {CookieStore::ChangeCause::EVICTED, true}, 289 {CookieStore::ChangeCause::EVICTED, true},
290 // DELETE_COOKIE_EVICTED_GLOBAL 290 // DELETE_COOKIE_EVICTED_GLOBAL
291 {CookieStore::ChangeCause::EVICTED, true}, 291 {CookieStore::ChangeCause::EVICTED, true},
292 // DELETE_COOKIE_EVICTED_DOMAIN_PRE_SAFE 292 // DELETE_COOKIE_EVICTED_DOMAIN_PRE_SAFE
293 {CookieStore::ChangeCause::EVICTED, true}, 293 {CookieStore::ChangeCause::EVICTED, true},
294 // DELETE_COOKIE_EVICTED_DOMAIN_POST_SAFE 294 // DELETE_COOKIE_EVICTED_DOMAIN_POST_SAFE
295 {CookieStore::ChangeCause::EVICTED, true}, 295 {CookieStore::ChangeCause::EVICTED, true},
296 // DELETE_COOKIE_EXPIRED_OVERWRITE 296 // DELETE_COOKIE_EXPIRED_OVERWRITE
297 {CookieStore::ChangeCause::EXPIRED_OVERWRITE, true}, 297 {CookieStore::ChangeCause::EXPIRED_OVERWRITE, true},
298 // DELETE_COOKIE_CONTROL_CHAR 298 // DELETE_COOKIE_CONTROL_CHAR
299 {CookieStore::ChangeCause::EVICTED, true}, 299 {CookieStore::ChangeCause::EVICTED, true},
300 // DELETE_COOKIE_NON_SECURE 300 // DELETE_COOKIE_NON_SECURE
301 {CookieStore::ChangeCause::EVICTED, true}, 301 {CookieStore::ChangeCause::EVICTED, true},
302 // DELETE_COOKIE_LAST_ENTRY 302 // DELETE_COOKIE_LAST_ENTRY
303 {CookieStore::ChangeCause::EXPLICIT, false}}; 303 {CookieStore::ChangeCause::EXPLICIT_LAST_ENTRY, false}};
304 304
305 void RunAsync(scoped_refptr<base::TaskRunner> proxy, 305 void RunAsync(scoped_refptr<base::TaskRunner> proxy,
306 const CookieStore::CookieChangedCallback& callback, 306 const CookieStore::CookieChangedCallback& callback,
307 const CanonicalCookie& cookie, 307 const CanonicalCookie& cookie,
308 CookieStore::ChangeCause cause) { 308 CookieStore::ChangeCause cause) {
309 proxy->PostTask(FROM_HERE, base::Bind(callback, cookie, cause)); 309 proxy->PostTask(FROM_HERE, base::Bind(callback, cookie, cause));
310 } 310 }
311 311
312 bool IsCookieEligibleForEviction(CookiePriority current_priority_level, 312 bool IsCookieEligibleForEviction(CookiePriority current_priority_level,
313 bool protect_secure_cookies, 313 bool protect_secure_cookies,
(...skipping 2072 matching lines...) Expand 10 before | Expand all | Expand 10 after
2386 it != hook_map_.end(); ++it) { 2386 it != hook_map_.end(); ++it) {
2387 std::pair<GURL, std::string> key = it->first; 2387 std::pair<GURL, std::string> key = it->first;
2388 if (cookie.IncludeForRequestURL(key.first, opts) && 2388 if (cookie.IncludeForRequestURL(key.first, opts) &&
2389 cookie.Name() == key.second) { 2389 cookie.Name() == key.second) {
2390 it->second->Notify(cookie, cause); 2390 it->second->Notify(cookie, cause);
2391 } 2391 }
2392 } 2392 }
2393 } 2393 }
2394 2394
2395 } // namespace net 2395 } // namespace net
OLDNEW
« no previous file with comments | « components/signin/core/browser/gaia_cookie_manager_service.cc ('k') | net/cookies/cookie_monster_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698