| 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/blockfile/backend_impl_v3.h" | 5 #include "net/disk_cache/blockfile/backend_impl_v3.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/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 } | 1019 } |
| 1020 | 1020 |
| 1021 num_refs_ = num_pending_io_ = max_refs_ = 0; | 1021 num_refs_ = num_pending_io_ = max_refs_ = 0; |
| 1022 entry_count_ = byte_count_ = 0; | 1022 entry_count_ = byte_count_ = 0; |
| 1023 | 1023 |
| 1024 if (!restarted_) { | 1024 if (!restarted_) { |
| 1025 buffer_bytes_ = 0; | 1025 buffer_bytes_ = 0; |
| 1026 trace_object_ = TraceObject::GetTraceObject(); | 1026 trace_object_ = TraceObject::GetTraceObject(); |
| 1027 // Create a recurrent timer of 30 secs. | 1027 // Create a recurrent timer of 30 secs. |
| 1028 int timer_delay = unit_test_ ? 1000 : 30000; | 1028 int timer_delay = unit_test_ ? 1000 : 30000; |
| 1029 timer_.reset(new base::RepeatingTimer<BackendImplV3>()); | 1029 timer_.reset(new base::RepeatingTimer()); |
| 1030 timer_->Start(FROM_HERE, TimeDelta::FromMilliseconds(timer_delay), this, | 1030 timer_->Start(FROM_HERE, TimeDelta::FromMilliseconds(timer_delay), this, |
| 1031 &BackendImplV3::OnStatsTimer); | 1031 &BackendImplV3::OnStatsTimer); |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 init_ = true; | 1034 init_ = true; |
| 1035 Trace("Init"); | 1035 Trace("Init"); |
| 1036 | 1036 |
| 1037 if (data_->header.experiment != NO_EXPERIMENT && | 1037 if (data_->header.experiment != NO_EXPERIMENT && |
| 1038 cache_type_ != net::DISK_CACHE) { | 1038 cache_type_ != net::DISK_CACHE) { |
| 1039 // No experiment for other caches. | 1039 // No experiment for other caches. |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1526 } | 1526 } |
| 1527 | 1527 |
| 1528 void BackendImplV3::OnExternalCacheHit(const std::string& key) { | 1528 void BackendImplV3::OnExternalCacheHit(const std::string& key) { |
| 1529 NOTIMPLEMENTED(); | 1529 NOTIMPLEMENTED(); |
| 1530 } | 1530 } |
| 1531 | 1531 |
| 1532 void BackendImplV3::CleanupCache() { | 1532 void BackendImplV3::CleanupCache() { |
| 1533 } | 1533 } |
| 1534 | 1534 |
| 1535 } // namespace disk_cache | 1535 } // namespace disk_cache |
| OLD | NEW |