diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-04 01:23:00 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-04 01:23:00 +0000 |
commit | 660e428f4baafdd433f978f7e4074677611f0de9 (patch) | |
tree | 6c73e5446b8b9699b3fa69fd44bf75f098b6f8f5 /chrome/browser/safe_browsing | |
parent | f13997f0122a7584f3205a8c5a117007f557e951 (diff) | |
download | chromium_src-660e428f4baafdd433f978f7e4074677611f0de9.zip chromium_src-660e428f4baafdd433f978f7e4074677611f0de9.tar.gz chromium_src-660e428f4baafdd433f978f7e4074677611f0de9.tar.bz2 |
Remove usage of GetSwitchValue for most of chrome/browser/.
Review URL: http://codereview.chromium.org/3005053
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54856 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing')
-rw-r--r-- | chrome/browser/safe_browsing/filter_false_positive_perftest.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/chrome/browser/safe_browsing/filter_false_positive_perftest.cc b/chrome/browser/safe_browsing/filter_false_positive_perftest.cc index 6ce33330..3b16e2f 100644 --- a/chrome/browser/safe_browsing/filter_false_positive_perftest.cc +++ b/chrome/browser/safe_browsing/filter_false_positive_perftest.cc @@ -313,18 +313,18 @@ TEST(SafeBrowsingBloomFilter, FalsePositives) { FilePath data_dir = GetFullDataPath(); ASSERT_TRUE(ReadDatabase(data_dir, &prefix_list)); + const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); + int start = BloomFilter::kBloomFilterSizeRatio; - if (CommandLine::ForCurrentProcess()->HasSwitch(kFilterStart)) { - base::StringToInt( - CommandLine::ForCurrentProcess()->GetSwitchValue(kFilterStart), - &start); + if (cmd_line.HasSwitch(kFilterStart)) { + ASSERT_TRUE(base::StringToInt(cmd_line.GetSwitchValueASCII(kFilterStart), + &start)); } int steps = 1; - if (CommandLine::ForCurrentProcess()->HasSwitch(kFilterSteps)) { - base::StringToInt( - CommandLine::ForCurrentProcess()->GetSwitchValue(kFilterSteps), - &steps); + if (cmd_line.HasSwitch(kFilterSteps)) { + ASSERT_TRUE(base::StringToInt(cmd_line.GetSwitchValueASCII(kFilterSteps), + &steps)); } int stop = start + steps; @@ -341,11 +341,12 @@ TEST(SafeBrowsingBloomFilter, HashTime) { FilePath data_dir = GetFullDataPath(); ASSERT_TRUE(ReadDatabase(data_dir, &prefix_list)); + const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); + int num_checks = kNumHashChecks; - if (CommandLine::ForCurrentProcess()->HasSwitch(kFilterNumChecks)) { - base::StringToInt( - CommandLine::ForCurrentProcess()->GetSwitchValue(kFilterNumChecks), - &num_checks); + if (cmd_line.HasSwitch(kFilterNumChecks)) { + ASSERT_TRUE(base::StringToInt(cmd_line.GetSwitchValue(kFilterNumChecks), + &num_checks)); } // Populate the bloom filter and measure the time. |