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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_remover_impl_unittest.cc

Issue 2826783003: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/browsing_data (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 } 169 }
170 content::ZoomLevelDelegate* GetZoomLevelDelegate() override { 170 content::ZoomLevelDelegate* GetZoomLevelDelegate() override {
171 return nullptr; 171 return nullptr;
172 } 172 }
173 173
174 void ClearDataForOrigin(uint32_t remove_mask, 174 void ClearDataForOrigin(uint32_t remove_mask,
175 uint32_t quota_storage_remove_mask, 175 uint32_t quota_storage_remove_mask,
176 const GURL& storage_origin, 176 const GURL& storage_origin,
177 net::URLRequestContextGetter* rq_context, 177 net::URLRequestContextGetter* rq_context,
178 const base::Closure& callback) override { 178 const base::Closure& callback) override {
179 BrowserThread::PostTask(BrowserThread::UI, 179 BrowserThread::PostTask(
180 FROM_HERE, 180 BrowserThread::UI, FROM_HERE,
181 base::Bind(&TestStoragePartition::AsyncRunCallback, 181 base::BindOnce(&TestStoragePartition::AsyncRunCallback,
182 base::Unretained(this), 182 base::Unretained(this), callback));
183 callback));
184 } 183 }
185 184
186 void ClearData(uint32_t remove_mask, 185 void ClearData(uint32_t remove_mask,
187 uint32_t quota_storage_remove_mask, 186 uint32_t quota_storage_remove_mask,
188 const GURL& storage_origin, 187 const GURL& storage_origin,
189 const OriginMatcherFunction& origin_matcher, 188 const OriginMatcherFunction& origin_matcher,
190 const base::Time begin, 189 const base::Time begin,
191 const base::Time end, 190 const base::Time end,
192 const base::Closure& callback) override { 191 const base::Closure& callback) override {
193 // Store stuff to verify parameters' correctness later. 192 // Store stuff to verify parameters' correctness later.
194 storage_partition_removal_data_.remove_mask = remove_mask; 193 storage_partition_removal_data_.remove_mask = remove_mask;
195 storage_partition_removal_data_.quota_storage_remove_mask = 194 storage_partition_removal_data_.quota_storage_remove_mask =
196 quota_storage_remove_mask; 195 quota_storage_remove_mask;
197 storage_partition_removal_data_.remove_begin = begin; 196 storage_partition_removal_data_.remove_begin = begin;
198 storage_partition_removal_data_.remove_end = end; 197 storage_partition_removal_data_.remove_end = end;
199 storage_partition_removal_data_.origin_matcher = origin_matcher; 198 storage_partition_removal_data_.origin_matcher = origin_matcher;
200 199
201 BrowserThread::PostTask( 200 BrowserThread::PostTask(
202 BrowserThread::UI, 201 BrowserThread::UI, FROM_HERE,
203 FROM_HERE, 202 base::BindOnce(&TestStoragePartition::AsyncRunCallback,
204 base::Bind(&TestStoragePartition::AsyncRunCallback, 203 base::Unretained(this), callback));
205 base::Unretained(this), callback));
206 } 204 }
207 205
208 void ClearData(uint32_t remove_mask, 206 void ClearData(uint32_t remove_mask,
209 uint32_t quota_storage_remove_mask, 207 uint32_t quota_storage_remove_mask,
210 const OriginMatcherFunction& origin_matcher, 208 const OriginMatcherFunction& origin_matcher,
211 const CookieMatcherFunction& cookie_matcher, 209 const CookieMatcherFunction& cookie_matcher,
212 const base::Time begin, 210 const base::Time begin,
213 const base::Time end, 211 const base::Time end,
214 const base::Closure& callback) override { 212 const base::Closure& callback) override {
215 // Store stuff to verify parameters' correctness later. 213 // Store stuff to verify parameters' correctness later.
216 storage_partition_removal_data_.remove_mask = remove_mask; 214 storage_partition_removal_data_.remove_mask = remove_mask;
217 storage_partition_removal_data_.quota_storage_remove_mask = 215 storage_partition_removal_data_.quota_storage_remove_mask =
218 quota_storage_remove_mask; 216 quota_storage_remove_mask;
219 storage_partition_removal_data_.remove_begin = begin; 217 storage_partition_removal_data_.remove_begin = begin;
220 storage_partition_removal_data_.remove_end = end; 218 storage_partition_removal_data_.remove_end = end;
221 storage_partition_removal_data_.origin_matcher = origin_matcher; 219 storage_partition_removal_data_.origin_matcher = origin_matcher;
222 storage_partition_removal_data_.cookie_matcher = cookie_matcher; 220 storage_partition_removal_data_.cookie_matcher = cookie_matcher;
223 221
224 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 222 BrowserThread::PostTask(
225 base::Bind(&TestStoragePartition::AsyncRunCallback, 223 BrowserThread::UI, FROM_HERE,
226 base::Unretained(this), callback)); 224 base::BindOnce(&TestStoragePartition::AsyncRunCallback,
225 base::Unretained(this), callback));
227 } 226 }
228 227
229 void ClearHttpAndMediaCaches( 228 void ClearHttpAndMediaCaches(
230 const base::Time begin, 229 const base::Time begin,
231 const base::Time end, 230 const base::Time end,
232 const base::Callback<bool(const GURL&)>& url_matcher, 231 const base::Callback<bool(const GURL&)>& url_matcher,
233 const base::Closure& callback) override { 232 const base::Closure& callback) override {
234 // Not needed in this test. 233 // Not needed in this test.
235 } 234 }
236 235
(...skipping 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1707 1706
1708 EXPECT_TRUE(remover->is_removing()); 1707 EXPECT_TRUE(remover->is_removing());
1709 1708
1710 // Add one more deletion and wait for it. 1709 // Add one more deletion and wait for it.
1711 BlockUntilBrowsingDataRemoved( 1710 BlockUntilBrowsingDataRemoved(
1712 base::Time(), base::Time::Max(), BrowsingDataRemover::DATA_TYPE_COOKIES, 1711 base::Time(), base::Time::Max(), BrowsingDataRemover::DATA_TYPE_COOKIES,
1713 BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB); 1712 BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB);
1714 1713
1715 EXPECT_FALSE(remover->is_removing()); 1714 EXPECT_FALSE(remover->is_removing());
1716 } 1715 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698