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

Unified Diff: chrome/browser/autofill/phone_number_i18n.cc

Issue 8355025: Fix an Autofill crash caused by accessing the g_browser_process on the DB thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix more tests? Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/autofill/phone_number.cc ('k') | chrome/browser/autofill/phone_number_i18n_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/phone_number_i18n.cc
diff --git a/chrome/browser/autofill/phone_number_i18n.cc b/chrome/browser/autofill/phone_number_i18n.cc
index a1c1636cd13a010dc9779fb3076b5f977c206e7f..8560c92e9fec13954eafbe62b72926795d35ee39 100644
--- a/chrome/browser/autofill/phone_number_i18n.cc
+++ b/chrome/browser/autofill/phone_number_i18n.cc
@@ -68,7 +68,7 @@ bool ParsePhoneNumberInternal(const string16& value,
// The |locale| should already be sanitized.
DCHECK_EQ(2U, locale.size());
if (phone_util->Parse(number_text, locale.c_str(), i18n_number) !=
- i18n::phonenumbers::PhoneNumberUtil::NO_PARSING_ERROR) {
+ i18n::phonenumbers::PhoneNumberUtil::NO_PARSING_ERROR) {
return false;
}
@@ -224,7 +224,7 @@ bool PhoneNumbersMatch(const string16& number_a,
// Parse phone numbers based on the locale
PhoneNumber i18n_number1;
if (phone_util->Parse(UTF16ToUTF8(number_a), locale.c_str(), &i18n_number1) !=
- i18n::phonenumbers::PhoneNumberUtil::NO_PARSING_ERROR) {
+ i18n::phonenumbers::PhoneNumberUtil::NO_PARSING_ERROR) {
return false;
}
@@ -253,6 +253,12 @@ bool PhoneNumbersMatch(const string16& number_a,
PhoneObject::PhoneObject(const string16& number, const std::string& locale)
: locale_(SanitizeLocaleCode(locale)),
i18n_number_(NULL) {
+ // TODO(isherman): Autofill profiles should always have a |locale| set, but in
+ // some cases it should be marked as implicit. Otherwise, phone numbers
+ // might behave differently when they are synced across computers:
+ // [ http://crbug.com/100845 ]. Once the bug is fixed, add a DCHECK here to
+ // verify.
+
scoped_ptr<PhoneNumber> i18n_number(new PhoneNumber);
if (ParsePhoneNumberInternal(number, locale_, &country_code_, &city_code_,
&number_, i18n_number.get())) {
« no previous file with comments | « chrome/browser/autofill/phone_number.cc ('k') | chrome/browser/autofill/phone_number_i18n_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698