OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |