| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/mem_backend_impl.h" | 5 #include "net/disk_cache/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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 return net::ERR_FAILED; | 168 return net::ERR_FAILED; |
| 169 } | 169 } |
| 170 | 170 |
| 171 int MemBackendImpl::DoomAllEntries(OldCompletionCallback* callback) { | 171 int MemBackendImpl::DoomAllEntries(OldCompletionCallback* callback) { |
| 172 if (DoomAllEntries()) | 172 if (DoomAllEntries()) |
| 173 return net::OK; | 173 return net::OK; |
| 174 | 174 |
| 175 return net::ERR_FAILED; | 175 return net::ERR_FAILED; |
| 176 } | 176 } |
| 177 | 177 |
| 178 int MemBackendImpl::DoomAllEntries(const net::CompletionCallback& callback) { |
| 179 if (DoomAllEntries()) |
| 180 return net::OK; |
| 181 |
| 182 return net::ERR_FAILED; |
| 183 } |
| 184 |
| 178 int MemBackendImpl::DoomEntriesBetween(const base::Time initial_time, | 185 int MemBackendImpl::DoomEntriesBetween(const base::Time initial_time, |
| 179 const base::Time end_time, | 186 const base::Time end_time, |
| 180 OldCompletionCallback* callback) { | 187 OldCompletionCallback* callback) { |
| 181 if (DoomEntriesBetween(initial_time, end_time)) | 188 if (DoomEntriesBetween(initial_time, end_time)) |
| 182 return net::OK; | 189 return net::OK; |
| 183 | 190 |
| 184 return net::ERR_FAILED; | 191 return net::ERR_FAILED; |
| 185 } | 192 } |
| 186 | 193 |
| 194 int MemBackendImpl::DoomEntriesBetween( |
| 195 const base::Time initial_time, const base::Time end_time, |
| 196 const net::CompletionCallback& callback) { |
| 197 if (DoomEntriesBetween(initial_time, end_time)) |
| 198 return net::OK; |
| 199 |
| 200 return net::ERR_FAILED; |
| 201 } |
| 202 |
| 187 int MemBackendImpl::DoomEntriesSince(const base::Time initial_time, | 203 int MemBackendImpl::DoomEntriesSince(const base::Time initial_time, |
| 188 OldCompletionCallback* callback) { | 204 OldCompletionCallback* callback) { |
| 189 if (DoomEntriesSince(initial_time)) | 205 if (DoomEntriesSince(initial_time)) |
| 190 return net::OK; | 206 return net::OK; |
| 191 | 207 |
| 192 return net::ERR_FAILED; | 208 return net::ERR_FAILED; |
| 193 } | 209 } |
| 194 | 210 |
| 195 int MemBackendImpl::OpenNextEntry(void** iter, Entry** next_entry, | 211 int MemBackendImpl::OpenNextEntry(void** iter, Entry** next_entry, |
| 196 OldCompletionCallback* callback) { | 212 OldCompletionCallback* callback) { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 if (current_size_ > max_size_) | 350 if (current_size_ > max_size_) |
| 335 TrimCache(false); | 351 TrimCache(false); |
| 336 } | 352 } |
| 337 | 353 |
| 338 void MemBackendImpl::SubstractStorageSize(int32 bytes) { | 354 void MemBackendImpl::SubstractStorageSize(int32 bytes) { |
| 339 current_size_ -= bytes; | 355 current_size_ -= bytes; |
| 340 DCHECK_GE(current_size_, 0); | 356 DCHECK_GE(current_size_, 0); |
| 341 } | 357 } |
| 342 | 358 |
| 343 } // namespace disk_cache | 359 } // namespace disk_cache |
| OLD | NEW |