Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: net/disk_cache/blockfile/backend_worker_v3.cc

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/disk_cache/blockfile/backend_impl_v3.cc ('k') | net/disk_cache/disk_cache_test_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/backend_impl_v3.cc ('k') | net/disk_cache/disk_cache_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698