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

Side by Side Diff: chrome/browser/io_thread.cc

Issue 6216004: Feature to disable field trials in old versions of Chromium. Field trials... (Closed) Base URL: svn://chrome-svn/chrome/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
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 "chrome/browser/io_thread.h" 5 #include "chrome/browser/io_thread.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/leak_tracker.h" 10 #include "base/debug/leak_tracker.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } else { 64 } else {
65 LOG(ERROR) << "Invalid switch for host resolver parallelism: " << s; 65 LOG(ERROR) << "Invalid switch for host resolver parallelism: " << s;
66 } 66 }
67 } else { 67 } else {
68 // Set up a field trial to see what impact the total number of concurrent 68 // Set up a field trial to see what impact the total number of concurrent
69 // resolutions have on DNS resolutions. 69 // resolutions have on DNS resolutions.
70 base::FieldTrial::Probability kDivisor = 1000; 70 base::FieldTrial::Probability kDivisor = 1000;
71 // For each option (i.e., non-default), we have a fixed probability. 71 // For each option (i.e., non-default), we have a fixed probability.
72 base::FieldTrial::Probability kProbabilityPerGroup = 100; // 10%. 72 base::FieldTrial::Probability kProbabilityPerGroup = 100; // 10%.
73 73
74 // After June 30, 2011 builds, it will always be in defaut group
75 // (parallel_default).
74 scoped_refptr<base::FieldTrial> trial( 76 scoped_refptr<base::FieldTrial> trial(
75 new base::FieldTrial("DnsParallelism", kDivisor)); 77 new base::FieldTrial("DnsParallelism", kDivisor, "parallel_default",
78 2011, 6, 30));
76 79
77 // List options with different counts. 80 // List options with different counts.
78 // Firefox limits total to 8 in parallel, and default is currently 50. 81 // Firefox limits total to 8 in parallel, and default is currently 50.
79 int parallel_6 = trial->AppendGroup("parallel_6", kProbabilityPerGroup); 82 int parallel_6 = trial->AppendGroup("parallel_6", kProbabilityPerGroup);
80 int parallel_7 = trial->AppendGroup("parallel_7", kProbabilityPerGroup); 83 int parallel_7 = trial->AppendGroup("parallel_7", kProbabilityPerGroup);
81 int parallel_8 = trial->AppendGroup("parallel_8", kProbabilityPerGroup); 84 int parallel_8 = trial->AppendGroup("parallel_8", kProbabilityPerGroup);
82 int parallel_9 = trial->AppendGroup("parallel_9", kProbabilityPerGroup); 85 int parallel_9 = trial->AppendGroup("parallel_9", kProbabilityPerGroup);
83 int parallel_10 = trial->AppendGroup("parallel_10", kProbabilityPerGroup); 86 int parallel_10 = trial->AppendGroup("parallel_10", kProbabilityPerGroup);
84 int parallel_14 = trial->AppendGroup("parallel_14", kProbabilityPerGroup); 87 int parallel_14 = trial->AppendGroup("parallel_14", kProbabilityPerGroup);
85 int parallel_20 = trial->AppendGroup("parallel_20", kProbabilityPerGroup); 88 int parallel_20 = trial->AppendGroup("parallel_20", kProbabilityPerGroup);
86 89
87 trial->AppendGroup("parallel_default",
88 base::FieldTrial::kAllRemainingProbability);
89
90 if (trial->group() == parallel_6) 90 if (trial->group() == parallel_6)
91 parallelism = 6; 91 parallelism = 6;
92 else if (trial->group() == parallel_7) 92 else if (trial->group() == parallel_7)
93 parallelism = 7; 93 parallelism = 7;
94 else if (trial->group() == parallel_8) 94 else if (trial->group() == parallel_8)
95 parallelism = 8; 95 parallelism = 8;
96 else if (trial->group() == parallel_9) 96 else if (trial->group() == parallel_9)
97 parallelism = 9; 97 parallelism = 9;
98 else if (trial->group() == parallel_10) 98 else if (trial->group() == parallel_10)
99 parallelism = 10; 99 parallelism = 10;
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 net::HostCache* host_cache = 514 net::HostCache* host_cache =
515 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); 515 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache();
516 if (host_cache) 516 if (host_cache)
517 host_cache->clear(); 517 host_cache->clear();
518 } 518 }
519 // Clear all of the passively logged data. 519 // Clear all of the passively logged data.
520 // TODO(eroman): this is a bit heavy handed, really all we need to do is 520 // TODO(eroman): this is a bit heavy handed, really all we need to do is
521 // clear the data pertaining to off the record context. 521 // clear the data pertaining to off the record context.
522 net_log_->ClearAllPassivelyCapturedEvents(); 522 net_log_->ClearAllPassivelyCapturedEvents();
523 } 523 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698