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

Side by Side Diff: net/disk_cache/simple/simple_experiment.cc

Issue 2918893002: evict larger entries first (Closed)
Patch Set: faster, cleaner, stronger, better Created 3 years, 6 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/simple/simple_experiment.h" 5 #include "net/disk_cache/simple/simple_experiment.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
11 #include "base/metrics/field_trial_param_associator.h" 11 #include "base/metrics/field_trial_param_associator.h"
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 13
14 namespace disk_cache { 14 namespace disk_cache {
15 15
16 const base::Feature kSimpleSizeExperiment = {"SimpleSizeExperiment", 16 const base::Feature kSimpleSizeExperiment = {"SimpleSizeExperiment",
17 base::FEATURE_DISABLED_BY_DEFAULT}; 17 base::FEATURE_DISABLED_BY_DEFAULT};
18 const base::Feature kSimpleCacheEvictionWithSize = {
19 "SimpleCacheEvictionWithSize", base::FEATURE_DISABLED_BY_DEFAULT};
20
18 const char kSizeMultiplierParam[] = "SizeMultiplier"; 21 const char kSizeMultiplierParam[] = "SizeMultiplier";
19 22
20 namespace { 23 namespace {
21 24
22 // Returns true if the experiment is found and properly defined. 25 // Returns true if the experiment is found and properly defined.
23 bool CheckForSimpleSizeExperiment(disk_cache::SimpleExperiment* experiment) { 26 bool CheckForSimpleSizeExperiment(disk_cache::SimpleExperiment* experiment) {
24 DCHECK_EQ(disk_cache::SimpleExperimentType::NONE, experiment->type); 27 DCHECK_EQ(disk_cache::SimpleExperimentType::NONE, experiment->type);
25 DCHECK_EQ(0u, experiment->param); 28 DCHECK_EQ(0u, experiment->param);
26 29
27 if (!base::FeatureList::IsEnabled(kSimpleSizeExperiment)) 30 if (!base::FeatureList::IsEnabled(kSimpleSizeExperiment))
(...skipping 27 matching lines...) Expand all
55 SimpleExperiment experiment; 58 SimpleExperiment experiment;
56 59
57 if (cache_type != net::DISK_CACHE) 60 if (cache_type != net::DISK_CACHE)
58 return experiment; 61 return experiment;
59 62
60 CheckForSimpleSizeExperiment(&experiment); 63 CheckForSimpleSizeExperiment(&experiment);
61 return experiment; 64 return experiment;
62 } 65 }
63 66
64 } // namespace disk_cache 67 } // namespace disk_cache
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698