diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-31 17:29:25 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-31 17:29:25 +0000 |
commit | e83326f8400791e92875546b2fd1885a3a17d1b1 (patch) | |
tree | edbe773208b1a9f6965b45b55da10afd210ea7bb /chrome/browser/importer | |
parent | 8e0a03bf3b1aacaa7a2bc2561d8eb1b83eb9c2e5 (diff) | |
download | chromium_src-e83326f8400791e92875546b2fd1885a3a17d1b1.zip chromium_src-e83326f8400791e92875546b2fd1885a3a17d1b1.tar.gz chromium_src-e83326f8400791e92875546b2fd1885a3a17d1b1.tar.bz2 |
Convert more callers of the integer/string functions to using
string_number_conversions.h
TEST=it compiles
BUG=none
Review URL: http://codereview.chromium.org/3013046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54454 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/importer')
-rw-r--r-- | chrome/browser/importer/firefox2_importer.cc | 4 | ||||
-rw-r--r-- | chrome/browser/importer/firefox_importer_utils.cc | 3 | ||||
-rw-r--r-- | chrome/browser/importer/importer_bridge.cc | 3 | ||||
-rw-r--r-- | chrome/browser/importer/mork_reader.cc | 6 | ||||
-rw-r--r-- | chrome/browser/importer/toolbar_importer.cc | 7 |
5 files changed, 15 insertions, 8 deletions
diff --git a/chrome/browser/importer/firefox2_importer.cc b/chrome/browser/importer/firefox2_importer.cc index 638d39e..dee56ba 100644 --- a/chrome/browser/importer/firefox2_importer.cc +++ b/chrome/browser/importer/firefox2_importer.cc @@ -14,6 +14,7 @@ #include "base/path_service.h" #include "base/stl_util-inl.h" #include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/history/history_types.h" @@ -483,7 +484,8 @@ bool Firefox2Importer::ParseBookmarkFromLine(const std::string& line, // Add date if (GetAttribute(attribute_list, kAddDateAttribute, &value)) { - int64 time = StringToInt64(value); + int64 time; + base::StringToInt64(value, &time); // Upper bound it at 32 bits. if (0 < time && time < (1LL << 32)) *add_date = Time::FromTimeT(time); diff --git a/chrome/browser/importer/firefox_importer_utils.cc b/chrome/browser/importer/firefox_importer_utils.cc index b9a7a74..c53d4d4 100644 --- a/chrome/browser/importer/firefox_importer_utils.cc +++ b/chrome/browser/importer/firefox_importer_utils.cc @@ -11,6 +11,7 @@ #include "base/file_util.h" #include "base/logging.h" #include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/search_engines/template_url.h" @@ -438,7 +439,7 @@ bool ParsePrefFile(const FilePath& pref_file, DictionaryValue* prefs) { // Or value could be an integer. int int_value = 0; - if (StringToInt(value, &int_value)) { + if (base::StringToInt(value, &int_value)) { prefs->SetInteger(ASCIIToWide(key), int_value); continue; } diff --git a/chrome/browser/importer/importer_bridge.cc b/chrome/browser/importer/importer_bridge.cc index 72a73a6..3a16dd6 100644 --- a/chrome/browser/importer/importer_bridge.cc +++ b/chrome/browser/importer/importer_bridge.cc @@ -184,7 +184,8 @@ void ExternalProcessImporterBridge::NotifyEnded() { std::wstring ExternalProcessImporterBridge::GetLocalizedString( int message_id) { std::wstring message; - localized_strings_->GetString(IntToWString(message_id), &message); + localized_strings_->GetString(ASCIIToWide(base::IntToString(message_id)), + &message); return message; } diff --git a/chrome/browser/importer/mork_reader.cc b/chrome/browser/importer/mork_reader.cc index 49dadb0..9115c8d 100644 --- a/chrome/browser/importer/mork_reader.cc +++ b/chrome/browser/importer/mork_reader.cc @@ -48,6 +48,7 @@ #include "base/i18n/icu_string_conversions.h" #include "base/logging.h" #include "base/message_loop.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "chrome/browser/history/history_types.h" #include "chrome/browser/importer/firefox_importer_utils.h" @@ -530,9 +531,10 @@ void AddToHistory(MorkReader::ColumnDataList* column_values, count = 1; row.set_visit_count(count); - time_t date = StringToInt64(values[kLastVisitColumn]); + int64 date; + base::StringToInt64(values[kLastVisitColumn], &date); if (date != 0) - row.set_last_visit(Time::FromTimeT(date/1000000)); + row.set_last_visit(Time::FromTimeT(date / 1000000)); bool is_typed = (values[kTypedColumn] == "1"); if (is_typed) diff --git a/chrome/browser/importer/toolbar_importer.cc b/chrome/browser/importer/toolbar_importer.cc index 4c2cf56..a50d4c9 100644 --- a/chrome/browser/importer/toolbar_importer.cc +++ b/chrome/browser/importer/toolbar_importer.cc @@ -7,6 +7,7 @@ #include <limits> #include "base/rand_util.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/first_run/first_run.h" @@ -231,7 +232,7 @@ void Toolbar5Importer::GetAuthenticationFromServer() { // Random number construction. int random = base::RandInt(0, std::numeric_limits<int>::max()); - std::string random_string = UintToString(random); + std::string random_string = base::UintToString(random); // Retrieve authorization token from the network. std::string url_string(kT5AuthorizationTokenUrl); @@ -264,7 +265,7 @@ void Toolbar5Importer::GetBookmarkDataFromServer(const std::string& response) { // the xml blob. We must tag the connection string with a random number. std::string conn_string = kT5FrontEndUrlTemplate; int random = base::RandInt(0, std::numeric_limits<int>::max()); - std::string random_string = UintToString(random); + std::string random_string = base::UintToString(random); conn_string.replace(conn_string.find(kRandomNumberToken), arraysize(kRandomNumberToken) - 1, random_string); @@ -520,7 +521,7 @@ bool Toolbar5Importer::ExtractTimeFromXmlReader( return false; } int64 timestamp; - if (!StringToInt64(buffer, ×tamp)) { + if (!base::StringToInt64(buffer, ×tamp)) { return false; } entry->creation_time = base::Time::FromTimeT(timestamp); |