| 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/backend_impl.h" | 5 #include "net/disk_cache/backend_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 298 |
| 299 if (init_) { | 299 if (init_) { |
| 300 StoreStats(); | 300 StoreStats(); |
| 301 if (data_) | 301 if (data_) |
| 302 data_->header.crash = 0; | 302 data_->header.crash = 0; |
| 303 | 303 |
| 304 if (user_flags_ & kNoRandom) { | 304 if (user_flags_ & kNoRandom) { |
| 305 // This is a net_unittest, verify that we are not 'leaking' entries. | 305 // This is a net_unittest, verify that we are not 'leaking' entries. |
| 306 File::WaitForPendingIO(&num_pending_io_); | 306 File::WaitForPendingIO(&num_pending_io_); |
| 307 DCHECK(!num_refs_); | 307 DCHECK(!num_refs_); |
| 308 } else { |
| 309 File::DropPendingIO(); |
| 308 } | 310 } |
| 309 } | 311 } |
| 310 block_files_.CloseFiles(); | 312 block_files_.CloseFiles(); |
| 311 FlushIndex(); | 313 FlushIndex(); |
| 312 index_ = NULL; | 314 index_ = NULL; |
| 313 ptr_factory_.InvalidateWeakPtrs(); | 315 ptr_factory_.InvalidateWeakPtrs(); |
| 314 done_.Signal(); | 316 done_.Signal(); |
| 315 } | 317 } |
| 316 | 318 |
| 317 // ------------------------------------------------------------------------ | 319 // ------------------------------------------------------------------------ |
| (...skipping 1759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2077 if (total_memory > kMaxBuffersSize || total_memory <= 0) | 2079 if (total_memory > kMaxBuffersSize || total_memory <= 0) |
| 2078 total_memory = kMaxBuffersSize; | 2080 total_memory = kMaxBuffersSize; |
| 2079 | 2081 |
| 2080 done = true; | 2082 done = true; |
| 2081 } | 2083 } |
| 2082 | 2084 |
| 2083 return static_cast<int>(total_memory); | 2085 return static_cast<int>(total_memory); |
| 2084 } | 2086 } |
| 2085 | 2087 |
| 2086 } // namespace disk_cache | 2088 } // namespace disk_cache |
| OLD | NEW |