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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover.h ('k') | no next file » | 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 #include "chrome/browser/browsing_data/browsing_data_remover.h" 5 #include "chrome/browser/browsing_data/browsing_data_remover.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "content/public/browser/plugin_data_remover.h" 54 #include "content/public/browser/plugin_data_remover.h"
55 #include "content/public/browser/storage_partition.h" 55 #include "content/public/browser/storage_partition.h"
56 #include "content/public/browser/user_metrics.h" 56 #include "content/public/browser/user_metrics.h"
57 #include "net/base/net_errors.h" 57 #include "net/base/net_errors.h"
58 #include "net/base/server_bound_cert_service.h" 58 #include "net/base/server_bound_cert_service.h"
59 #include "net/base/server_bound_cert_store.h" 59 #include "net/base/server_bound_cert_store.h"
60 #include "net/base/transport_security_state.h" 60 #include "net/base/transport_security_state.h"
61 #include "net/cookies/cookie_store.h" 61 #include "net/cookies/cookie_store.h"
62 #include "net/disk_cache/disk_cache.h" 62 #include "net/disk_cache/disk_cache.h"
63 #include "net/http/http_cache.h" 63 #include "net/http/http_cache.h"
64 #include "net/http/infinite_cache.h"
64 #include "net/url_request/url_request_context.h" 65 #include "net/url_request/url_request_context.h"
65 #include "net/url_request/url_request_context_getter.h" 66 #include "net/url_request/url_request_context_getter.h"
66 #include "webkit/dom_storage/dom_storage_context.h" 67 #include "webkit/dom_storage/dom_storage_context.h"
67 #include "webkit/quota/quota_manager.h" 68 #include "webkit/quota/quota_manager.h"
68 #include "webkit/quota/quota_types.h" 69 #include "webkit/quota/quota_types.h"
69 #include "webkit/quota/special_storage_policy.h" 70 #include "webkit/quota/special_storage_policy.h"
70 71
71 using content::BrowserContext; 72 using content::BrowserContext;
72 using content::BrowserThread; 73 using content::BrowserThread;
73 using content::DOMStorageContext; 74 using content::DOMStorageContext;
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 base::Unretained(this))); 667 base::Unretained(this)));
667 } else { 668 } else {
668 rv = cache_->DoomEntriesBetween( 669 rv = cache_->DoomEntriesBetween(
669 delete_begin_, delete_end_, 670 delete_begin_, delete_end_,
670 base::Bind(&BrowsingDataRemover::DoClearCache, 671 base::Bind(&BrowsingDataRemover::DoClearCache,
671 base::Unretained(this))); 672 base::Unretained(this)));
672 } 673 }
673 cache_ = NULL; 674 cache_ = NULL;
674 } 675 }
675 next_cache_state_ = (next_cache_state_ == STATE_DELETE_MAIN) ? 676 next_cache_state_ = (next_cache_state_ == STATE_DELETE_MAIN) ?
676 STATE_CREATE_MEDIA : STATE_DONE; 677 STATE_CREATE_MEDIA : STATE_DELETE_EXPERIMENT;
678 break;
679 }
680 case STATE_DELETE_EXPERIMENT: {
681 cache_ = NULL;
682 // Get a pointer to the experiment.
683 net::HttpTransactionFactory* factory =
684 main_context_getter_->GetURLRequestContext()->
685 http_transaction_factory();
686 net::InfiniteCache* infinite_cache =
687 factory->GetCache()->infinite_cache();
688
689 if (delete_begin_.is_null()) {
690 rv = infinite_cache->DeleteData(
691 base::Bind(&BrowsingDataRemover::DoClearCache,
692 base::Unretained(this)));
693 } else {
694 rv = infinite_cache->DeleteDataBetween(
695 delete_begin_, delete_end_,
696 base::Bind(&BrowsingDataRemover::DoClearCache,
697 base::Unretained(this)));
698 }
699 next_cache_state_ = STATE_DONE;
677 break; 700 break;
678 } 701 }
679 case STATE_DONE: { 702 case STATE_DONE: {
680 cache_ = NULL; 703 cache_ = NULL;
681 704
682 // Notify the UI thread that we are done. 705 // Notify the UI thread that we are done.
683 BrowserThread::PostTask( 706 BrowserThread::PostTask(
684 BrowserThread::UI, FROM_HERE, 707 BrowserThread::UI, FROM_HERE,
685 base::Bind(&BrowsingDataRemover::ClearedCache, 708 base::Bind(&BrowsingDataRemover::ClearedCache,
686 base::Unretained(this))); 709 base::Unretained(this)));
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 BrowserThread::UI, FROM_HERE, 942 BrowserThread::UI, FROM_HERE,
920 base::Bind(&BrowsingDataRemover::OnClearedFormData, 943 base::Bind(&BrowsingDataRemover::OnClearedFormData,
921 base::Unretained(this))); 944 base::Unretained(this)));
922 } 945 }
923 946
924 void BrowsingDataRemover::OnClearedFormData() { 947 void BrowsingDataRemover::OnClearedFormData() {
925 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 948 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
926 waiting_for_clear_form_ = false; 949 waiting_for_clear_form_ = false;
927 NotifyAndDeleteIfDone(); 950 NotifyAndDeleteIfDone();
928 } 951 }
OLDNEW
« 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