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

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

Issue 1893083002: Change scoped_ptr to std::unique_ptr in //net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-net-all: iwyu Created 4 years, 8 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>
11 #include <stdint.h> 11 #include <stdint.h>
12 12
13 #include <deque> 13 #include <deque>
14 #include <map> 14 #include <map>
15 #include <memory>
15 #include <queue> 16 #include <queue>
16 #include <set> 17 #include <set>
17 #include <string> 18 #include <string>
18 #include <utility> 19 #include <utility>
19 #include <vector> 20 #include <vector>
20 21
21 #include "base/callback_forward.h" 22 #include "base/callback_forward.h"
22 #include "base/gtest_prod_util.h" 23 #include "base/gtest_prod_util.h"
23 #include "base/macros.h" 24 #include "base/macros.h"
24 #include "base/memory/linked_ptr.h" 25 #include "base/memory/linked_ptr.h"
25 #include "base/memory/ref_counted.h" 26 #include "base/memory/ref_counted.h"
26 #include "base/memory/scoped_ptr.h"
27 #include "base/memory/weak_ptr.h" 27 #include "base/memory/weak_ptr.h"
28 #include "base/threading/thread_checker.h" 28 #include "base/threading/thread_checker.h"
29 #include "base/time/time.h" 29 #include "base/time/time.h"
30 #include "net/base/net_export.h" 30 #include "net/base/net_export.h"
31 #include "net/cookies/canonical_cookie.h" 31 #include "net/cookies/canonical_cookie.h"
32 #include "net/cookies/cookie_constants.h" 32 #include "net/cookies/cookie_constants.h"
33 #include "net/cookies/cookie_store.h" 33 #include "net/cookies/cookie_store.h"
34 #include "url/gurl.h" 34 #include "url/gurl.h"
35 35
36 namespace base { 36 namespace base {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 void SetPersistSessionCookies(bool persist_session_cookies); 203 void SetPersistSessionCookies(bool persist_session_cookies);
204 204
205 // Determines if the scheme of the URL is a scheme that cookies will be 205 // Determines if the scheme of the URL is a scheme that cookies will be
206 // stored for. 206 // stored for.
207 bool IsCookieableScheme(const std::string& scheme); 207 bool IsCookieableScheme(const std::string& scheme);
208 208
209 // The default list of schemes the cookie monster can handle. 209 // The default list of schemes the cookie monster can handle.
210 static const char* const kDefaultCookieableSchemes[]; 210 static const char* const kDefaultCookieableSchemes[];
211 static const int kDefaultCookieableSchemesCount; 211 static const int kDefaultCookieableSchemesCount;
212 212
213 scoped_ptr<CookieChangedSubscription> AddCallbackForCookie( 213 std::unique_ptr<CookieChangedSubscription> AddCallbackForCookie(
214 const GURL& url, 214 const GURL& url,
215 const std::string& name, 215 const std::string& name,
216 const CookieChangedCallback& callback) override; 216 const CookieChangedCallback& callback) override;
217 217
218 bool IsEphemeral() override; 218 bool IsEphemeral() override;
219 219
220 private: 220 private:
221 // For queueing the cookie monster calls. 221 // For queueing the cookie monster calls.
222 class CookieMonsterTask; 222 class CookieMonsterTask;
223 template <typename Result> 223 template <typename Result>
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 // Helper function that sets cookies with more control. 512 // Helper function that sets cookies with more control.
513 // Not exposed as we don't want callers to have the ability 513 // Not exposed as we don't want callers to have the ability
514 // to specify (potentially duplicate) creation times. 514 // to specify (potentially duplicate) creation times.
515 bool SetCookieWithCreationTimeAndOptions(const GURL& url, 515 bool SetCookieWithCreationTimeAndOptions(const GURL& url,
516 const std::string& cookie_line, 516 const std::string& cookie_line,
517 const base::Time& creation_time, 517 const base::Time& creation_time,
518 const CookieOptions& options); 518 const CookieOptions& options);
519 519
520 // Helper function that sets a canonical cookie, deleting equivalents and 520 // Helper function that sets a canonical cookie, deleting equivalents and
521 // performing garbage collection. 521 // performing garbage collection.
522 bool SetCanonicalCookie(scoped_ptr<CanonicalCookie> cc, 522 bool SetCanonicalCookie(std::unique_ptr<CanonicalCookie> cc,
523 const CookieOptions& options); 523 const CookieOptions& options);
524 524
525 // Helper function calling SetCanonicalCookie() for all cookies in |list|. 525 // Helper function calling SetCanonicalCookie() for all cookies in |list|.
526 bool SetCanonicalCookies(const CookieList& list); 526 bool SetCanonicalCookies(const CookieList& list);
527 527
528 void InternalUpdateCookieAccessTime(CanonicalCookie* cc, 528 void InternalUpdateCookieAccessTime(CanonicalCookie* cc,
529 const base::Time& current_time); 529 const base::Time& current_time);
530 530
531 // |deletion_cause| argument is used for collecting statistics and choosing 531 // |deletion_cause| argument is used for collecting statistics and choosing
532 // the correct CookieMonsterDelegate::ChangeCause for OnCookieChanged 532 // the correct CookieMonsterDelegate::ChangeCause for OnCookieChanged
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 virtual ~PersistentCookieStore() {} 807 virtual ~PersistentCookieStore() {}
808 808
809 private: 809 private:
810 friend class base::RefCountedThreadSafe<PersistentCookieStore>; 810 friend class base::RefCountedThreadSafe<PersistentCookieStore>;
811 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); 811 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore);
812 }; 812 };
813 813
814 } // namespace net 814 } // namespace net
815 815
816 #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