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

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

Issue 667923003: Standardize usage of virtual/override/final in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
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/file.h" 5 #include "net/disk_cache/blockfile/file.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/run_loop.h" 11 #include "base/run_loop.h"
12 #include "base/task_runner_util.h" 12 #include "base/task_runner_util.h"
13 #include "base/threading/sequenced_worker_pool.h" 13 #include "base/threading/sequenced_worker_pool.h"
14 #include "net/base/net_errors.h" 14 #include "net/base/net_errors.h"
15 #include "net/disk_cache/disk_cache.h" 15 #include "net/disk_cache/disk_cache.h"
16 16
17 namespace { 17 namespace {
18 18
19 // The maximum number of threads for this pool. 19 // The maximum number of threads for this pool.
20 const int kMaxThreads = 5; 20 const int kMaxThreads = 5;
21 21
22 class FileWorkerPool : public base::SequencedWorkerPool { 22 class FileWorkerPool : public base::SequencedWorkerPool {
23 public: 23 public:
24 FileWorkerPool() : base::SequencedWorkerPool(kMaxThreads, "CachePool") {} 24 FileWorkerPool() : base::SequencedWorkerPool(kMaxThreads, "CachePool") {}
25 25
26 protected: 26 protected:
27 virtual ~FileWorkerPool() {} 27 ~FileWorkerPool() override {}
28 }; 28 };
29 29
30 base::LazyInstance<FileWorkerPool>::Leaky s_worker_pool = 30 base::LazyInstance<FileWorkerPool>::Leaky s_worker_pool =
31 LAZY_INSTANCE_INITIALIZER; 31 LAZY_INSTANCE_INITIALIZER;
32 32
33 } // namespace 33 } // namespace
34 34
35 namespace disk_cache { 35 namespace disk_cache {
36 36
37 File::File(base::File file) 37 File::File(base::File file)
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 return net::ERR_CACHE_WRITE_FAILURE; 178 return net::ERR_CACHE_WRITE_FAILURE;
179 } 179 }
180 180
181 // This method actually makes sure that the last reference to the file doesn't 181 // This method actually makes sure that the last reference to the file doesn't
182 // go away on the worker pool. 182 // go away on the worker pool.
183 void File::OnOperationComplete(FileIOCallback* callback, int result) { 183 void File::OnOperationComplete(FileIOCallback* callback, int result) {
184 callback->OnFileIOComplete(result); 184 callback->OnFileIOComplete(result);
185 } 185 }
186 186
187 } // namespace disk_cache 187 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/entry_impl_v3.h ('k') | net/disk_cache/blockfile/in_flight_backend_io.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698