| 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_worker_v3.h" | 5 #include "net/disk_cache/blockfile/backend_worker_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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 117 } |
| 118 | 118 |
| 119 num_refs_ = num_pending_io_ = max_refs_ = 0; | 119 num_refs_ = num_pending_io_ = max_refs_ = 0; |
| 120 entry_count_ = byte_count_ = 0; | 120 entry_count_ = byte_count_ = 0; |
| 121 | 121 |
| 122 if (!restarted_) { | 122 if (!restarted_) { |
| 123 buffer_bytes_ = 0; | 123 buffer_bytes_ = 0; |
| 124 trace_object_ = TraceObject::GetTraceObject(); | 124 trace_object_ = TraceObject::GetTraceObject(); |
| 125 // Create a recurrent timer of 30 secs. | 125 // Create a recurrent timer of 30 secs. |
| 126 int timer_delay = unit_test_ ? 1000 : 30000; | 126 int timer_delay = unit_test_ ? 1000 : 30000; |
| 127 timer_.reset(new base::RepeatingTimer<BackendImpl>()); | 127 timer_.reset(new base::RepeatingTimer()); |
| 128 timer_->Start(FROM_HERE, TimeDelta::FromMilliseconds(timer_delay), this, | 128 timer_->Start(FROM_HERE, TimeDelta::FromMilliseconds(timer_delay), this, |
| 129 &BackendImpl::OnStatsTimer); | 129 &BackendImpl::OnStatsTimer); |
| 130 } | 130 } |
| 131 | 131 |
| 132 init_ = true; | 132 init_ = true; |
| 133 Trace("Init"); | 133 Trace("Init"); |
| 134 | 134 |
| 135 if (data_->header.experiment != NO_EXPERIMENT && | 135 if (data_->header.experiment != NO_EXPERIMENT && |
| 136 cache_type_ != net::DISK_CACHE) { | 136 cache_type_ != net::DISK_CACHE) { |
| 137 // No experiment for other caches. | 137 // No experiment for other caches. |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 #endif // defined(V3_NOT_JUST_YET_READY). | 458 #endif // defined(V3_NOT_JUST_YET_READY). |
| 459 | 459 |
| 460 int BackendImplV3::Worker::Init(const CompletionCallback& callback) { | 460 int BackendImplV3::Worker::Init(const CompletionCallback& callback) { |
| 461 return net::ERR_FAILED; | 461 return net::ERR_FAILED; |
| 462 } | 462 } |
| 463 | 463 |
| 464 BackendImplV3::Worker::~Worker() { | 464 BackendImplV3::Worker::~Worker() { |
| 465 } | 465 } |
| 466 | 466 |
| 467 } // namespace disk_cache | 467 } // namespace disk_cache |
| OLD | NEW |