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

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

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 years, 10 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/blockfile/block_files.cc » ('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"
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
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/blockfile/block_files.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698