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

Side by Side Diff: net/disk_cache/memory/mem_backend_impl.cc

Issue 1304363013: Add a size estimation mechanism to StoragePartitionHttpCacheDataRemover. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Support null max time. Created 5 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
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 "net/disk_cache/memory/mem_backend_impl.h" 5 #include "net/disk_cache/memory/mem_backend_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/sys_info.h" 8 #include "base/sys_info.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/disk_cache/cache_util.h" 10 #include "net/disk_cache/cache_util.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 176
177 int MemBackendImpl::DoomEntriesSince(const base::Time initial_time, 177 int MemBackendImpl::DoomEntriesSince(const base::Time initial_time,
178 const CompletionCallback& callback) { 178 const CompletionCallback& callback) {
179 if (DoomEntriesSince(initial_time)) 179 if (DoomEntriesSince(initial_time))
180 return net::OK; 180 return net::OK;
181 181
182 return net::ERR_FAILED; 182 return net::ERR_FAILED;
183 } 183 }
184 184
185 int MemBackendImpl::CalculateSizeOfEntriesBetween(
186 base::Time initial_time,
187 base::Time end_time,
188 const CompletionCallback& callback) {
189 // TODO(msramek): Implement.
190 return net::ERR_NOT_IMPLEMENTED;
191 }
192
185 class MemBackendImpl::MemIterator : public Backend::Iterator { 193 class MemBackendImpl::MemIterator : public Backend::Iterator {
186 public: 194 public:
187 explicit MemIterator(base::WeakPtr<MemBackendImpl> backend) 195 explicit MemIterator(base::WeakPtr<MemBackendImpl> backend)
188 : backend_(backend), current_(NULL) { 196 : backend_(backend), current_(NULL) {
189 } 197 }
190 198
191 int OpenNextEntry(Entry** next_entry, 199 int OpenNextEntry(Entry** next_entry,
192 const CompletionCallback& callback) override { 200 const CompletionCallback& callback) override {
193 if (!backend_) 201 if (!backend_)
194 return net::ERR_FAILED; 202 return net::ERR_FAILED;
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 if (current_size_ > max_size_) 345 if (current_size_ > max_size_)
338 TrimCache(false); 346 TrimCache(false);
339 } 347 }
340 348
341 void MemBackendImpl::SubstractStorageSize(int32 bytes) { 349 void MemBackendImpl::SubstractStorageSize(int32 bytes) {
342 current_size_ -= bytes; 350 current_size_ -= bytes;
343 DCHECK_GE(current_size_, 0); 351 DCHECK_GE(current_size_, 0);
344 } 352 }
345 353
346 } // namespace disk_cache 354 } // namespace disk_cache
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698