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" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
16 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
17 #include "net/disk_cache/blockfile/errors.h" | 17 #include "net/disk_cache/blockfile/errors.h" |
18 #include "net/disk_cache/blockfile/experiments.h" | 18 #include "net/disk_cache/blockfile/experiments.h" |
19 #include "net/disk_cache/blockfile/file.h" | 19 #include "net/disk_cache/blockfile/file.h" |
20 | 20 |
21 using base::Time; | 21 using base::Time; |
22 using base::TimeDelta; | 22 using base::TimeDelta; |
23 using base::TimeTicks; | 23 using base::TimeTicks; |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 #if defined(V3_NOT_JUST_YET_READY) | 27 #if defined(V3_NOT_JUST_YET_READY) |
28 | 28 |
29 const char* kIndexName = "index"; | 29 const char kIndexName[] = "index"; |
30 | 30 |
31 // Seems like ~240 MB correspond to less than 50k entries for 99% of the people. | 31 // Seems like ~240 MB correspond to less than 50k entries for 99% of the people. |
32 // Note that the actual target is to keep the index table load factor under 55% | 32 // Note that the actual target is to keep the index table load factor under 55% |
33 // for most users. | 33 // for most users. |
34 const int k64kEntriesStore = 240 * 1000 * 1000; | 34 const int k64kEntriesStore = 240 * 1000 * 1000; |
35 const int kBaseTableLen = 64 * 1024; | 35 const int kBaseTableLen = 64 * 1024; |
36 const int kDefaultCacheSize = 80 * 1024 * 1024; | 36 const int kDefaultCacheSize = 80 * 1024 * 1024; |
37 | 37 |
38 // Avoid trimming the cache for the first 5 minutes (10 timer ticks). | 38 // Avoid trimming the cache for the first 5 minutes (10 timer ticks). |
39 const int kTrimDelay = 10; | 39 const int kTrimDelay = 10; |
(...skipping 418 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 |