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

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

Issue 1701063002: CookieStore: Remove reference counting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@threadsafe
Patch Set: merge Created 4 years, 9 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/cookie_store.cc ('k') | net/cookies/cookie_store_test_helpers.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 #ifndef NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_ 5 #ifndef NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_
6 #define NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_ 6 #define NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_
7 7
8 #include "net/cookies/cookie_monster.h" 8 #include "net/cookies/cookie_monster.h"
9 9
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/callback_forward.h" 13 #include "base/callback_forward.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 namespace net { 16 namespace net {
17 17
18 class DelayedCookieMonster : public CookieStore { 18 class DelayedCookieMonster : public CookieStore {
19 public: 19 public:
20 DelayedCookieMonster(); 20 DelayedCookieMonster();
21 21
22 ~DelayedCookieMonster() override;
23
22 // Call the asynchronous CookieMonster function, expect it to immediately 24 // Call the asynchronous CookieMonster function, expect it to immediately
23 // invoke the internal callback. 25 // invoke the internal callback.
24 // Post a delayed task to invoke the original callback with the results. 26 // Post a delayed task to invoke the original callback with the results.
25 27
26 void SetCookieWithOptionsAsync( 28 void SetCookieWithOptionsAsync(
27 const GURL& url, 29 const GURL& url,
28 const std::string& cookie_line, 30 const std::string& cookie_line,
29 const CookieOptions& options, 31 const CookieOptions& options,
30 const CookieMonster::SetCookiesCallback& callback) override; 32 const CookieMonster::SetCookiesCallback& callback) override;
31 33
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 void InvokeSetCookiesCallback( 106 void InvokeSetCookiesCallback(
105 const CookieMonster::SetCookiesCallback& callback); 107 const CookieMonster::SetCookiesCallback& callback);
106 108
107 void InvokeGetCookieStringCallback( 109 void InvokeGetCookieStringCallback(
108 const CookieMonster::GetCookiesCallback& callback); 110 const CookieMonster::GetCookiesCallback& callback);
109 111
110 void InvokeGetCookieListCallback( 112 void InvokeGetCookieListCallback(
111 const CookieMonster::GetCookieListCallback& callback); 113 const CookieMonster::GetCookieListCallback& callback);
112 114
113 friend class base::RefCountedThreadSafe<DelayedCookieMonster>; 115 friend class base::RefCountedThreadSafe<DelayedCookieMonster>;
114 ~DelayedCookieMonster() override;
115 116
116 scoped_refptr<CookieMonster> cookie_monster_; 117 scoped_ptr<CookieMonster> cookie_monster_;
117 118
118 bool did_run_; 119 bool did_run_;
119 bool result_; 120 bool result_;
120 std::string cookie_; 121 std::string cookie_;
121 std::string cookie_line_; 122 std::string cookie_line_;
122 CookieList cookie_list_; 123 CookieList cookie_list_;
123 }; 124 };
124 125
125 class CookieURLHelper { 126 class CookieURLHelper {
126 public: 127 public:
(...skipping 11 matching lines...) Expand all
138 139
139 private: 140 private:
140 const GURL url_; 141 const GURL url_;
141 const std::string registry_; 142 const std::string registry_;
142 const std::string domain_and_registry_; 143 const std::string domain_and_registry_;
143 }; 144 };
144 145
145 } // namespace net 146 } // namespace net
146 147
147 #endif // NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_ 148 #endif // NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_
OLDNEW
« no previous file with comments | « net/cookies/cookie_store.cc ('k') | net/cookies/cookie_store_test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698