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