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

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

Issue 2103863003: Make CanonicalCookie::Source() private. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@source
Patch Set: Merge Created 4 years, 5 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.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 // Brought to you by the letter D and the number 2. 5 // Brought to you by the letter D and the number 2.
6 6
7 #ifndef NET_COOKIES_COOKIE_MONSTER_H_ 7 #ifndef NET_COOKIES_COOKIE_MONSTER_H_
8 #define NET_COOKIES_COOKIE_MONSTER_H_ 8 #define NET_COOKIES_COOKIE_MONSTER_H_
9 9
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 CookieMonster(PersistentCookieStore* store, CookieMonsterDelegate* delegate); 135 CookieMonster(PersistentCookieStore* store, CookieMonsterDelegate* delegate);
136 136
137 // Only used during unit testing. 137 // Only used during unit testing.
138 CookieMonster(PersistentCookieStore* store, 138 CookieMonster(PersistentCookieStore* store,
139 CookieMonsterDelegate* delegate, 139 CookieMonsterDelegate* delegate,
140 base::TimeDelta last_access_threshold); 140 base::TimeDelta last_access_threshold);
141 141
142 ~CookieMonster() override; 142 ~CookieMonster() override;
143 143
144 // Replaces all the cookies by |list|. This method does not flush the backend. 144 // Replaces all the cookies by |list|. This method does not flush the backend.
145 // This method does not support setting secure cookies, which need source
146 // URLs.
147 // TODO(mmenke): This method is only used on iOS. Consider removing it.
145 void SetAllCookiesAsync(const CookieList& list, 148 void SetAllCookiesAsync(const CookieList& list,
146 const SetCookiesCallback& callback); 149 const SetCookiesCallback& callback);
147 150
148 // CookieStore implementation. 151 // CookieStore implementation.
149 void SetCookieWithOptionsAsync(const GURL& url, 152 void SetCookieWithOptionsAsync(const GURL& url,
150 const std::string& cookie_line, 153 const std::string& cookie_line,
151 const CookieOptions& options, 154 const CookieOptions& options,
152 const SetCookiesCallback& callback) override; 155 const SetCookiesCallback& callback) override;
153 void SetCookieWithDetailsAsync(const GURL& url, 156 void SetCookieWithDetailsAsync(const GURL& url,
154 const std::string& name, 157 const std::string& name,
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 const CookieOptions& options, 483 const CookieOptions& options,
481 std::vector<CanonicalCookie*>* cookies); 484 std::vector<CanonicalCookie*>* cookies);
482 485
483 void FindCookiesForKey(const std::string& key, 486 void FindCookiesForKey(const std::string& key,
484 const GURL& url, 487 const GURL& url,
485 const CookieOptions& options, 488 const CookieOptions& options,
486 const base::Time& current, 489 const base::Time& current,
487 std::vector<CanonicalCookie*>* cookies); 490 std::vector<CanonicalCookie*>* cookies);
488 491
489 // Delete any cookies that are equivalent to |ecc| (same path, domain, etc). 492 // Delete any cookies that are equivalent to |ecc| (same path, domain, etc).
493 // |source_url| is the URL that is attempting to set the cookie.
490 // If |skip_httponly| is true, httponly cookies will not be deleted. The 494 // If |skip_httponly| is true, httponly cookies will not be deleted. The
491 // return value will be true if |skip_httponly| skipped an httponly cookie or 495 // return value will be true if |skip_httponly| skipped an httponly cookie or
492 // |enforce_strict_secure| is true and the cookie to 496 // |enforce_strict_secure| is true and the cookie to
493 // delete was Secure and the scheme of |ecc| is insecure. |key| is the key to 497 // delete was Secure and the scheme of |ecc| is insecure. |key| is the key to
494 // find the cookie in cookies_; see the comment before the CookieMap typedef 498 // find the cookie in cookies_; see the comment before the CookieMap typedef
495 // for details. 499 // for details.
496 // NOTE: There should never be more than a single matching equivalent cookie. 500 // NOTE: There should never be more than a single matching equivalent cookie.
497 bool DeleteAnyEquivalentCookie(const std::string& key, 501 bool DeleteAnyEquivalentCookie(const std::string& key,
498 const CanonicalCookie& ecc, 502 const CanonicalCookie& ecc,
503 const GURL& source_url,
499 bool skip_httponly, 504 bool skip_httponly,
500 bool already_expired, 505 bool already_expired,
501 bool enforce_strict_secure); 506 bool enforce_strict_secure);
502 507
503 // Takes ownership of *cc. Returns an iterator that points to the inserted 508 // Takes ownership of *cc. Returns an iterator that points to the inserted
504 // cookie in cookies_. Guarantee: all iterators to cookies_ remain valid. 509 // cookie in cookies_. Guarantee: all iterators to cookies_ remain valid.
505 CookieMap::iterator InternalInsertCookie(const std::string& key, 510 CookieMap::iterator InternalInsertCookie(const std::string& key,
506 CanonicalCookie* cc, 511 CanonicalCookie* cc,
512 const GURL& source_url,
507 bool sync_to_store); 513 bool sync_to_store);
508 514
509 // Helper function that sets cookies with more control. 515 // Helper function that sets cookies with more control.
510 // Not exposed as we don't want callers to have the ability 516 // Not exposed as we don't want callers to have the ability
511 // to specify (potentially duplicate) creation times. 517 // to specify (potentially duplicate) creation times.
512 bool SetCookieWithCreationTimeAndOptions(const GURL& url, 518 bool SetCookieWithCreationTimeAndOptions(const GURL& url,
513 const std::string& cookie_line, 519 const std::string& cookie_line,
514 const base::Time& creation_time, 520 const base::Time& creation_time,
515 const CookieOptions& options); 521 const CookieOptions& options);
516 522
517 // Helper function that sets a canonical cookie, deleting equivalents and 523 // Helper function that sets a canonical cookie, deleting equivalents and
518 // performing garbage collection. 524 // performing garbage collection.
525 // |source_url| is the URL that's attempting to set the cookie.
519 bool SetCanonicalCookie(std::unique_ptr<CanonicalCookie> cc, 526 bool SetCanonicalCookie(std::unique_ptr<CanonicalCookie> cc,
527 const GURL& source_url,
520 const CookieOptions& options); 528 const CookieOptions& options);
521 529
522 // Helper function calling SetCanonicalCookie() for all cookies in |list|. 530 // Helper function calling SetCanonicalCookie() for all cookies in |list|.
523 bool SetCanonicalCookies(const CookieList& list); 531 bool SetCanonicalCookies(const CookieList& list);
524 532
525 void InternalUpdateCookieAccessTime(CanonicalCookie* cc, 533 void InternalUpdateCookieAccessTime(CanonicalCookie* cc,
526 const base::Time& current_time); 534 const base::Time& current_time);
527 535
528 // |deletion_cause| argument is used for collecting statistics and choosing 536 // |deletion_cause| argument is used for collecting statistics and choosing
529 // the correct CookieMonsterDelegate::ChangeCause for OnCookieChanged 537 // the correct CookieMonsterDelegate::ChangeCause for OnCookieChanged
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 virtual ~PersistentCookieStore() {} 807 virtual ~PersistentCookieStore() {}
800 808
801 private: 809 private:
802 friend class base::RefCountedThreadSafe<PersistentCookieStore>; 810 friend class base::RefCountedThreadSafe<PersistentCookieStore>;
803 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); 811 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore);
804 }; 812 };
805 813
806 } // namespace net 814 } // namespace net
807 815
808 #endif // NET_COOKIES_COOKIE_MONSTER_H_ 816 #endif // NET_COOKIES_COOKIE_MONSTER_H_
OLDNEW
« no previous file with comments | « net/cookies/canonical_cookie_unittest.cc ('k') | net/cookies/cookie_monster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698