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

Side by Side Diff: components/browsing_data/storage_partition_http_cache_data_remover.cc

Issue 2008323002: Add tests for the cache deletion in BrowsingDataRemover (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix memory leak Created 4 years, 6 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 | « components/browsing_data/conditional_cache_deletion_helper.cc ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/browsing_data/storage_partition_http_cache_data_remover.h" 5 #include "components/browsing_data/storage_partition_http_cache_data_remover.h"
6 6
7 #include "components/browsing_data/conditional_cache_deletion_helper.h" 7 #include "components/browsing_data/conditional_cache_deletion_helper.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "content/public/browser/storage_partition.h" 9 #include "content/public/browser/storage_partition.h"
10 #include "net/base/sdch_manager.h" 10 #include "net/base/sdch_manager.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 } 171 }
172 case STATE_PROCESS_MAIN: 172 case STATE_PROCESS_MAIN:
173 case STATE_PROCESS_MEDIA: { 173 case STATE_PROCESS_MEDIA: {
174 next_cache_state_ = (next_cache_state_ == STATE_PROCESS_MAIN) 174 next_cache_state_ = (next_cache_state_ == STATE_PROCESS_MAIN)
175 ? STATE_CREATE_MEDIA 175 ? STATE_CREATE_MEDIA
176 : STATE_DONE; 176 : STATE_DONE;
177 177
178 // |cache_| can be null if it cannot be initialized. 178 // |cache_| can be null if it cannot be initialized.
179 if (cache_) { 179 if (cache_) {
180 if (!url_predicate_.is_null()) { 180 if (!url_predicate_.is_null()) {
181 (new ConditionalCacheDeletionHelper( 181 rv = (new ConditionalCacheDeletionHelper(
182 cache_, 182 cache_,
183 ConditionalCacheDeletionHelper::CreateURLAndTimeCondition( 183 ConditionalCacheDeletionHelper::CreateURLAndTimeCondition(
184 url_predicate_, 184 url_predicate_,
185 delete_begin_, 185 delete_begin_,
186 delete_end_)))->DeleteAndDestroySelfWhenFinished( 186 delete_end_)))->DeleteAndDestroySelfWhenFinished(
187 base::Bind( 187 base::Bind(
188 &StoragePartitionHttpCacheDataRemover::DoClearCache, 188 &StoragePartitionHttpCacheDataRemover::DoClearCache,
189 base::Unretained(this))); 189 base::Unretained(this)));
190 } else if (delete_begin_.is_null() && delete_end_.is_max()) { 190 } else if (delete_begin_.is_null() && delete_end_.is_max()) {
191 rv = cache_->DoomAllEntries(base::Bind( 191 rv = cache_->DoomAllEntries(base::Bind(
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 default: { 298 default: {
299 NOTREACHED() << "bad state"; 299 NOTREACHED() << "bad state";
300 next_cache_state_ = STATE_NONE; // Stop looping. 300 next_cache_state_ = STATE_NONE; // Stop looping.
301 return; 301 return;
302 } 302 }
303 } 303 }
304 } 304 }
305 } 305 }
306 306
307 } // namespace browsing_data 307 } // namespace browsing_data
OLDNEW
« no previous file with comments | « components/browsing_data/conditional_cache_deletion_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698