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

Unified Diff: chrome/browser/autocomplete_history_manager.cc

Issue 8921006: Standardize StringToInt{,64} interface. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix call syntax of StringToInt() in Chrome OS code. Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/sys_info_chromeos.cc ('k') | chrome/browser/chromeos/login/default_user_images.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete_history_manager.cc
diff --git a/chrome/browser/autocomplete_history_manager.cc b/chrome/browser/autocomplete_history_manager.cc
index 4006b293f32e0e19ab91c81785ae618c5917c760..5265666f15896c2a457835a223479b7ca5f6c51e 100644
--- a/chrome/browser/autocomplete_history_manager.cc
+++ b/chrome/browser/autocomplete_history_manager.cc
@@ -19,6 +19,7 @@
#include "content/browser/tab_contents/tab_contents.h"
#include "webkit/forms/form_data.h"
+using base::StringPiece16;
using webkit::forms::FormData;
using webkit::forms::FormField;
@@ -63,26 +64,32 @@ bool IsSSN(const string16& text) {
return false;
int area;
- if (!base::StringToInt(number_string.begin(),
- number_string.begin() + 3,
- &area))
+ if (!base::StringToInt(StringPiece16(number_string.begin(),
+ number_string.begin() + 3),
+ &area)) {
return false;
+ }
if (area < 1 ||
area == 666 ||
- area >= 900)
+ area >= 900) {
return false;
+ }
int group;
- if (!base::StringToInt(number_string.begin() + 3,
- number_string.begin() + 5,
- &group) || group == 0)
+ if (!base::StringToInt(StringPiece16(number_string.begin() + 3,
+ number_string.begin() + 5),
+ &group)
+ || group == 0) {
return false;
+ }
int serial;
- if (!base::StringToInt(number_string.begin() + 5,
- number_string.begin() + 9,
- &serial) || serial == 0)
+ if (!base::StringToInt(StringPiece16(number_string.begin() + 5,
+ number_string.begin() + 9),
+ &serial)
+ || serial == 0) {
return false;
+ }
return true;
}
« no previous file with comments | « base/sys_info_chromeos.cc ('k') | chrome/browser/chromeos/login/default_user_images.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698