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

Unified Diff: chrome/browser/browsing_data/browsing_data_remover.cc

Issue 10928197: Browsing data: Clear the "infinite cache" simulation data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | « chrome/browser/browsing_data/browsing_data_remover.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browsing_data/browsing_data_remover.cc
===================================================================
--- chrome/browser/browsing_data/browsing_data_remover.cc (revision 156633)
+++ chrome/browser/browsing_data/browsing_data_remover.cc (working copy)
@@ -61,6 +61,7 @@
#include "net/cookies/cookie_store.h"
#include "net/disk_cache/disk_cache.h"
#include "net/http/http_cache.h"
+#include "net/http/infinite_cache.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "webkit/dom_storage/dom_storage_context.h"
@@ -673,9 +674,31 @@
cache_ = NULL;
}
next_cache_state_ = (next_cache_state_ == STATE_DELETE_MAIN) ?
- STATE_CREATE_MEDIA : STATE_DONE;
+ STATE_CREATE_MEDIA : STATE_DELETE_EXPERIMENT;
break;
}
+ case STATE_DELETE_EXPERIMENT: {
+ cache_ = NULL;
+ // Get a pointer to the experiment.
+ net::HttpTransactionFactory* factory =
+ main_context_getter_->GetURLRequestContext()->
+ http_transaction_factory();
+ net::InfiniteCache* infinite_cache =
+ factory->GetCache()->infinite_cache();
+
+ if (delete_begin_.is_null()) {
+ rv = infinite_cache->DeleteData(
+ base::Bind(&BrowsingDataRemover::DoClearCache,
+ base::Unretained(this)));
+ } else {
+ rv = infinite_cache->DeleteDataBetween(
+ delete_begin_, delete_end_,
+ base::Bind(&BrowsingDataRemover::DoClearCache,
+ base::Unretained(this)));
+ }
+ next_cache_state_ = STATE_DONE;
+ break;
+ }
case STATE_DONE: {
cache_ = NULL;
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698