OLD | NEW |
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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/leak_tracker.h" | 8 #include "base/debug/leak_tracker.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } else { | 55 } else { |
56 LOG(ERROR) << "Invalid switch for host resolver parallelism: " << s; | 56 LOG(ERROR) << "Invalid switch for host resolver parallelism: " << s; |
57 } | 57 } |
58 } else { | 58 } else { |
59 // Set up a field trial to see what impact the total number of concurrent | 59 // Set up a field trial to see what impact the total number of concurrent |
60 // resolutions have on DNS resolutions. | 60 // resolutions have on DNS resolutions. |
61 base::FieldTrial::Probability kDivisor = 1000; | 61 base::FieldTrial::Probability kDivisor = 1000; |
62 // For each option (i.e., non-default), we have a fixed probability. | 62 // For each option (i.e., non-default), we have a fixed probability. |
63 base::FieldTrial::Probability kProbabilityPerGroup = 100; // 10%. | 63 base::FieldTrial::Probability kProbabilityPerGroup = 100; // 10%. |
64 | 64 |
65 scoped_refptr<base::FieldTrial> trial = | 65 scoped_refptr<base::FieldTrial> trial( |
66 new base::FieldTrial("DnsParallelism", kDivisor); | 66 new base::FieldTrial("DnsParallelism", kDivisor)); |
67 | 67 |
68 // List options with different counts. | 68 // List options with different counts. |
69 // Firefox limits total to 8 in parallel, and default is currently 50. | 69 // Firefox limits total to 8 in parallel, and default is currently 50. |
70 int parallel_6 = trial->AppendGroup("parallel_6", kProbabilityPerGroup); | 70 int parallel_6 = trial->AppendGroup("parallel_6", kProbabilityPerGroup); |
71 int parallel_7 = trial->AppendGroup("parallel_7", kProbabilityPerGroup); | 71 int parallel_7 = trial->AppendGroup("parallel_7", kProbabilityPerGroup); |
72 int parallel_8 = trial->AppendGroup("parallel_8", kProbabilityPerGroup); | 72 int parallel_8 = trial->AppendGroup("parallel_8", kProbabilityPerGroup); |
73 int parallel_9 = trial->AppendGroup("parallel_9", kProbabilityPerGroup); | 73 int parallel_9 = trial->AppendGroup("parallel_9", kProbabilityPerGroup); |
74 int parallel_10 = trial->AppendGroup("parallel_10", kProbabilityPerGroup); | 74 int parallel_10 = trial->AppendGroup("parallel_10", kProbabilityPerGroup); |
75 int parallel_14 = trial->AppendGroup("parallel_14", kProbabilityPerGroup); | 75 int parallel_14 = trial->AppendGroup("parallel_14", kProbabilityPerGroup); |
76 int parallel_20 = trial->AppendGroup("parallel_20", kProbabilityPerGroup); | 76 int parallel_20 = trial->AppendGroup("parallel_20", kProbabilityPerGroup); |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 net::HostCache* host_cache = | 435 net::HostCache* host_cache = |
436 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); | 436 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); |
437 if (host_cache) | 437 if (host_cache) |
438 host_cache->clear(); | 438 host_cache->clear(); |
439 } | 439 } |
440 // Clear all of the passively logged data. | 440 // Clear all of the passively logged data. |
441 // TODO(eroman): this is a bit heavy handed, really all we need to do is | 441 // TODO(eroman): this is a bit heavy handed, really all we need to do is |
442 // clear the data pertaining to off the record context. | 442 // clear the data pertaining to off the record context. |
443 globals_->net_log->passive_collector()->Clear(); | 443 globals_->net_log->passive_collector()->Clear(); |
444 } | 444 } |
OLD | NEW |