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

Side by Side Diff: net/disk_cache/backend_impl.cc

Issue 6213001: disable field trials if the build is 30 days or older (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/render_thread.cc ('k') | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/backend_impl.h" 5 #include "net/disk_cache/backend_impl.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // Field trials involve static objects so we have to do this only once. 175 // Field trials involve static objects so we have to do this only once.
176 first = false; 176 first = false;
177 scoped_refptr<base::FieldTrial> trial1( 177 scoped_refptr<base::FieldTrial> trial1(
178 new base::FieldTrial("CacheSize", 10)); 178 new base::FieldTrial("CacheSize", 10));
179 std::string group1 = base::StringPrintf("CacheSizeGroup_%d", size_group); 179 std::string group1 = base::StringPrintf("CacheSizeGroup_%d", size_group);
180 trial1->AppendGroup(group1, base::FieldTrial::kAllRemainingProbability); 180 trial1->AppendGroup(group1, base::FieldTrial::kAllRemainingProbability);
181 181
182 scoped_refptr<base::FieldTrial> trial2( 182 scoped_refptr<base::FieldTrial> trial2(
183 new base::FieldTrial("CacheThrottle", 100)); 183 new base::FieldTrial("CacheThrottle", 100));
184 int group2a = trial2->AppendGroup("CacheThrottle_On", 10); // 10 % in. 184 int group2a = trial2->AppendGroup("CacheThrottle_On", 10); // 10 % in.
185 trial2->AppendGroup("CacheThrottle_Off", 10); // 10 % control. 185 trial2->AppendGroup("CacheThrottle_Off",
186 base::FieldTrial::kAllRemainingProbability); // 90 % control.
186 187
187 return trial2->group() == group2a; 188 return trial2->group() == group2a;
188 } 189 }
189 190
190 // ------------------------------------------------------------------------ 191 // ------------------------------------------------------------------------
191 192
192 // This class takes care of building an instance of the backend. 193 // This class takes care of building an instance of the backend.
193 class CacheCreator { 194 class CacheCreator {
194 public: 195 public:
195 CacheCreator(const FilePath& path, bool force, int max_bytes, 196 CacheCreator(const FilePath& path, bool force, int max_bytes,
(...skipping 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after
2095 if (total_memory > kMaxBuffersSize || total_memory <= 0) 2096 if (total_memory > kMaxBuffersSize || total_memory <= 0)
2096 total_memory = kMaxBuffersSize; 2097 total_memory = kMaxBuffersSize;
2097 2098
2098 done = true; 2099 done = true;
2099 } 2100 }
2100 2101
2101 return static_cast<int>(total_memory); 2102 return static_cast<int>(total_memory);
2102 } 2103 }
2103 2104
2104 } // namespace disk_cache 2105 } // namespace disk_cache
OLDNEW
« no previous file with comments | « chrome/renderer/render_thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698