| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 return net::ERR_FAILED; | 152 return net::ERR_FAILED; |
| 153 } | 153 } |
| 154 | 154 |
| 155 int MemBackendImpl::DoomAllEntries(OldCompletionCallback* callback) { | 155 int MemBackendImpl::DoomAllEntries(OldCompletionCallback* callback) { |
| 156 if (DoomAllEntries()) | 156 if (DoomAllEntries()) |
| 157 return net::OK; | 157 return net::OK; |
| 158 | 158 |
| 159 return net::ERR_FAILED; | 159 return net::ERR_FAILED; |
| 160 } | 160 } |
| 161 | 161 |
| 162 int MemBackendImpl::DoomAllEntries(const net::CompletionCallback& callback) { |
| 163 if (DoomAllEntries()) |
| 164 return net::OK; |
| 165 |
| 166 return net::ERR_FAILED; |
| 167 } |
| 168 |
| 162 int MemBackendImpl::DoomEntriesBetween(const base::Time initial_time, | 169 int MemBackendImpl::DoomEntriesBetween(const base::Time initial_time, |
| 163 const base::Time end_time, | 170 const base::Time end_time, |
| 164 OldCompletionCallback* callback) { | 171 OldCompletionCallback* callback) { |
| 165 if (DoomEntriesBetween(initial_time, end_time)) | 172 if (DoomEntriesBetween(initial_time, end_time)) |
| 166 return net::OK; | 173 return net::OK; |
| 167 | 174 |
| 168 return net::ERR_FAILED; | 175 return net::ERR_FAILED; |
| 169 } | 176 } |
| 170 | 177 |
| 178 int MemBackendImpl::DoomEntriesBetween( |
| 179 const base::Time initial_time, const base::Time end_time, |
| 180 const net::CompletionCallback& callback) { |
| 181 if (DoomEntriesBetween(initial_time, end_time)) |
| 182 return net::OK; |
| 183 |
| 184 return net::ERR_FAILED; |
| 185 } |
| 186 |
| 171 int MemBackendImpl::DoomEntriesSince(const base::Time initial_time, | 187 int MemBackendImpl::DoomEntriesSince(const base::Time initial_time, |
| 172 OldCompletionCallback* callback) { | 188 OldCompletionCallback* callback) { |
| 173 if (DoomEntriesSince(initial_time)) | 189 if (DoomEntriesSince(initial_time)) |
| 174 return net::OK; | 190 return net::OK; |
| 175 | 191 |
| 176 return net::ERR_FAILED; | 192 return net::ERR_FAILED; |
| 177 } | 193 } |
| 178 | 194 |
| 179 int MemBackendImpl::OpenNextEntry(void** iter, Entry** next_entry, | 195 int MemBackendImpl::OpenNextEntry(void** iter, Entry** next_entry, |
| 180 OldCompletionCallback* callback) { | 196 OldCompletionCallback* callback) { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 if (current_size_ > max_size_) | 334 if (current_size_ > max_size_) |
| 319 TrimCache(false); | 335 TrimCache(false); |
| 320 } | 336 } |
| 321 | 337 |
| 322 void MemBackendImpl::SubstractStorageSize(int32 bytes) { | 338 void MemBackendImpl::SubstractStorageSize(int32 bytes) { |
| 323 current_size_ -= bytes; | 339 current_size_ -= bytes; |
| 324 DCHECK_GE(current_size_, 0); | 340 DCHECK_GE(current_size_, 0); |
| 325 } | 341 } |
| 326 | 342 |
| 327 } // namespace disk_cache | 343 } // namespace disk_cache |
| OLD | NEW |