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

Unified Diff: ios/net/http_cache_helper.cc

Issue 2270063005: Add support for time based deletion of browsing data on iOS (Closed)
Patch Set: Updated comment in AccountConsistencyService Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/net/http_cache_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/net/http_cache_helper.cc
diff --git a/ios/net/http_cache_helper.cc b/ios/net/http_cache_helper.cc
index 5aa57a1db7238f290980668f42797984370df0ec..12b91aa1bc50501295fdc7cac3cb7514de21e949 100644
--- a/ios/net/http_cache_helper.cc
+++ b/ios/net/http_cache_helper.cc
@@ -33,11 +33,14 @@ void PostCallback(const scoped_refptr<base::TaskRunner>& task_runner,
// Clears the disk_cache::Backend on the IO thread and deletes |backend|.
void DoomHttpCache(std::unique_ptr<disk_cache::Backend*> backend,
const scoped_refptr<base::TaskRunner>& client_task_runner,
+ const base::Time& delete_begin,
+ const base::Time& delete_end,
const net::CompletionCallback& callback,
int error) {
// |*backend| may be null in case of error.
if (*backend) {
- (*backend)->DoomAllEntries(
+ (*backend)->DoomEntriesBetween(
+ delete_begin, delete_end,
base::Bind(&PostCallback, client_task_runner, callback));
} else {
client_task_runner->PostTask(FROM_HERE, base::Bind(callback, error));
@@ -49,6 +52,8 @@ void DoomHttpCache(std::unique_ptr<disk_cache::Backend*> backend,
void ClearHttpCacheOnIOThread(
const scoped_refptr<net::URLRequestContextGetter>& getter,
const scoped_refptr<base::TaskRunner>& client_task_runner,
+ const base::Time& delete_begin,
+ const base::Time& delete_end,
const net::CompletionCallback& callback) {
net::HttpCache* http_cache =
getter->GetURLRequestContext()->http_transaction_factory()->GetCache();
@@ -72,7 +77,7 @@ void ClearHttpCacheOnIOThread(
disk_cache::Backend** backend_ptr = backend.get();
net::CompletionCallback doom_callback =
base::Bind(&DoomHttpCache, base::Passed(std::move(backend)),
- client_task_runner, callback);
+ client_task_runner, delete_begin, delete_end, callback);
int rv = http_cache->GetBackend(backend_ptr, doom_callback);
@@ -89,10 +94,14 @@ namespace net {
void ClearHttpCache(const scoped_refptr<net::URLRequestContextGetter>& getter,
const scoped_refptr<base::TaskRunner>& network_task_runner,
+ const base::Time& delete_begin,
+ const base::Time& delete_end,
const net::CompletionCallback& callback) {
+ DCHECK(delete_end != base::Time());
network_task_runner->PostTask(
FROM_HERE, base::Bind(&ClearHttpCacheOnIOThread, getter,
- base::ThreadTaskRunnerHandle::Get(), callback));
+ base::ThreadTaskRunnerHandle::Get(), delete_begin,
+ delete_end, callback));
}
} // namespace net
« no previous file with comments | « ios/net/http_cache_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698