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

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: static_cast Created 5 years, 2 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 | « net/disk_cache/memory/mem_backend_impl.h ('k') | net/disk_cache/simple/simple_backend_impl.h » ('j') | 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 "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::CalculateSizeOfAllEntries(
186 const CompletionCallback& callback) {
187 // TODO(msramek): Implement.
188 return net::ERR_NOT_IMPLEMENTED;
189 }
190
185 class MemBackendImpl::MemIterator : public Backend::Iterator { 191 class MemBackendImpl::MemIterator : public Backend::Iterator {
186 public: 192 public:
187 explicit MemIterator(base::WeakPtr<MemBackendImpl> backend) 193 explicit MemIterator(base::WeakPtr<MemBackendImpl> backend)
188 : backend_(backend), current_(NULL) { 194 : backend_(backend), current_(NULL) {
189 } 195 }
190 196
191 int OpenNextEntry(Entry** next_entry, 197 int OpenNextEntry(Entry** next_entry,
192 const CompletionCallback& callback) override { 198 const CompletionCallback& callback) override {
193 if (!backend_) 199 if (!backend_)
194 return net::ERR_FAILED; 200 return net::ERR_FAILED;
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 if (current_size_ > max_size_) 343 if (current_size_ > max_size_)
338 TrimCache(false); 344 TrimCache(false);
339 } 345 }
340 346
341 void MemBackendImpl::SubstractStorageSize(int32 bytes) { 347 void MemBackendImpl::SubstractStorageSize(int32 bytes) {
342 current_size_ -= bytes; 348 current_size_ -= bytes;
343 DCHECK_GE(current_size_, 0); 349 DCHECK_GE(current_size_, 0);
344 } 350 }
345 351
346 } // namespace disk_cache 352 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/memory/mem_backend_impl.h ('k') | net/disk_cache/simple/simple_backend_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698