summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing
diff options
context:
space:
mode:
authorerikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 16:05:47 +0000
committererikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 16:05:47 +0000
commitc2750c67ca3a672018bac2dfb07628d079aafc8d (patch)
tree8bbff1c4c3aeb363e06734e91e172653e34737cc /chrome/browser/safe_browsing
parent213b99ad9d66e3c039bbb90c19d78603975c1be9 (diff)
downloadchromium_src-c2750c67ca3a672018bac2dfb07628d079aafc8d.zip
chromium_src-c2750c67ca3a672018bac2dfb07628d079aafc8d.tar.gz
chromium_src-c2750c67ca3a672018bac2dfb07628d079aafc8d.tar.bz2
Update code that previously constructed strings from string iterators only to use StringToInt. These usages now pass the iterators directly to the new StringToInt overloads.
BUG=None TEST=All Review URL: http://codereview.chromium.org/3968001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63515 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing')
-rw-r--r--chrome/browser/safe_browsing/filter_false_positive_perftest.cc2
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page.cc5
2 files changed, 4 insertions, 3 deletions
diff --git a/chrome/browser/safe_browsing/filter_false_positive_perftest.cc b/chrome/browser/safe_browsing/filter_false_positive_perftest.cc
index f763b51c..eec1c2e 100644
--- a/chrome/browser/safe_browsing/filter_false_positive_perftest.cc
+++ b/chrome/browser/safe_browsing/filter_false_positive_perftest.cc
@@ -261,7 +261,7 @@ void CalculateBloomFilterFalsePositives(
if (use_weights) {
std::string::size_type pos = url.find_last_of(",");
if (pos != std::string::npos) {
- base::StringToInt(std::string(url, pos + 1), &weight);
+ base::StringToInt(url.begin() + pos + 1, url.end(), &weight);
url = url.substr(0, pos);
}
}
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
index ace8abb..fc36bf5 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
@@ -331,9 +331,10 @@ void SafeBrowsingBlockingPage::CommandReceived(const std::string& cmd) {
size_t colon_index = command.find(':');
if (colon_index != std::string::npos) {
DCHECK(colon_index < command.size() - 1);
- std::string index_str = command.substr(colon_index + 1);
command = command.substr(0, colon_index);
- bool result = base::StringToInt(index_str, &element_index);
+ bool result = base::StringToInt(command.begin() + colon_index + 1,
+ command.end(),
+ &element_index);
DCHECK(result);
}