diff options
Diffstat (limited to 'chrome')
94 files changed, 388 insertions, 300 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index 7018b16..a3c1cbb 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -46,6 +46,7 @@ #include "base/scoped_nsautorelease_pool.h" #include "base/stats_counters.h" #include "base/stats_table.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/browser/diagnostics/diagnostics_main.h" @@ -583,8 +584,9 @@ int ChromeMain(int argc, char** argv) { std::wstring channel_name = parsed_command_line.GetSwitchValue(switches::kProcessChannelID); - browser_pid = - static_cast<base::ProcessId>(StringToInt(WideToASCII(channel_name))); + int browser_pid_int; + base::StringToInt(WideToUTF8(channel_name), &browser_pid_int); + browser_pid = static_cast<base::ProcessId>(browser_pid_int); DCHECK_NE(browser_pid, 0u); #elif defined(OS_MACOSX) browser_pid = base::GetCurrentProcId(); diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 4789204..7a219d7 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -9,6 +9,7 @@ #include "base/command_line.h" #include "base/mac_util.h" #include "base/message_loop.h" +#include "base/string_number_conversions.h" #include "base/sys_string_conversions.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/browser.h" @@ -532,7 +533,7 @@ void RecordLastRunAppBundlePath() { // Dialog text: warning and explanation. warningText = l10n_util::GetNSStringF( IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_WARNING, product_name, - IntToString16(downloadCount)); + base::IntToString16(downloadCount)); explanationText = l10n_util::GetNSStringF( IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_EXPLANATION, product_name); diff --git a/chrome/browser/autofill/auto_fill_editor_gtk.cc b/chrome/browser/autofill/auto_fill_editor_gtk.cc index c6fab96..f3d0e9f 100644 --- a/chrome/browser/autofill/auto_fill_editor_gtk.cc +++ b/chrome/browser/autofill/auto_fill_editor_gtk.cc @@ -13,6 +13,7 @@ #include "base/string_util.h" #include "base/task.h" #include "base/time.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/autofill/personal_data_manager.h" #include "chrome/browser/autofill/phone_number.h" @@ -887,14 +888,14 @@ void AutoFillCreditCardEditor::SetCreditCardValuesFromWidgets( if (selected_month_index == -1) selected_month_index = 0; card->SetInfo(AutoFillType(CREDIT_CARD_EXP_MONTH), - IntToString16(selected_month_index + 1)); + base::IntToString16(selected_month_index + 1)); int selected_year_index = gtk_combo_box_get_active(GTK_COMBO_BOX(year_)); if (selected_year_index == -1) selected_year_index = 0; card->SetInfo(AutoFillType(CREDIT_CARD_EXP_4_DIGIT_YEAR), - IntToString16(selected_year_index + base_year_)); + base::IntToString16(selected_year_index + base_year_)); } void AutoFillCreditCardEditor::UpdateOkButton() { diff --git a/chrome/browser/autofill/credit_card.cc b/chrome/browser/autofill/credit_card.cc index 7f3e521..e6e06cb 100644 --- a/chrome/browser/autofill/credit_card.cc +++ b/chrome/browser/autofill/credit_card.cc @@ -9,6 +9,7 @@ #include "app/l10n_util.h" #include "base/basictypes.h" #include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/string16.h" #include "base/utf_string_conversions.h" #include "chrome/browser/autofill/autofill_type.h" @@ -62,7 +63,7 @@ std::string GetCreditCardType(string16 number) { return kGenericCard; int first_four_digits = 0; - if (!StringToInt(number.substr(0, 4), &first_four_digits)) + if (!base::StringToInt(number.substr(0, 4), &first_four_digits)) return kGenericCard; int first_three_digits = first_four_digits / 10; @@ -438,7 +439,7 @@ string16 CreditCard::ExpirationMonthAsString() const { if (expiration_month_ == 0) return string16(); - string16 month = IntToString16(expiration_month_); + string16 month = base::IntToString16(expiration_month_); if (expiration_month_ >= 10) return month; @@ -451,14 +452,14 @@ string16 CreditCard::Expiration4DigitYearAsString() const { if (expiration_year_ == 0) return string16(); - return IntToString16(Expiration4DigitYear()); + return base::IntToString16(Expiration4DigitYear()); } string16 CreditCard::Expiration2DigitYearAsString() const { if (expiration_year_ == 0) return string16(); - return IntToString16(Expiration2DigitYear()); + return base::IntToString16(Expiration2DigitYear()); } void CreditCard::SetExpirationMonthFromString(const string16& text) { @@ -563,7 +564,7 @@ bool CreditCard::IsNameOnCard(const string16& text) const { bool CreditCard::IsExpirationMonth(const string16& text) const { int month; - if (!StringToInt(text, &month)) + if (!base::StringToInt(text, &month)) return false; return expiration_month_ == month; @@ -571,7 +572,7 @@ bool CreditCard::IsExpirationMonth(const string16& text) const { bool CreditCard::Is2DigitExpirationYear(const string16& text) const { int year; - if (!StringToInt(text, &year)) + if (!base::StringToInt(text, &year)) return false; return year < 100 && (expiration_year_ % 100) == year; @@ -579,7 +580,7 @@ bool CreditCard::Is2DigitExpirationYear(const string16& text) const { bool CreditCard::Is4DigitExpirationYear(const string16& text) const { int year; - if (!StringToInt(text, &year)) + if (!base::StringToInt(text, &year)) return false; return expiration_year_ == year; @@ -587,7 +588,7 @@ bool CreditCard::Is4DigitExpirationYear(const string16& text) const { bool CreditCard::ConvertDate(const string16& date, int* num) const { if (!date.empty()) { - bool converted = StringToInt(date, num); + bool converted = base::StringToInt(date, num); DCHECK(converted); if (!converted) return false; diff --git a/chrome/browser/autofill/form_structure.cc b/chrome/browser/autofill/form_structure.cc index e207aef..92df538 100644 --- a/chrome/browser/autofill/form_structure.cc +++ b/chrome/browser/autofill/form_structure.cc @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/logging.h" #include "base/sha1.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/autofill/autofill_xml_parser.h" #include "chrome/browser/autofill/field_types.h" @@ -82,7 +82,8 @@ FormStructure::FormStructure(const FormData& form) } // Generate a unique name for this field by appending a counter to the name. - string16 unique_name = field->name() + IntToString16(fields_.size() + 1); + string16 unique_name = field->name() + + base::IntToString16(fields_.size() + 1); fields_.push_back(new AutoFillField(*field, unique_name)); } diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index f635916..9ee12d8 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -21,6 +21,7 @@ #include "base/string_util.h" #include "base/task.h" #include "base/thread.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "base/waitable_event.h" @@ -4334,7 +4335,7 @@ void AutomationProvider::GetExtensionProperty( } index++; } - *value = IntToString(found_index); + *value = base::IntToString(found_index); *success = true; } break; diff --git a/chrome/browser/back_forward_menu_model.cc b/chrome/browser/back_forward_menu_model.cc index 5a164e7..fb18da8 100644 --- a/chrome/browser/back_forward_menu_model.cc +++ b/chrome/browser/back_forward_menu_model.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,6 +8,7 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" +#include "base/string_number_conversions.h" #include "chrome/browser/browser.h" #include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/tab_contents/navigation_controller.h" @@ -368,7 +369,7 @@ std::string BackForwardMenuModel::BuildActionName( metric_string += action; if (index != -1) { // +1 is for historical reasons (indices used to start at 1). - metric_string += IntToString(index + 1); + metric_string += base::IntToString(index + 1); } return metric_string; } diff --git a/chrome/browser/bookmarks/bookmark_codec.cc b/chrome/browser/bookmarks/bookmark_codec.cc index e64c365..a56636a 100644 --- a/chrome/browser/bookmarks/bookmark_codec.cc +++ b/chrome/browser/bookmarks/bookmark_codec.cc @@ -7,6 +7,7 @@ #include <algorithm> #include "app/l10n_util.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/values.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -84,12 +85,12 @@ bool BookmarkCodec::Decode(BookmarkNode* bb_node, Value* BookmarkCodec::EncodeNode(const BookmarkNode* node) { DictionaryValue* value = new DictionaryValue(); - std::string id = Int64ToString(node->id()); + std::string id = base::Int64ToString(node->id()); value->SetString(kIdKey, id); const string16& title = node->GetTitleAsString16(); value->SetStringFromUTF16(kNameKey, title); value->SetString(kDateAddedKey, - Int64ToString(node->date_added().ToInternalValue())); + base::Int64ToString(node->date_added().ToInternalValue())); if (node->type() == BookmarkNode::URL) { value->SetString(kTypeKey, kTypeURL); std::string url = node->GetURL().possibly_invalid_spec(); @@ -98,7 +99,7 @@ Value* BookmarkCodec::EncodeNode(const BookmarkNode* node) { } else { value->SetString(kTypeKey, kTypeFolder); value->SetString(kDateModifiedKey, - Int64ToString(node->date_group_modified(). + base::Int64ToString(node->date_group_modified(). ToInternalValue())); UpdateChecksumWithFolderNode(id, title); @@ -207,7 +208,7 @@ bool BookmarkCodec::DecodeNode(const DictionaryValue& value, std::string date_added_string; if (!value.GetString(kDateAddedKey, &date_added_string)) - date_added_string = Int64ToString(Time::Now().ToInternalValue()); + date_added_string = base::Int64ToString(Time::Now().ToInternalValue()); base::Time date_added = base::Time::FromInternalValue( StringToInt64(date_added_string)); #if !defined(OS_WIN) @@ -249,7 +250,7 @@ bool BookmarkCodec::DecodeNode(const DictionaryValue& value, } else { std::string last_modified_date; if (!value.GetString(kDateModifiedKey, &last_modified_date)) - last_modified_date = Int64ToString(Time::Now().ToInternalValue()); + last_modified_date = base::Int64ToString(Time::Now().ToInternalValue()); Value* child_values; if (!value.Get(kChildrenKey, &child_values)) diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/bookmarks/bookmark_html_writer.cc index d3df9b4..24646f7 100644 --- a/chrome/browser/bookmarks/bookmark_html_writer.cc +++ b/chrome/browser/bookmarks/bookmark_html_writer.cc @@ -11,7 +11,7 @@ #include "base/message_loop.h" #include "base/platform_file.h" #include "base/scoped_ptr.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/time.h" #include "chrome/browser/bookmarks/bookmark_codec.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -218,9 +218,10 @@ class Writer : public Task { // Converts a time string written to the JSON codec into a time_t string // (used by bookmarks.html) and writes it. bool WriteTime(const std::string& time_string) { - base::Time time = base::Time::FromInternalValue( - StringToInt64(time_string)); - return Write(Int64ToString(time.ToTimeT())); + int64 internal_value; + base::StringToInt64(time_string, &internal_value); + return Write(base::Int64ToString( + base::Time::FromInternalValue(internal_value).ToTimeT())); } // Writes the node and all its children, returning true on success. diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc index 8003ea5..753c38c 100644 --- a/chrome/browser/bookmarks/bookmark_utils.cc +++ b/chrome/browser/bookmarks/bookmark_utils.cc @@ -9,7 +9,7 @@ #include "app/tree_node_iterator.h" #include "base/basictypes.h" #include "base/file_path.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/string16.h" #include "base/time.h" #include "chrome/browser/bookmarks/bookmark_drag_data.h" @@ -165,7 +165,7 @@ bool ShouldOpenAll(gfx::NativeWindow parent, string16 message = l10n_util::GetStringFUTF16( IDS_BOOKMARK_BAR_SHOULD_OPEN_ALL, - IntToString16(descendant_count)); + base::IntToString16(descendant_count)); string16 title = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); return platform_util::SimpleYesNoBox(parent, title, message); } diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index bc7024b..2a0eae5 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -18,6 +18,7 @@ #include "base/path_service.h" #include "base/platform_thread.h" #include "base/stats_table.h" +#include "base/string_number_conversions.h" #include "base/string_piece.h" #include "base/string_util.h" #include "base/thread.h" @@ -996,11 +997,14 @@ void AboutMemoryHandler::OnDetailsAvailable() { log_string.append(L", "); log_string.append(browser_processes[index].name); log_string.append(L", "); - log_string.append(Int64ToWString(aggregate.working_set.priv)); + log_string.append(UTF8ToWide( + base::Int64ToString(aggregate.working_set.priv))); log_string.append(L", "); - log_string.append(Int64ToWString(aggregate.working_set.shared)); + log_string.append(UTF8ToWide( + base::Int64ToString(aggregate.working_set.shared))); log_string.append(L", "); - log_string.append(Int64ToWString(aggregate.working_set.shareable)); + log_string.append(UTF8ToWide( + base::Int64ToString(aggregate.working_set.shareable))); } if (log_string.length() > 0) LOG(INFO) << "memory: " << log_string; diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc index 99f3c69..3e961c3 100644 --- a/chrome/browser/browser_shutdown.cc +++ b/chrome/browser/browser_shutdown.cc @@ -13,6 +13,7 @@ #include "base/histogram.h" #include "base/path_service.h" #include "base/process_util.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/thread.h" #include "base/time.h" @@ -208,7 +209,8 @@ void Shutdown() { // and then write it to a file to be read at startup. // We can't use prefs since all services are shutdown at this point. TimeDelta shutdown_delta = Time::Now() - shutdown_started_; - std::string shutdown_ms = Int64ToString(shutdown_delta.InMilliseconds()); + std::string shutdown_ms = + base::Int64ToString(shutdown_delta.InMilliseconds()); int len = static_cast<int>(shutdown_ms.length()) + 1; FilePath shutdown_ms_file = GetShutdownMsPath(); file_util::WriteFile(shutdown_ms_file, shutdown_ms.c_str(), len); diff --git a/chrome/browser/chromeos/cros/network_library.cc b/chrome/browser/chromeos/cros/network_library.cc index b688231..ba16587 100644 --- a/chrome/browser/chromeos/cros/network_library.cc +++ b/chrome/browser/chromeos/cros/network_library.cc @@ -6,6 +6,7 @@ #include <algorithm> +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/browser/chrome_thread.h" @@ -530,12 +531,14 @@ std::string NetworkLibraryImpl::GetHtmlInfo(int refresh) { output.append("<html><head><title>About Network</title>"); if (refresh > 0) output.append("<meta http-equiv=\"refresh\" content=\"" + - IntToString(refresh) + "\"/>"); + base::IntToString(refresh) + "\"/>"); output.append("</head><body>"); - if (refresh > 0) - output.append("(Auto-refreshing page every " + IntToString(refresh) + "s)"); - else + if (refresh > 0) { + output.append("(Auto-refreshing page every " + + base::IntToString(refresh) + "s)"); + } else { output.append("(To auto-refresh this page: about:network/<secs>)"); + } output.append("<h3>Ethernet:</h3><table border=1>"); output.append("<tr>" + ToHtmlTableHeader(ðernet_) + "</tr>"); diff --git a/chrome/browser/chromeos/status/power_menu_button.cc b/chrome/browser/chromeos/status/power_menu_button.cc index de10159..d5d91e5 100644 --- a/chrome/browser/chromeos/status/power_menu_button.cc +++ b/chrome/browser/chromeos/status/power_menu_button.cc @@ -6,6 +6,7 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" +#include "base/string_number_conversions.h" #include "base/time.h" #include "chrome/browser/chromeos/cros/cros_library.h" #include "gfx/canvas.h" @@ -51,7 +52,7 @@ string16 PowerMenuButton::GetLabelAt(int index) const { double percent = cros->battery_fully_charged() ? 100 : cros->battery_percentage(); return l10n_util::GetStringFUTF16(IDS_STATUSBAR_BATTERY_PERCENTAGE, - IntToString16(static_cast<int>(percent))); + base::IntToString16(static_cast<int>(percent))); } // The second item shows the battery is charged if it is. @@ -77,8 +78,8 @@ string16 PowerMenuButton::GetLabelAt(int index) const { IDS_STATUSBAR_BATTERY_TIME_UNTIL_EMPTY; int hour = time.InHours(); int min = (time - base::TimeDelta::FromHours(hour)).InMinutes(); - string16 hour_str = IntToString16(hour); - string16 min_str = IntToString16(min); + string16 hour_str = base::IntToString16(hour); + string16 min_str = base::IntToString16(min); // Append a "0" before the minute if it's only a single digit. if (min < 10) min_str = ASCIIToUTF16("0") + min_str; diff --git a/chrome/browser/chromeos/update_observer.cc b/chrome/browser/chromeos/update_observer.cc index b73fd0a..1765a8a 100644 --- a/chrome/browser/chromeos/update_observer.cc +++ b/chrome/browser/chromeos/update_observer.cc @@ -5,7 +5,7 @@ #include "chrome/browser/chromeos/update_observer.h" #include "app/l10n_util.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/common/time_format.h" #include "grit/generated_resources.h" @@ -41,7 +41,7 @@ void UpdateObserver::UpdateStatusChanged(UpdateLibrary* library) { if (progress != progress_) { progress_ = progress; notification_.Show(l10n_util::GetStringFUTF16(IDS_UPDATE_DOWNLOADING, - IntToString16(progress_)), false); + base::IntToString16(progress_)), false); } } break; diff --git a/chrome/browser/cocoa/about_window_controller.mm b/chrome/browser/cocoa/about_window_controller.mm index 0b24762..1dcb37a 100644 --- a/chrome/browser/cocoa/about_window_controller.mm +++ b/chrome/browser/cocoa/about_window_controller.mm @@ -8,6 +8,7 @@ #include "app/resource_bundle.h" #include "base/logging.h" #include "base/mac_util.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/browser_list.h" @@ -452,7 +453,7 @@ static BOOL recentShownUserActionFailedStatus = NO; // just to get the throbber to stop spinning if it's running. imageID = IDR_UPDATE_FAIL; message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, - IntToString16(status)); + base::IntToString16(status)); break; @@ -550,14 +551,14 @@ static BOOL recentShownUserActionFailedStatus = NO; // just to get the throbber to stop spinning if it's running. imageID = IDR_UPDATE_FAIL; message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, - IntToString16(status)); + base::IntToString16(status)); break; case kAutoupdateRegisterFailed: imageID = IDR_UPDATE_FAIL; message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, - IntToString16(status)); + base::IntToString16(status)); enablePromoteButton = false; break; @@ -565,7 +566,7 @@ static BOOL recentShownUserActionFailedStatus = NO; case kAutoupdateCheckFailed: imageID = IDR_UPDATE_FAIL; message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, - IntToString16(status)); + base::IntToString16(status)); break; @@ -574,7 +575,7 @@ static BOOL recentShownUserActionFailedStatus = NO; imageID = IDR_UPDATE_FAIL; message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, - IntToString16(status)); + base::IntToString16(status)); // Allow another chance. enableUpdateButton = true; @@ -586,7 +587,7 @@ static BOOL recentShownUserActionFailedStatus = NO; imageID = IDR_UPDATE_FAIL; message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, - IntToString16(status)); + base::IntToString16(status)); break; diff --git a/chrome/browser/cocoa/history_menu_bridge.mm b/chrome/browser/cocoa/history_menu_bridge.mm index 7795bf7..d75043e 100644 --- a/chrome/browser/cocoa/history_menu_bridge.mm +++ b/chrome/browser/cocoa/history_menu_bridge.mm @@ -8,6 +8,7 @@ #include "app/resource_bundle.h" #include "base/callback.h" #include "base/stl_util-inl.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/sys_string_conversions.h" #include "chrome/app/chrome_dll_resource.h" // IDC_HISTORY_MENU @@ -207,7 +208,7 @@ void HistoryMenuBridge::TabRestoreServiceChanged(TabRestoreService* service) { } else { item->title =l10n_util::GetStringFUTF16( IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_MULTIPLE, - IntToString16(item->tabs.size())); + base::IntToString16(item->tabs.size())); } // Sometimes it is possible for there to not be any subitems for a given diff --git a/chrome/browser/cocoa/page_info_window_mac_unittest.mm b/chrome/browser/cocoa/page_info_window_mac_unittest.mm index ab9fdbe..2bbaf24 100644 --- a/chrome/browser/cocoa/page_info_window_mac_unittest.mm +++ b/chrome/browser/cocoa/page_info_window_mac_unittest.mm @@ -5,6 +5,7 @@ #include "app/l10n_util.h" #include "base/scoped_nsobject.h" #include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/sys_string_conversions.h" #import "chrome/browser/cocoa/page_info_window_mac.h" #import "chrome/browser/cocoa/page_info_window_controller.h" @@ -170,7 +171,7 @@ TEST_F(PageInfoWindowMacTest, NoHistoryMixedSecurity) { l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_CONNECTION_TEXT, ASCIIToUTF16("chrome.google.com"), - IntToString16(1024)), + base::IntToString16(1024)), l10n_util::GetStringUTF16( IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_WARNING))); diff --git a/chrome/browser/config_dir_policy_provider_unittest.cc b/chrome/browser/config_dir_policy_provider_unittest.cc index c992ff3..14dad65 100644 --- a/chrome/browser/config_dir_policy_provider_unittest.cc +++ b/chrome/browser/config_dir_policy_provider_unittest.cc @@ -4,7 +4,7 @@ #include "base/file_util.h" #include "base/path_service.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/config_dir_policy_provider.h" #include "chrome/browser/mock_configuration_policy_store.h" #include "chrome/common/json_value_serializer.h" @@ -93,12 +93,12 @@ TEST_F(ConfigDirPolicyProviderTest, ReadPrefsMergePrefs) { DictionaryValue test_dict_bar; test_dict_bar.SetString(L"HomepageLocation", L"http://bar.com"); for (unsigned int i = 1; i <= 4; ++i) - WriteConfigFile(test_dict_bar, IntToString(i)); + WriteConfigFile(test_dict_bar, base::IntToString(i)); DictionaryValue test_dict_foo; test_dict_foo.SetString(L"HomepageLocation", L"http://foo.com"); WriteConfigFile(test_dict_foo, "9"); for (unsigned int i = 5; i <= 8; ++i) - WriteConfigFile(test_dict_bar, IntToString(i)); + WriteConfigFile(test_dict_bar, base::IntToString(i)); ConfigDirPolicyProvider provider(test_dir_); EXPECT_TRUE(provider.Provide(policy_store_.get())); diff --git a/chrome/browser/debugger/debugger_remote_service.cc b/chrome/browser/debugger/debugger_remote_service.cc index 91fca90..74ac1e0 100644 --- a/chrome/browser/debugger/debugger_remote_service.cc +++ b/chrome/browser/debugger/debugger_remote_service.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,7 +9,7 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/values.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/debugger/devtools_manager.h" @@ -166,12 +166,12 @@ void DebuggerRemoteService::DebuggerOutput(int32 tab_uid, std::string content = StringPrintf( "{\"command\":\"%s\",\"result\":%s,\"data\":%s}", DebuggerRemoteServiceCommand::kDebuggerCommand.c_str(), - IntToString(RESULT_OK).c_str(), + base::IntToString(RESULT_OK).c_str(), message.c_str()); scoped_ptr<DevToolsRemoteMessage> response_message( DevToolsRemoteMessageBuilder::instance().Create( kToolName, - IntToString(tab_uid), + base::IntToString(tab_uid), content)); delegate_->Send(*(response_message.get())); } @@ -186,7 +186,7 @@ void DebuggerRemoteService::FrameNavigate(int32 tab_uid, value.SetString(kCommandWide, DebuggerRemoteServiceCommand::kFrameNavigate); value.SetInteger(kResultWide, RESULT_OK); value.SetString(kDataWide, url); - SendResponse(value, kToolName, IntToString(tab_uid)); + SendResponse(value, kToolName, base::IntToString(tab_uid)); } // Gets invoked from a DevToolsClientHost callback whenever @@ -196,7 +196,7 @@ void DebuggerRemoteService::TabClosed(int32 tab_id) { DictionaryValue value; value.SetString(kCommandWide, DebuggerRemoteServiceCommand::kTabClosed); value.SetInteger(kResultWide, RESULT_OK); - SendResponse(value, kToolName, IntToString(tab_id)); + SendResponse(value, kToolName, base::IntToString(tab_id)); } // Attaches a remote debugger to the target tab specified by |destination| diff --git a/chrome/browser/debugger/devtools_remote_listen_socket.cc b/chrome/browser/debugger/devtools_remote_listen_socket.cc index 87b88d0..bce2ba4 100644 --- a/chrome/browser/debugger/devtools_remote_listen_socket.cc +++ b/chrome/browser/debugger/devtools_remote_listen_socket.cc @@ -20,9 +20,10 @@ #include "net/base/net_errors.h" #endif +#include "base/compiler_specific.h" #include "base/eintr_wrapper.h" #include "base/platform_thread.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/debugger/devtools_remote.h" #include "chrome/browser/debugger/devtools_remote_message.h" @@ -60,7 +61,7 @@ void DevToolsRemoteListenSocket::StartNextField() { if (protocol_field_.size() == 0) { // empty line - end of headers const std::string& payload_length_string = GetHeader( DevToolsRemoteMessageHeaders::kContentLength, "0"); - remaining_payload_length_ = StringToInt(payload_length_string); + base::StringToInt(payload_length_string, &remaining_payload_length_); state_ = PAYLOAD; if (remaining_payload_length_ == 0) { // no payload DispatchField(); diff --git a/chrome/browser/debugger/devtools_remote_message.cc b/chrome/browser/debugger/devtools_remote_message.cc index 97c6875..eb63009 100644 --- a/chrome/browser/debugger/devtools_remote_message.cc +++ b/chrome/browser/debugger/devtools_remote_message.cc @@ -1,10 +1,11 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/string_util.h" #include "chrome/browser/debugger/devtools_remote_message.h" +#include "base/string_number_conversions.h" + const char DevToolsRemoteMessageHeaders::kContentLength[] = "Content-Length"; const char DevToolsRemoteMessageHeaders::kTool[] = "Tool"; const char DevToolsRemoteMessageHeaders::kDestination[] = "Destination"; @@ -47,7 +48,7 @@ DevToolsRemoteMessage* DevToolsRemoteMessageBuilder::Create( const std::string& content) { DevToolsRemoteMessage::HeaderMap headers; headers[DevToolsRemoteMessageHeaders::kContentLength] = - IntToString(content.size()); + base::IntToString(content.size()); headers[DevToolsRemoteMessageHeaders::kTool] = tool; headers[DevToolsRemoteMessageHeaders::kDestination] = destination; return new DevToolsRemoteMessage(headers, content); diff --git a/chrome/browser/debugger/devtools_remote_message_unittest.cc b/chrome/browser/debugger/devtools_remote_message_unittest.cc index bc84a4c..6917f2a 100644 --- a/chrome/browser/debugger/devtools_remote_message_unittest.cc +++ b/chrome/browser/debugger/devtools_remote_message_unittest.cc @@ -1,10 +1,10 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <string> -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/debugger/devtools_remote.h" #include "chrome/browser/debugger/devtools_remote_message.h" #include "testing/gtest/include/gtest/gtest.h" @@ -25,7 +25,7 @@ TEST_F(DevToolsRemoteMessageTest, ConstructInstanceManually) { std::string content = "{\"command\":\"ping\"}"; headers[DevToolsRemoteMessageHeaders::kTool] = "DevToolsService"; headers[DevToolsRemoteMessageHeaders::kContentLength] = - IntToString(content.size()); + base::IntToString(content.size()); DevToolsRemoteMessage message(headers, content); ASSERT_STREQ("DevToolsService", diff --git a/chrome/browser/debugger/extension_ports_remote_service.cc b/chrome/browser/debugger/extension_ports_remote_service.cc index d2a05ea..72510b6 100644 --- a/chrome/browser/debugger/extension_ports_remote_service.cc +++ b/chrome/browser/debugger/extension_ports_remote_service.cc @@ -12,7 +12,7 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/message_loop.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/values.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/debugger/devtools_manager.h" @@ -280,7 +280,7 @@ void ExtensionPortsRemoteService::OnExtensionMessage( return; } content.Set(kDataWide, data); - SendResponse(content, kToolName, IntToString(port_id)); + SendResponse(content, kToolName, base::IntToString(port_id)); } void ExtensionPortsRemoteService::OnExtensionPortDisconnected(int port_id) { @@ -289,7 +289,7 @@ void ExtensionPortsRemoteService::OnExtensionPortDisconnected(int port_id) { DictionaryValue content; content.SetString(kCommandWide, kOnDisconnect); content.SetInteger(kResultWide, RESULT_OK); - SendResponse(content, kToolName, IntToString(port_id)); + SendResponse(content, kToolName, base::IntToString(port_id)); } void ExtensionPortsRemoteService::ConnectCommand( diff --git a/chrome/browser/diagnostics/recon_diagnostics.cc b/chrome/browser/diagnostics/recon_diagnostics.cc index 1f0ab8a..eb76c2b 100644 --- a/chrome/browser/diagnostics/recon_diagnostics.cc +++ b/chrome/browser/diagnostics/recon_diagnostics.cc @@ -10,6 +10,7 @@ #include "base/file_version_info.h" #include "base/json/json_reader.h" #include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "base/sys_info.h" #include "base/path_service.h" @@ -295,7 +296,7 @@ class JSONTest : public DiagnosticTest { scoped_ptr<Value> json_root(json.Deserialize(&error_code, &error_message)); if (base::JSONReader::JSON_NO_ERROR != error_code) { if (error_message.empty()) { - error_message = "Parse error " + IntToString(error_code); + error_message = "Parse error " + base::IntToString(error_code); } RecordFailure(UTF8ToUTF16(error_message)); return true; diff --git a/chrome/browser/diagnostics/sqlite_diagnostics.cc b/chrome/browser/diagnostics/sqlite_diagnostics.cc index 1e21c22..5013fa9 100644 --- a/chrome/browser/diagnostics/sqlite_diagnostics.cc +++ b/chrome/browser/diagnostics/sqlite_diagnostics.cc @@ -12,7 +12,7 @@ #include "base/logging.h" #include "base/path_service.h" #include "base/singleton.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "third_party/sqlite/preprocessed/sqlite3.h" @@ -58,7 +58,7 @@ class SqliteIntegrityTest : public DiagnosticTest { RecordFailure(ASCIIToUTF16("DB locked by another process")); } else { string16 str(ASCIIToUTF16("Pragma failed. Error: ")); - str += IntToString16(error); + str += base::IntToString16(error); RecordFailure(str); } return false; @@ -72,7 +72,7 @@ class SqliteIntegrityTest : public DiagnosticTest { // All done. Report to the user. if (errors != 0) { string16 str(ASCIIToUTF16("Database corruption detected :")); - str += IntToString16(errors) + ASCIIToUTF16(" errors"); + str += base::IntToString16(errors) + ASCIIToUTF16(" errors"); RecordFailure(str); return true; } diff --git a/chrome/browser/dom_ui/net_internals_ui.cc b/chrome/browser/dom_ui/net_internals_ui.cc index 951aef4..f87532c 100644 --- a/chrome/browser/dom_ui/net_internals_ui.cc +++ b/chrome/browser/dom_ui/net_internals_ui.cc @@ -18,8 +18,8 @@ #include "base/message_loop.h" #include "base/path_service.h" #include "base/singleton.h" +#include "base/string_number_conversions.h" #include "base/string_piece.h" -#include "base/string_util.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/browser_process.h" @@ -52,7 +52,7 @@ namespace { // Formats |t| as a decimal number, in milliseconds. std::string TickCountToString(const base::TimeTicks& t) { - return Int64ToString((t - base::TimeTicks()).InMilliseconds()); + return base::Int64ToString((t - base::TimeTicks()).InMilliseconds()); } // Returns the HostCache for |context|'s primary HostResolver, or NULL if @@ -589,7 +589,7 @@ void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady( // Pass it as a string, since it may be too large to fit in an integer. CallJavascriptFunction(L"g_browser.receivedTimeTickOffset", Value::CreateStringValue( - Int64ToString(tick_to_unix_time_ms))); + base::Int64ToString(tick_to_unix_time_ms))); } OnGetPassiveLogEntries(NULL); diff --git a/chrome/browser/dom_ui/ntp_resource_cache.cc b/chrome/browser/dom_ui/ntp_resource_cache.cc index e9f046d..38eb5c7 100644 --- a/chrome/browser/dom_ui/ntp_resource_cache.cc +++ b/chrome/browser/dom_ui/ntp_resource_cache.cc @@ -14,6 +14,7 @@ #include "base/command_line.h" #include "base/file_util.h" #include "base/ref_counted_memory.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/browser_theme_provider.h" @@ -104,10 +105,10 @@ std::string GetNewTabBackgroundCSS(const ThemeProvider* theme_provider, if (alignment & BrowserThemeProvider::ALIGN_TOP) { if (alignment & BrowserThemeProvider::ALIGN_LEFT) - return "0% " + IntToString(-offset) + "px"; + return "0% " + base::IntToString(-offset) + "px"; else if (alignment & BrowserThemeProvider::ALIGN_RIGHT) - return "100% " + IntToString(-offset) + "px"; - return "center " + IntToString(-offset) + "px"; + return "100% " + base::IntToString(-offset) + "px"; + return "center " + base::IntToString(-offset) + "px"; } return BrowserThemeProvider::AlignmentToString(alignment); } diff --git a/chrome/browser/download/drag_download_util.cc b/chrome/browser/download/drag_download_util.cc index a617d41..29fd84e 100644 --- a/chrome/browser/download/drag_download_util.cc +++ b/chrome/browser/download/drag_download_util.cc @@ -9,6 +9,7 @@ #include "base/file_util.h" #include "base/scoped_ptr.h" #include "base/task.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/chrome_thread.h" #include "googleurl/src/gurl.h" @@ -65,9 +66,9 @@ FileStream* CreateFileStreamForDrop(FilePath* file_path) { new_file_path = *file_path; } else { #if defined(OS_WIN) - std::wstring suffix = std::wstring(L"-") + IntToWString(seq); + string16 suffix = ASCIIToUTF16("-") + base::IntToString16(seq); #else - std::string suffix = std::string("-") + IntToString(seq); + std::string suffix = std::string("-") + base::IntToString(seq); #endif new_file_path = file_path->InsertBeforeExtension(suffix); } diff --git a/chrome/browser/extensions/extension_bookmark_helpers.cc b/chrome/browser/extensions/extension_bookmark_helpers.cc index f648a5e..a41c340 100644 --- a/chrome/browser/extensions/extension_bookmark_helpers.cc +++ b/chrome/browser/extensions/extension_bookmark_helpers.cc @@ -4,7 +4,7 @@ #include "chrome/browser/extensions/extension_bookmark_helpers.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/extensions/extension_bookmarks_module_constants.h" namespace keys = extension_bookmarks_module_constants; @@ -16,11 +16,11 @@ DictionaryValue* GetNodeDictionary(const BookmarkNode* node, bool recurse, bool only_folders) { DictionaryValue* dict = new DictionaryValue(); - dict->SetString(keys::kIdKey, Int64ToString(node->id())); + dict->SetString(keys::kIdKey, base::Int64ToString(node->id())); const BookmarkNode* parent = node->GetParent(); if (parent) { - dict->SetString(keys::kParentIdKey, Int64ToString(parent->id())); + dict->SetString(keys::kParentIdKey, base::Int64ToString(parent->id())); dict->SetInteger(keys::kIndexKey, parent->IndexOfChild(node)); } diff --git a/chrome/browser/extensions/extension_bookmark_manager_api.cc b/chrome/browser/extensions/extension_bookmark_manager_api.cc index 9b796d2..2cbc471 100644 --- a/chrome/browser/extensions/extension_bookmark_manager_api.cc +++ b/chrome/browser/extensions/extension_bookmark_manager_api.cc @@ -8,7 +8,7 @@ #include "app/l10n_util.h" #include "base/json/json_writer.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/values.h" #include "chrome/browser/bookmarks/bookmark_drag_data.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -77,10 +77,10 @@ void AddNodeToList(ListValue* list, const BookmarkNode& node) { // Add id and parentId so we can associate the data with existing nodes on the // client side. - std::string id_string = Int64ToString(node.id()); + std::string id_string = base::Int64ToString(node.id()); dict->SetString(keys::kIdKey, id_string); - std::string parent_id_string = Int64ToString(node.GetParent()->id()); + std::string parent_id_string = base::Int64ToString(node.GetParent()->id()); dict->SetString(keys::kParentIdKey, parent_id_string); if (node.is_url()) diff --git a/chrome/browser/extensions/extension_bookmarks_module.cc b/chrome/browser/extensions/extension_bookmarks_module.cc index 0eb7a30..b819217 100644 --- a/chrome/browser/extensions/extension_bookmarks_module.cc +++ b/chrome/browser/extensions/extension_bookmarks_module.cc @@ -7,7 +7,7 @@ #include "base/json/json_writer.h" #include "base/sha1.h" #include "base/stl_util-inl.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/bookmarks/bookmark_codec.h" #include "chrome/browser/bookmarks/bookmark_html_writer.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -56,7 +56,7 @@ void BookmarksFunction::Run() { bool BookmarksFunction::GetBookmarkIdAsInt64( const std::string& id_string, int64* id) { - if (StringToInt64(id_string, id)) + if (base::StringToInt64(id_string, id)) return true; error_ = keys::kInvalidIdError; @@ -112,12 +112,13 @@ void ExtensionBookmarkEventRouter::BookmarkNodeMoved( int new_index) { ListValue args; const BookmarkNode* node = new_parent->GetChild(new_index); - args.Append(new StringValue(Int64ToString(node->id()))); + args.Append(new StringValue(base::Int64ToString(node->id()))); DictionaryValue* object_args = new DictionaryValue(); - object_args->SetString(keys::kParentIdKey, Int64ToString(new_parent->id())); + object_args->SetString(keys::kParentIdKey, + base::Int64ToString(new_parent->id())); object_args->SetInteger(keys::kIndexKey, new_index); object_args->SetString(keys::kOldParentIdKey, - Int64ToString(old_parent->id())); + base::Int64ToString(old_parent->id())); object_args->SetInteger(keys::kOldIndexKey, old_index); args.Append(object_args); @@ -131,7 +132,7 @@ void ExtensionBookmarkEventRouter::BookmarkNodeAdded(BookmarkModel* model, int index) { ListValue args; const BookmarkNode* node = parent->GetChild(index); - args.Append(new StringValue(Int64ToString(node->id()))); + args.Append(new StringValue(base::Int64ToString(node->id()))); DictionaryValue* obj = extension_bookmark_helpers::GetNodeDictionary(node, false, false); args.Append(obj); @@ -147,9 +148,10 @@ void ExtensionBookmarkEventRouter::BookmarkNodeRemoved( int index, const BookmarkNode* node) { ListValue args; - args.Append(new StringValue(Int64ToString(node->id()))); + args.Append(new StringValue(base::Int64ToString(node->id()))); DictionaryValue* object_args = new DictionaryValue(); - object_args->SetString(keys::kParentIdKey, Int64ToString(parent->id())); + object_args->SetString(keys::kParentIdKey, + base::Int64ToString(parent->id())); object_args->SetInteger(keys::kIndexKey, index); args.Append(object_args); @@ -161,7 +163,7 @@ void ExtensionBookmarkEventRouter::BookmarkNodeRemoved( void ExtensionBookmarkEventRouter::BookmarkNodeChanged( BookmarkModel* model, const BookmarkNode* node) { ListValue args; - args.Append(new StringValue(Int64ToString(node->id()))); + args.Append(new StringValue(base::Int64ToString(node->id()))); // TODO(erikkay) The only three things that BookmarkModel sends this // notification for are title, url and favicon. Since we're currently @@ -187,12 +189,12 @@ void ExtensionBookmarkEventRouter::BookmarkNodeFavIconLoaded( void ExtensionBookmarkEventRouter::BookmarkNodeChildrenReordered( BookmarkModel* model, const BookmarkNode* node) { ListValue args; - args.Append(new StringValue(Int64ToString(node->id()))); + args.Append(new StringValue(base::Int64ToString(node->id()))); int childCount = node->GetChildCount(); ListValue* children = new ListValue(); for (int i = 0; i < childCount; ++i) { const BookmarkNode* child = node->GetChild(i); - Value* child_id = new StringValue(Int64ToString(child->id())); + Value* child_id = new StringValue(base::Int64ToString(child->id())); children->Append(child_id); } DictionaryValue* reorder_info = new DictionaryValue(); @@ -347,7 +349,7 @@ bool RemoveBookmarkFunction::ExtractIds(const ListValue* args, if (!args->GetString(0, &id_string)) return false; int64 id; - if (StringToInt64(id_string, &id)) + if (base::StringToInt64(id_string, &id)) ids->push_back(id); else *invalid_id = true; @@ -618,7 +620,10 @@ class CreateBookmarkBucketMapper : public BookmarkBucketMapper<std::string> { return; } BookmarkModel* model = profile_->GetBookmarkModel(); - const BookmarkNode* parent = model->GetNodeByID(StringToInt64(parent_id)); + + int64 parent_id_int64; + base::StringToInt64(parent_id, &parent_id_int64); + const BookmarkNode* parent = model->GetNodeByID(parent_id_int64); if (!parent) return; diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc index dedcf8f..a30f352 100644 --- a/chrome/browser/extensions/extension_browsertest.cc +++ b/chrome/browser/extensions/extension_browsertest.cc @@ -9,7 +9,7 @@ #include "base/command_line.h" #include "base/file_path.h" #include "base/path_service.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_window.h" #include "chrome/browser/location_bar.h" @@ -147,8 +147,9 @@ bool ExtensionBrowserTest::InstallOrUpdateExtension(const std::string& id, size_t num_after = service->extensions()->size(); if (num_after != (num_before + expected_change)) { - std::cout << "Num extensions before: " << IntToString(num_before) << " " - << "num after: " << IntToString(num_after) << " " + std::cout << "Num extensions before: " + << base::IntToString(num_before) << " " + << "num after: " << base::IntToString(num_after) << " " << "Installed extensions follow:\n"; for (size_t i = 0; i < service->extensions()->size(); ++i) diff --git a/chrome/browser/extensions/extension_clipboard_api.cc b/chrome/browser/extensions/extension_clipboard_api.cc index 22a6253..af1deae 100644 --- a/chrome/browser/extensions/extension_clipboard_api.cc +++ b/chrome/browser/extensions/extension_clipboard_api.cc @@ -4,7 +4,7 @@ #include "chrome/browser/extensions/extension_clipboard_api.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/values.h" #include "chrome/browser/extensions/extension_tabs_module.h" #include "chrome/browser/renderer_host/render_view_host.h" @@ -23,8 +23,8 @@ bool ClipboardFunction::RunImpl() { TabContents* contents = NULL; if (!ExtensionTabUtil::GetTabById(tab_id, profile(), include_incognito(), NULL, NULL, &contents, NULL)) { - error_ = ExtensionErrorUtils::FormatErrorMessage(kNoTabError, - IntToString(tab_id)); + error_ = ExtensionErrorUtils::FormatErrorMessage( + kNoTabError, base::IntToString(tab_id)); return false; } diff --git a/chrome/browser/extensions/extension_context_menu_api.cc b/chrome/browser/extensions/extension_context_menu_api.cc index 9b7a3a8..356a43c 100644 --- a/chrome/browser/extensions/extension_context_menu_api.cc +++ b/chrome/browser/extensions/extension_context_menu_api.cc @@ -7,6 +7,7 @@ #include <string> #include "base/values.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "chrome/browser/extensions/extensions_service.h" #include "chrome/browser/profile.h" @@ -188,7 +189,8 @@ bool ExtensionContextMenuFunction::GetParent( ExtensionMenuItem* parent = manager.GetItemById(parent_id); if (!parent) { - error_ = "Cannot find menu item with id " + IntToString(parent_id.second); + error_ = "Cannot find menu item with id " + + base::IntToString(parent_id.second); return false; } if (parent->type() != ExtensionMenuItem::NORMAL) { @@ -246,7 +248,7 @@ bool CreateContextMenuFunction::RunImpl() { ExtensionMenuItem* parent = menu_manager->GetItemById(parent_id); if (!parent) { error_ = ExtensionErrorUtils::FormatErrorMessage( - kCannotFindItemError, IntToString(parent_id.second)); + kCannotFindItemError, base::IntToString(parent_id.second)); return false; } if (parent->type() != ExtensionMenuItem::NORMAL) { @@ -273,7 +275,7 @@ bool UpdateContextMenuFunction::RunImpl() { ExtensionMenuItem* item = manager->GetItemById(item_id); if (!item || item->extension_id() != extension_id()) { error_ = ExtensionErrorUtils::FormatErrorMessage( - kCannotFindItemError, IntToString(item_id.second)); + kCannotFindItemError, base::IntToString(item_id.second)); return false; } @@ -341,7 +343,7 @@ bool RemoveContextMenuFunction::RunImpl() { // Ensure one extension can't remove another's menu items. if (!item || item->extension_id() != extension_id()) { error_ = ExtensionErrorUtils::FormatErrorMessage( - kCannotFindItemError, IntToString(id.second)); + kCannotFindItemError, base::IntToString(id.second)); return false; } diff --git a/chrome/browser/extensions/extension_history_api.cc b/chrome/browser/extensions/extension_history_api.cc index 23f861f..0b891c8 100644 --- a/chrome/browser/extensions/extension_history_api.cc +++ b/chrome/browser/extensions/extension_history_api.cc @@ -7,7 +7,7 @@ #include "base/callback.h" #include "base/json/json_writer.h" #include "base/message_loop.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/task.h" #include "base/values.h" #include "chrome/browser/extensions/extension_history_api_constants.h" @@ -28,7 +28,7 @@ double MilliSecondsFromTime(const base::Time& time) { void GetHistoryItemDictionary(const history::URLRow& row, DictionaryValue* value) { - value->SetString(keys::kIdKey, Int64ToString(row.id())); + value->SetString(keys::kIdKey, base::Int64ToString(row.id())); value->SetString(keys::kUrlKey, row.url().spec()); value->SetStringFromUTF16(keys::kTitleKey, row.title()); value->SetReal(keys::kLastVisitdKey, MilliSecondsFromTime(row.last_visit())); @@ -44,11 +44,11 @@ void AddHistoryNode(const history::URLRow& row, ListValue* list) { void GetVisitInfoDictionary(const history::VisitRow& row, DictionaryValue* value) { - value->SetString(keys::kIdKey, Int64ToString(row.url_id)); - value->SetString(keys::kVisitId, Int64ToString(row.visit_id)); + value->SetString(keys::kIdKey, base::Int64ToString(row.url_id)); + value->SetString(keys::kVisitId, base::Int64ToString(row.visit_id)); value->SetReal(keys::kVisitTime, MilliSecondsFromTime(row.visit_time)); value->SetString(keys::kReferringVisitId, - Int64ToString(row.referring_visit)); + base::Int64ToString(row.referring_visit)); const char* trans = PageTransition::CoreTransitionString(row.transition); DCHECK(trans) << "Invalid transition."; diff --git a/chrome/browser/extensions/extension_infobar_module.cc b/chrome/browser/extensions/extension_infobar_module.cc index 8ca5605..2d3e67f 100644 --- a/chrome/browser/extensions/extension_infobar_module.cc +++ b/chrome/browser/extensions/extension_infobar_module.cc @@ -5,6 +5,7 @@ #include "chrome/browser/extensions/extension_infobar_module.h" #include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/browser.h" #include "chrome/browser/extensions/extension_host.h" #include "chrome/browser/extensions/extension_infobar_module_constants.h" @@ -45,7 +46,7 @@ bool ShowInfoBarFunction::RunImpl() { NULL)) { error_ = ExtensionErrorUtils::FormatErrorMessage( extension_tabs_module_constants::kTabNotFoundError, - IntToString(tab_id)); + base::IntToString(tab_id)); return false; } diff --git a/chrome/browser/extensions/extension_page_actions_module.cc b/chrome/browser/extensions/extension_page_actions_module.cc index cdeb892..095cd36 100644 --- a/chrome/browser/extensions/extension_page_actions_module.cc +++ b/chrome/browser/extensions/extension_page_actions_module.cc @@ -4,7 +4,7 @@ #include "chrome/browser/extensions/extension_page_actions_module.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/profile.h" @@ -71,8 +71,8 @@ bool PageActionFunction::SetPageActionEnabled(bool enable) { bool result = ExtensionTabUtil::GetTabById( tab_id, profile(), include_incognito(), NULL, NULL, &contents, NULL); if (!result || !contents) { - error_ = ExtensionErrorUtils::FormatErrorMessage(kNoTabError, - IntToString(tab_id)); + error_ = ExtensionErrorUtils::FormatErrorMessage( + kNoTabError, base::IntToString(tab_id)); return false; } @@ -104,8 +104,8 @@ bool PageActionFunction::InitCommon(int tab_id) { bool result = ExtensionTabUtil::GetTabById( tab_id, profile(), include_incognito(), NULL, NULL, &contents_, NULL); if (!result || !contents_) { - error_ = ExtensionErrorUtils::FormatErrorMessage(kNoTabError, - IntToString(tab_id)); + error_ = ExtensionErrorUtils::FormatErrorMessage( + kNoTabError, base::IntToString(tab_id)); return false; } diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc index ed44ec4..4006120 100644 --- a/chrome/browser/extensions/extension_prefs.cc +++ b/chrome/browser/extensions/extension_prefs.cc @@ -3,6 +3,8 @@ // found in the LICENSE file. #include "base/string_util.h" +#include "base/string_number_conversions.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/extensions/extension_prefs.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/pref_names.h" @@ -317,7 +319,7 @@ void ExtensionPrefs::SetLastPingDayImpl(const Time& time, NOTREACHED(); return; } - std::string value = Int64ToString(time.ToInternalValue()); + std::string value = base::Int64ToString(time.ToInternalValue()); dictionary->SetString(kLastPingDay, value); prefs_->ScheduleSavePersistentPrefs(); } @@ -695,7 +697,7 @@ void ExtensionPrefs::SetIdleInstallInfo(const std::string& extension_id, info->SetString(kIdleInstallInfoCrxPath, crx_path.value()); info->SetString(kIdleInstallInfoVersion, version); info->SetString(kIdleInstallInfoFetchTime, - Int64ToString(fetch_time.ToInternalValue())); + base::Int64ToString(fetch_time.ToInternalValue())); extension_prefs->Set(kIdleInstallInfo, info); prefs_->ScheduleSavePersistentPrefs(); } diff --git a/chrome/browser/extensions/extension_prefs_unittest.cc b/chrome/browser/extensions/extension_prefs_unittest.cc index 812891b..cd87bbe 100644 --- a/chrome/browser/extensions/extension_prefs_unittest.cc +++ b/chrome/browser/extensions/extension_prefs_unittest.cc @@ -6,7 +6,7 @@ #include "base/path_service.h" #include "base/scoped_temp_dir.h" #include "base/stl_util-inl.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/extensions/extension_prefs.h" #include "chrome/browser/extensions/test_extension_prefs.h" @@ -172,7 +172,7 @@ class ExtensionPrefsBlacklist : public ExtensionPrefsTest { // Install 5 extensions. for (int i = 0; i < 5; i++) { - std::string name = "test" + IntToString(i); + std::string name = "test" + base::IntToString(i); extensions_.push_back(linked_ptr<Extension>(prefs_.AddExtension(name))); } EXPECT_EQ(NULL, prefs()->GetInstalledExtensionInfo(not_installed_id_)); @@ -225,8 +225,9 @@ class ExtensionPrefsIdleInstallInfo : public ExtensionPrefsTest { public: // Sets idle install information for one test extension. void SetIdleInfo(std::string id, int num) { - prefs()->SetIdleInstallInfo(id, basedir_.AppendASCII(IntToString(num)), - "1." + IntToString(num), + prefs()->SetIdleInstallInfo(id, + basedir_.AppendASCII(base::IntToString(num)), + "1." + base::IntToString(num), now_ + TimeDelta::FromSeconds(num)); } @@ -239,8 +240,8 @@ class ExtensionPrefsIdleInstallInfo : public ExtensionPrefsTest { ASSERT_TRUE(prefs()->GetIdleInstallInfo(id, &crx_path, &version, &fetch_time)); ASSERT_EQ(crx_path.value(), - basedir_.AppendASCII(IntToString(num)).value()); - ASSERT_EQ("1." + IntToString(num), version); + basedir_.AppendASCII(base::IntToString(num)).value()); + ASSERT_EQ("1." + base::IntToString(num), version); ASSERT_TRUE(fetch_time == now_ + TimeDelta::FromSeconds(num)); } diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc index a4b1ee1..4d0d11f 100644 --- a/chrome/browser/extensions/extension_tabs_module.cc +++ b/chrome/browser/extensions/extension_tabs_module.cc @@ -5,6 +5,7 @@ #include "chrome/browser/extensions/extension_tabs_module.h" #include "base/base64.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" @@ -223,7 +224,7 @@ bool GetWindowFunction::RunImpl() { include_incognito(), &error_); if (!browser || !browser->window()) { error_ = ExtensionErrorUtils::FormatErrorMessage( - keys::kWindowNotFoundError, IntToString(window_id)); + keys::kWindowNotFoundError, base::IntToString(window_id)); return false; } @@ -396,7 +397,7 @@ bool UpdateWindowFunction::RunImpl() { include_incognito(), &error_); if (!browser || !browser->window()) { error_ = ExtensionErrorUtils::FormatErrorMessage( - keys::kWindowNotFoundError, IntToString(window_id)); + keys::kWindowNotFoundError, base::IntToString(window_id)); return false; } @@ -746,7 +747,7 @@ bool MoveTabFunction::RunImpl() { contents = source_tab_strip->DetachTabContentsAt(tab_index); if (!contents) { error_ = ExtensionErrorUtils::FormatErrorMessage( - keys::kTabNotFoundError, IntToString(tab_id)); + keys::kTabNotFoundError, base::IntToString(tab_id)); return false; } @@ -1060,7 +1061,7 @@ static Browser* GetBrowserInProfileWithId(Profile* profile, if (error_message) *error_message = ExtensionErrorUtils::FormatErrorMessage( - keys::kWindowNotFoundError, IntToString(window_id)); + keys::kWindowNotFoundError, base::IntToString(window_id)); return NULL; } @@ -1078,7 +1079,7 @@ static bool GetTabById(int tab_id, Profile* profile, if (error_message) *error_message = ExtensionErrorUtils::FormatErrorMessage( - keys::kTabNotFoundError, IntToString(tab_id)); + keys::kTabNotFoundError, base::IntToString(tab_id)); return false; } diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc index 9f21100..f0da90f 100644 --- a/chrome/browser/extensions/extension_updater.cc +++ b/chrome/browser/extensions/extension_updater.cc @@ -14,6 +14,7 @@ #include "base/rand_util.h" #include "base/sha2.h" #include "base/stl_util-inl.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/time.h" #include "base/thread.h" @@ -105,8 +106,8 @@ bool ManifestFetchData::AddExtension(std::string id, std::string version, parts.push_back("uc"); if (ShouldPing(days)) { - parts.push_back("ping=" + EscapeQueryParamValue("r=" + IntToString(days), - true)); + parts.push_back("ping=" + + EscapeQueryParamValue("r=" + base::IntToString(days), true)); } std::string extra = full_url_.has_query() ? "&" : "?"; @@ -556,7 +557,8 @@ void ExtensionUpdater::ProcessBlacklist(const std::string& data) { // Verify sha256 hash value. char sha256_hash_value[base::SHA256_LENGTH]; base::SHA256HashString(data, sha256_hash_value, base::SHA256_LENGTH); - std::string hash_in_hex = HexEncode(sha256_hash_value, base::SHA256_LENGTH); + std::string hash_in_hex = base::HexEncode(sha256_hash_value, + base::SHA256_LENGTH); if (current_extension_fetch_.package_hash != hash_in_hex) { NOTREACHED() << "Fetched blacklist checksum is not as expected. " diff --git a/chrome/browser/extensions/extension_updater_unittest.cc b/chrome/browser/extensions/extension_updater_unittest.cc index 0895501..8f314a9 100644 --- a/chrome/browser/extensions/extension_updater_unittest.cc +++ b/chrome/browser/extensions/extension_updater_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,6 +8,7 @@ #include "base/rand_util.h" #include "base/scoped_ptr.h" #include "base/stl_util-inl.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/thread.h" #include "base/version.h" @@ -767,7 +768,7 @@ class ExtensionUpdaterTest : public testing::Test { if (ping_days == 0) { EXPECT_TRUE(url1_query.find(search_string) == std::string::npos); } else { - search_string += "%253D" + IntToString(ping_days); + search_string += "%253D" + base::IntToString(ping_days); size_t pos = url1_query.find(search_string); EXPECT_TRUE(pos != std::string::npos); } diff --git a/chrome/browser/geolocation/network_location_request.cc b/chrome/browser/geolocation/network_location_request.cc index 7eae212..2683b0c 100644 --- a/chrome/browser/geolocation/network_location_request.cc +++ b/chrome/browser/geolocation/network_location_request.cc @@ -6,7 +6,7 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/values.h" #include "chrome/common/geoposition.h" #include "chrome/common/net/url_request_context_getter.h" @@ -202,7 +202,7 @@ void GetLocationFromResponse(bool http_post_result, } if (status_code != 200) { // HTTP OK. std::string message = "Returned error code "; - message += IntToString(status_code); + message += base::IntToString(status_code); FormatPositionError(server_url, message, position); return; } diff --git a/chrome/browser/gtk/download_in_progress_dialog_gtk.cc b/chrome/browser/gtk/download_in_progress_dialog_gtk.cc index 8ee6b30..8a41589 100644 --- a/chrome/browser/gtk/download_in_progress_dialog_gtk.cc +++ b/chrome/browser/gtk/download_in_progress_dialog_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -7,6 +7,7 @@ #include <gtk/gtk.h> #include "app/l10n_util.h" +#include "base/string_number_conversions.h" #include "base/string16.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_window.h" @@ -41,7 +42,8 @@ DownloadInProgressDialogGtk::DownloadInProgressDialogGtk(Browser* browser) } else { warning_text = l10n_util::GetStringFUTF8(IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_WARNING, - product_name, IntToString16(download_count)); + product_name, + base::IntToString16(download_count)); explanation_text = l10n_util::GetStringFUTF8( IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_EXPLANATION, product_name); diff --git a/chrome/browser/gtk/find_bar_gtk.cc b/chrome/browser/gtk/find_bar_gtk.cc index 18a41258..0c0f40d 100644 --- a/chrome/browser/gtk/find_bar_gtk.cc +++ b/chrome/browser/gtk/find_bar_gtk.cc @@ -13,6 +13,7 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "base/i18n/rtl.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "chrome/browser/browser.h" #include "chrome/browser/find_bar_controller.h" @@ -384,8 +385,8 @@ void FindBarGtk::UpdateUIForFindResult(const FindNotificationDetails& result, if (!find_text.empty() && have_valid_range) { gtk_label_set_text(GTK_LABEL(match_count_label_), l10n_util::GetStringFUTF8(IDS_FIND_IN_PAGE_COUNT, - IntToString16(result.active_match_ordinal()), - IntToString16(result.number_of_matches())).c_str()); + base::IntToString16(result.active_match_ordinal()), + base::IntToString16(result.number_of_matches())).c_str()); UpdateMatchLabelAppearance(result.number_of_matches() == 0 && result.final_update()); } else { diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc index 44a41b8..442306f 100644 --- a/chrome/browser/metrics/metrics_service.cc +++ b/chrome/browser/metrics/metrics_service.cc @@ -167,6 +167,7 @@ #include "base/command_line.h" #include "base/histogram.h" #include "base/md5.h" +#include "base/string_number_conversions.h" #include "base/thread.h" #include "base/values.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -515,7 +516,7 @@ void MetricsService::SetRecording(bool enabled) { // Might as well make a note of how long this ID has existed pref->SetString(prefs::kMetricsClientIDTimestamp, - Int64ToString(Time::Now().ToTimeT())); + base::Int64ToString(Time::Now().ToTimeT())); } } child_process_logging::SetClientId(client_id_); diff --git a/chrome/browser/net/predictor_api.cc b/chrome/browser/net/predictor_api.cc index 4e4569e..98febfe 100644 --- a/chrome/browser/net/predictor_api.cc +++ b/chrome/browser/net/predictor_api.cc @@ -10,7 +10,7 @@ #include "base/singleton.h" #include "base/stats_counters.h" #include "base/stl_util-inl.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/thread.h" #include "base/waitable_event.h" #include "base/values.h" @@ -310,7 +310,7 @@ void PrefetchObserver::StartupListAppend(const std::string& host, int port) { std::string url_spec = is_ssl ? "https://" : "http://"; url_spec += host; url_spec += ":"; - url_spec += IntToString(port); + url_spec += base::IntToString(port); GURL url(url_spec); first_resolutions_.insert(url); diff --git a/chrome/browser/net/predictor_unittest.cc b/chrome/browser/net/predictor_unittest.cc index 9a3eea3..58c71ed 100644 --- a/chrome/browser/net/predictor_unittest.cc +++ b/chrome/browser/net/predictor_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,7 +10,7 @@ #include "base/message_loop.h" #include "base/scoped_ptr.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/timer.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/net/predictor_api.h" @@ -235,7 +235,7 @@ TEST_F(PredictorTest, MassiveConcurrentLookupTest) { UrlList names; for (int i = 0; i < 100; i++) - names.push_back(GURL("http://host" + IntToString(i) + ".notfound:80")); + names.push_back(GURL("http://host" + base::IntToString(i) + ".notfound:80")); // Try to flood the predictor with many concurrent requests. for (int i = 0; i < 10; i++) diff --git a/chrome/browser/page_info_model.cc b/chrome/browser/page_info_model.cc index aed8b23..636e252 100644 --- a/chrome/browser/page_info_model.cc +++ b/chrome/browser/page_info_model.cc @@ -9,6 +9,7 @@ #include "app/l10n_util.h" #include "base/callback.h" #include "base/i18n/time_formatting.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/cert_store.h" #include "chrome/browser/pref_service.h" @@ -136,7 +137,7 @@ PageInfoModel::PageInfoModel(Profile* profile, description.assign(l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_CONNECTION_TEXT, subject_name, - IntToString16(ssl.security_bits()))); + base::IntToString16(ssl.security_bits()))); if (ssl.displayed_insecure_content() || ssl.ran_insecure_content()) { state = false; description.assign(l10n_util::GetStringFUTF16( diff --git a/chrome/browser/page_state.cc b/chrome/browser/page_state.cc index bf431ca..19764f0 100644 --- a/chrome/browser/page_state.cc +++ b/chrome/browser/page_state.cc @@ -6,7 +6,7 @@ #include "base/basictypes.h" #include "base/logging.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/page_state.h" #include "chrome/common/json_value_serializer.h" @@ -80,25 +80,25 @@ bool PageState::GetProperty(const std::wstring& key, } void PageState::SetInt64Property(const std::wstring& key, int64 value) { - SetProperty(key, Int64ToWString(value)); + SetProperty(key, UTF8ToWide(base::Int64ToString(value))); } bool PageState::GetInt64Property(const std::wstring& key, int64* value) const { std::wstring v; if (GetProperty(key, &v)) { - return StringToInt64(WideToUTF16Hack(v), value); + return base::StringToInt64(WideToUTF8(v), value); } return false; } void PageState::SetIntProperty(const std::wstring& key, int value) { - SetProperty(key, IntToWString(value)); + SetProperty(key, UTF8ToWide(base::IntToString(value))); } bool PageState::GetIntProperty(const std::wstring& key, int* value) const { std::wstring v; if (GetProperty(key, &v)) { - return StringToInt(WideToUTF16Hack(v), value); + return base::StringToInt(WideToUTF8(v), value); } return false; } diff --git a/chrome/browser/parsers/metadata_parser_filebase.cc b/chrome/browser/parsers/metadata_parser_filebase.cc index 5b4aeff..0146f3f 100644 --- a/chrome/browser/parsers/metadata_parser_filebase.cc +++ b/chrome/browser/parsers/metadata_parser_filebase.cc @@ -1,11 +1,11 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/parsers/metadata_parser_filebase.h" #include "base/file_util.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" FileMetadataParser::FileMetadataParser(const FilePath& path) @@ -17,7 +17,7 @@ bool FileMetadataParser::Parse() { std::string value; int64 size; if (file_util::GetFileSize(path_, &size)) { - properties_[MetadataParser::kPropertyFilesize] = Int64ToString(size); + properties_[MetadataParser::kPropertyFilesize] = base::Int64ToString(size); } #if defined(OS_WIN) value = WideToUTF8(path_.BaseName().value()); diff --git a/chrome/browser/parsers/metadata_parser_filebase_unittest.cc b/chrome/browser/parsers/metadata_parser_filebase_unittest.cc index 0e954e6..24e1051 100644 --- a/chrome/browser/parsers/metadata_parser_filebase_unittest.cc +++ b/chrome/browser/parsers/metadata_parser_filebase_unittest.cc @@ -8,7 +8,8 @@ #include "base/file_path.h" #include "base/file_util.h" #include "base/scoped_temp_dir.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" +#include "base/string_util.h" // TODO(brettw) remove when WideToASCII moves. #include "chrome/browser/parsers/metadata_parser_filebase.h" #include "testing/gtest/include/gtest/gtest.h" @@ -41,7 +42,7 @@ class FileMetaDataParserTest : public testing::Test { int64 size; EXPECT_TRUE(file_util::GetFileSize(test_file_, &size)); - return Int64ToString(size); + return base::Int64ToString(size); } ScopedTempDir temp_dir_; diff --git a/chrome/browser/password_manager/login_database_unittest.cc b/chrome/browser/password_manager/login_database_unittest.cc index e650042..2d8a061 100644 --- a/chrome/browser/password_manager/login_database_unittest.cc +++ b/chrome/browser/password_manager/login_database_unittest.cc @@ -7,7 +7,8 @@ #include "base/basictypes.h" #include "base/file_util.h" #include "base/path_service.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" +#include "base/string_util.h" // TODO(brettw) remove when ASCIIToUTF16 moves. #include "base/time.h" #include "chrome/browser/password_manager/login_database.h" #include "chrome/common/chrome_paths.h" @@ -21,7 +22,7 @@ class LoginDatabaseTest : public testing::Test { PathService::Get(chrome::DIR_TEST_DATA, &file_); const std::string test_db = "TestMetadataStoreMacDatabase" + - Int64ToString(base::Time::Now().ToInternalValue()) + ".db"; + base::Int64ToString(base::Time::Now().ToInternalValue()) + ".db"; file_ = file_.AppendASCII(test_db); file_util::Delete(file_, false); } diff --git a/chrome/browser/password_manager/native_backend_gnome_x.cc b/chrome/browser/password_manager/native_backend_gnome_x.cc index 667611e..aeaf40d 100644 --- a/chrome/browser/password_manager/native_backend_gnome_x.cc +++ b/chrome/browser/password_manager/native_backend_gnome_x.cc @@ -13,6 +13,7 @@ #include <vector> #include "base/logging.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/time.h" #include "base/utf_string_conversions.h" @@ -321,7 +322,7 @@ void GKRMethod::AddLogin(const PasswordForm& form) { "signon_realm", form.signon_realm.c_str(), "ssl_valid", form.ssl_valid, "preferred", form.preferred, - "date_created", Int64ToString(form.date_created.ToTimeT()).c_str(), + "date_created", base::Int64ToString(form.date_created.ToTimeT()).c_str(), "blacklisted_by_user", form.blacklisted_by_user, "scheme", form.scheme, "application", GNOME_KEYRING_APPLICATION_CHROME, diff --git a/chrome/browser/process_info_snapshot_mac.cc b/chrome/browser/process_info_snapshot_mac.cc index e7ff4db..0f20080 100644 --- a/chrome/browser/process_info_snapshot_mac.cc +++ b/chrome/browser/process_info_snapshot_mac.cc @@ -8,6 +8,7 @@ #include "base/command_line.h" #include "base/logging.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/thread.h" @@ -50,7 +51,7 @@ bool ProcessInfoSnapshot::Sample(std::vector<base::ProcessId> pid_list) { for (std::vector<base::ProcessId>::iterator it = pid_list.begin(); it != pid_list.end(); ++it) { argv.push_back("-p"); - argv.push_back(Int64ToString(static_cast<int64>(*it))); + argv.push_back(base::Int64ToString(static_cast<int64>(*it))); } std::string output; diff --git a/chrome/browser/renderer_host/render_sandbox_host_linux.cc b/chrome/browser/renderer_host/render_sandbox_host_linux.cc index 3656c47..1b07361 100644 --- a/chrome/browser/renderer_host/render_sandbox_host_linux.cc +++ b/chrome/browser/renderer_host/render_sandbox_host_linux.cc @@ -23,6 +23,7 @@ #include "base/process_util.h" #include "base/scoped_ptr.h" #include "base/shared_memory.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/unix_domain_socket_posix.h" #include "chrome/common/sandbox_methods_linux.h" @@ -336,7 +337,7 @@ class SandboxIPCProcess { std::string inode_output; std::vector<std::string> sandbox_cmd = sandbox_cmd_; - sandbox_cmd.push_back(Int64ToString(inode)); + sandbox_cmd.push_back(base::Int64ToString(inode)); CommandLine get_inode_cmd(sandbox_cmd); if (base::GetAppOutput(get_inode_cmd, &inode_output)) StringToInt(inode_output, &pid); diff --git a/chrome/browser/safe_browsing/chunk_range.cc b/chrome/browser/safe_browsing/chunk_range.cc index 112d71a..c42fab3 100644 --- a/chrome/browser/safe_browsing/chunk_range.cc +++ b/chrome/browser/safe_browsing/chunk_range.cc @@ -7,6 +7,7 @@ #include "chrome/browser/safe_browsing/chunk_range.h" #include "base/logging.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" ChunkRange::ChunkRange(int start) : start_(start), stop_(start) { @@ -61,7 +62,7 @@ void RangesToString(const std::vector<ChunkRange>& ranges, if (!result->empty()) result->append(","); if (it->start() == it->stop()) { - std::string num_buf = IntToString(it->start()); + std::string num_buf = base::IntToString(it->start()); result->append(num_buf); } else { result->append(StringPrintf("%d-%d", it->start(), it->stop())); diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc index beed6d3..3bdd459 100644 --- a/chrome/browser/search_engines/template_url.cc +++ b/chrome/browser/search_engines/template_url.cc @@ -8,6 +8,7 @@ #include "base/i18n/icu_string_conversions.h" #include "base/i18n/rtl.h" #include "base/logging.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/google_url_tracker.h" @@ -109,11 +110,11 @@ bool TemplateURLRef::ParseParameter(size_t start, url->insert(start, kDefaultCount); } else if (parameter == kStartIndexParameter) { if (!optional) { - url->insert(start, IntToString(index_offset_)); + url->insert(start, base::IntToString(index_offset_)); } } else if (parameter == kStartPageParameter) { if (!optional) { - url->insert(start, IntToString(page_offset_)); + url->insert(start, base::IntToString(page_offset_)); } } else if (parameter == kLanguageParameter) { replacements->push_back(Replacement(LANGUAGE, start)); diff --git a/chrome/browser/search_engines/template_url_model.cc b/chrome/browser/search_engines/template_url_model.cc index ede0ea0..9e12822 100644 --- a/chrome/browser/search_engines/template_url_model.cc +++ b/chrome/browser/search_engines/template_url_model.cc @@ -6,6 +6,7 @@ #include "app/l10n_util.h" #include "base/stl_util-inl.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/extensions/extensions_service.h" #include "chrome/browser/google_url_tracker.h" @@ -818,11 +819,11 @@ void TemplateURLModel::SaveDefaultSearchProviderToPrefs( prefs->SetString(prefs::kDefaultSearchProviderName, name); const std::string id_string = - t_url ? Int64ToString(t_url->id()) : std::string(); + t_url ? base::Int64ToString(t_url->id()) : std::string(); prefs->SetString(prefs::kDefaultSearchProviderID, id_string); const std::string prepopulate_id = - t_url ? Int64ToString(t_url->prepopulate_id()) : std::string(); + t_url ? base::Int64ToString(t_url->prepopulate_id()) : std::string(); prefs->SetString(prefs::kDefaultSearchProviderPrepopulateID, prepopulate_id); prefs->ScheduleSavePersistentPrefs(); diff --git a/chrome/browser/sessions/session_service_unittest.cc b/chrome/browser/sessions/session_service_unittest.cc index 5b30328..ce7354e 100644 --- a/chrome/browser/sessions/session_service_unittest.cc +++ b/chrome/browser/sessions/session_service_unittest.cc @@ -7,7 +7,7 @@ #include "base/scoped_ptr.h" #include "base/scoped_vector.h" #include "base/stl_util-inl.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/time.h" #include "chrome/browser/defaults.h" #include "chrome/browser/sessions/session_backend.h" @@ -32,7 +32,7 @@ class SessionServiceTest : public BrowserWithTestWindowTest, protected: virtual void SetUp() { BrowserWithTestWindowTest::SetUp(); - std::string b = Int64ToString(base::Time::Now().ToInternalValue()); + std::string b = base::Int64ToString(base::Time::Now().ToInternalValue()); PathService::Get(base::DIR_TEMP, &path_); path_ = path_.Append(FILE_PATH_LITERAL("SessionTestDirs")); @@ -510,7 +510,7 @@ TEST_F(SessionServiceTest, PruneFromFront) { // Add 5 navigations, with the 4th selected. for (int i = 0; i < 5; ++i) { - TabNavigation nav(0, GURL(base_url + IntToString(i)), GURL(), + TabNavigation nav(0, GURL(base_url + base::IntToString(i)), GURL(), ASCIIToUTF16("a"), "b", PageTransition::QUALIFIER_MASK); UpdateNavigation(window_id, tab_id, nav, i, (i == 3)); } @@ -534,11 +534,11 @@ TEST_F(SessionServiceTest, PruneFromFront) { SessionTab* tab = windows[0]->tabs[0]; ASSERT_EQ(1, tab->current_navigation_index); EXPECT_EQ(3U, tab->navigations.size()); - EXPECT_TRUE(GURL(base_url + IntToString(2)) == + EXPECT_TRUE(GURL(base_url + base::IntToString(2)) == tab->navigations[0].virtual_url()); - EXPECT_TRUE(GURL(base_url + IntToString(3)) == + EXPECT_TRUE(GURL(base_url + base::IntToString(3)) == tab->navigations[1].virtual_url()); - EXPECT_TRUE(GURL(base_url + IntToString(4)) == + EXPECT_TRUE(GURL(base_url + base::IntToString(4)) == tab->navigations[2].virtual_url()); } @@ -551,7 +551,7 @@ TEST_F(SessionServiceTest, PruneToEmpty) { // Add 5 navigations, with the 4th selected. for (int i = 0; i < 5; ++i) { - TabNavigation nav(0, GURL(base_url + IntToString(i)), GURL(), + TabNavigation nav(0, GURL(base_url + base::IntToString(i)), GURL(), ASCIIToUTF16("a"), "b", PageTransition::QUALIFIER_MASK); UpdateNavigation(window_id, tab_id, nav, i, (i == 3)); } diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc index a2b8aa8..f1dac7b 100644 --- a/chrome/browser/shell_integration_linux.cc +++ b/chrome/browser/shell_integration_linux.cc @@ -27,6 +27,7 @@ #include "base/string_util.h" #include "base/task.h" #include "base/thread.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_process.h" #include "chrome/common/chrome_constants.h" @@ -303,8 +304,8 @@ FilePath ShellIntegration::GetDesktopShortcutFilename(const GURL& url) { FilePath alternative_filepath(filepath.value() + ".desktop"); for (size_t i = 1; i < 100; ++i) { if (file_util::PathExists(FilePath(alternative_filepath))) { - alternative_filepath = FilePath(filepath.value() + "_" + IntToString(i) + - ".desktop"); + alternative_filepath = FilePath( + filepath.value() + "_" + base::IntToString(i) + ".desktop"); } else { return FilePath(alternative_filepath).BaseName(); } diff --git a/chrome/browser/ssl/ssl_add_cert_handler.cc b/chrome/browser/ssl/ssl_add_cert_handler.cc index 691e8773..210c502 100644 --- a/chrome/browser/ssl/ssl_add_cert_handler.cc +++ b/chrome/browser/ssl/ssl_add_cert_handler.cc @@ -5,7 +5,7 @@ #include "chrome/browser/ssl/ssl_add_cert_handler.h" #include "app/l10n_util.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_window.h" @@ -37,7 +37,7 @@ void SSLAddCertHandler::RunUI() { // TODO(snej): Map cert_error to a more specific error message. ShowError(l10n_util::GetStringFUTF16( IDS_ADD_CERT_ERR_INVALID_CERT, - IntToString16(-cert_error), + base::IntToString16(-cert_error), ASCIIToUTF16(net::ErrorToString(cert_error)))); Finished(false); return; @@ -60,7 +60,7 @@ void SSLAddCertHandler::Finished(bool add_cert) { // TODO(snej): Map cert_error to a more specific error message. ShowError(l10n_util::GetStringFUTF16( IDS_ADD_CERT_ERR_FAILED, - IntToString16(-cert_error), + base::IntToString16(-cert_error), ASCIIToUTF16(net::ErrorToString(cert_error)))); } } diff --git a/chrome/browser/sync/engine/syncer_unittest.cc b/chrome/browser/sync/engine/syncer_unittest.cc index ae6e597..9db596a 100644 --- a/chrome/browser/sync/engine/syncer_unittest.cc +++ b/chrome/browser/sync/engine/syncer_unittest.cc @@ -14,6 +14,7 @@ #include "base/callback.h" #include "base/scoped_ptr.h" +#include "base/string_number_conversions.h" #include "build/build_config.h" #include "chrome/browser/sync/engine/conflict_resolver.h" #include "chrome/browser/sync/engine/get_commit_ids_command.h" @@ -4982,7 +4983,7 @@ class SyncerPositionUpdateTest : public SyncerTest { } void AddRootItemWithPosition(int64 position) { - string id = string("ServerId") + Int64ToString(next_update_id_++); + string id = string("ServerId") + base::Int64ToString(next_update_id_++); string name = "my name is my id -- " + id; int revision = next_revision_++; mock_server_->AddUpdateDirectory(id, kRootId, name, revision, revision); diff --git a/chrome/browser/sync/glue/http_bridge.cc b/chrome/browser/sync/glue/http_bridge.cc index a442953..e39e6ff 100644 --- a/chrome/browser/sync/glue/http_bridge.cc +++ b/chrome/browser/sync/glue/http_bridge.cc @@ -6,7 +6,7 @@ #include "base/message_loop.h" #include "base/message_loop_proxy.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/profile.h" #include "chrome/browser/chrome_thread.h" @@ -143,7 +143,7 @@ void HttpBridge::SetURL(const char* url, int port) { << "HttpBridge::SetURL called more than once?!"; GURL temp(url); GURL::Replacements replacements; - std::string port_str = IntToString(port); + std::string port_str = base::IntToString(port); replacements.SetPort(port_str.c_str(), url_parse::Component(0, port_str.length())); url_for_request_ = temp.ReplaceComponents(replacements); diff --git a/chrome/browser/sync/notifier/cache_invalidation_packet_handler.cc b/chrome/browser/sync/notifier/cache_invalidation_packet_handler.cc index 7edfc73..a4c36dd 100644 --- a/chrome/browser/sync/notifier/cache_invalidation_packet_handler.cc +++ b/chrome/browser/sync/notifier/cache_invalidation_packet_handler.cc @@ -10,7 +10,8 @@ #include "base/callback.h" #include "base/logging.h" #include "base/rand_util.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" +//#include "base/string_util.h" #include "chrome/browser/sync/sync_constants.h" #include "google/cacheinvalidation/invalidation-client.h" #include "jingle/notifier/listener/xml_element_util.h" @@ -170,7 +171,7 @@ class CacheInvalidationSendMessageTask : public buzz::XmppTask { buzz::XmlElement* cache_invalidation_iq_packet = new buzz::XmlElement(kQnData, true); iq->AddElement(cache_invalidation_iq_packet); - cache_invalidation_iq_packet->SetAttr(kQnSeq, IntToString(seq)); + cache_invalidation_iq_packet->SetAttr(kQnSeq, base::IntToString(seq)); cache_invalidation_iq_packet->SetAttr(kQnSid, sid); cache_invalidation_iq_packet->SetAttr(kQnServiceUrl, browser_sync::kSyncServiceUrl); @@ -188,7 +189,7 @@ class CacheInvalidationSendMessageTask : public buzz::XmppTask { std::string MakeSid() { uint64 sid = base::RandUint64(); - return std::string("chrome-sync-") + Uint64ToString(sid); + return std::string("chrome-sync-") + base::Uint64ToString(sid); } } // namespace diff --git a/chrome/browser/sync/syncable/directory_backing_store.cc b/chrome/browser/sync/syncable/directory_backing_store.cc index c5bfdb0..8cec2a9 100644 --- a/chrome/browser/sync/syncable/directory_backing_store.cc +++ b/chrome/browser/sync/syncable/directory_backing_store.cc @@ -16,6 +16,7 @@ #include "base/hash_tables.h" #include "base/logging.h" #include "base/stl_util-inl.h" +#include "base/string_number_conversions.h" #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" #include "chrome/browser/sync/protocol/service_constants.h" #include "chrome/browser/sync/protocol/sync.pb.h" @@ -286,7 +287,7 @@ bool DirectoryBackingStore::DeleteEntries(const MetahandleSet& handles) { ++it) { if (it != handles.begin()) query.append(","); - query.append(Int64ToString(*it)); + query.append(base::Int64ToString(*it)); } query.append(")"); SQLStatement statement; diff --git a/chrome/browser/sync/syncable/syncable.cc b/chrome/browser/sync/syncable/syncable.cc index cf19379..807abf6 100644 --- a/chrome/browser/sync/syncable/syncable.cc +++ b/chrome/browser/sync/syncable/syncable.cc @@ -31,7 +31,7 @@ #include "base/logging.h" #include "base/perftimer.h" #include "base/scoped_ptr.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/stl_util-inl.h" #include "base/time.h" #include "chrome/browser/sync/engine/syncer.h" @@ -1441,7 +1441,7 @@ Id Directory::NextId() { kernel_->info_status = KERNEL_SHARE_INFO_DIRTY; } DCHECK_LT(result, 0); - return Id::CreateFromClientString(Int64ToString(result)); + return Id::CreateFromClientString(base::Int64ToString(result)); } Id Directory::GetChildWithNullIdField(IdField field, diff --git a/chrome/browser/sync/util/fast_dump.h b/chrome/browser/sync/util/fast_dump.h index a9eff24..28d1484 100644 --- a/chrome/browser/sync/util/fast_dump.h +++ b/chrome/browser/sync/util/fast_dump.h @@ -10,7 +10,7 @@ #include <streambuf> #include <string> -#include "base/string_util.h" +#include "base/string_number_conversions.h" using std::ostream; using std::streambuf; @@ -32,7 +32,7 @@ class FastDump { inline browser_sync::FastDump& operator << (browser_sync::FastDump& dump, int64 n) { - string numbuf(Int64ToString(n)); + string numbuf(base::Int64ToString(n)); const char* number = numbuf.c_str(); dump.out_->sputn(number, numbuf.length()); return dump; @@ -40,7 +40,7 @@ inline browser_sync::FastDump& operator << inline browser_sync::FastDump& operator << (browser_sync::FastDump& dump, int32 n) { - string numbuf(IntToString(n)); + string numbuf(base::IntToString(n)); const char* number = numbuf.c_str(); dump.out_->sputn(number, numbuf.length()); return dump; diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc index c864f27..c885d5f 100644 --- a/chrome/browser/tabs/tab_strip_model_unittest.cc +++ b/chrome/browser/tabs/tab_strip_model_unittest.cc @@ -148,7 +148,7 @@ class TabStripModelTest : public RenderViewHostTestHarness { if (i > 0) actual += " "; - actual += IntToString(GetID(model.GetTabContentsAt(i))); + actual += base::IntToString(GetID(model.GetTabContentsAt(i))); if (model.IsAppTab(i)) actual += "a"; @@ -171,7 +171,7 @@ class TabStripModelTest : public RenderViewHostTestHarness { for (size_t i = 0; i < indices.size(); ++i) { if (i != 0) result += " "; - result += IntToString(indices[i]); + result += base::IntToString(indices[i]); } return result; } diff --git a/chrome/browser/views/autofill_profiles_view_win.cc b/chrome/browser/views/autofill_profiles_view_win.cc index 1e53a9a..ffd477e 100644 --- a/chrome/browser/views/autofill_profiles_view_win.cc +++ b/chrome/browser/views/autofill_profiles_view_win.cc @@ -1,6 +1,7 @@ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. + #include "chrome/browser/views/autofill_profiles_view_win.h" #include <vsstyle.h> @@ -9,7 +10,7 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "base/message_loop.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/time.h" #include "chrome/browser/autofill/autofill_manager.h" #include "chrome/browser/autofill/phone_number.h" @@ -877,7 +878,7 @@ void AutoFillProfilesView::EditableSetViewContents::ItemChanged( } else { DCHECK(new_index < static_cast<int>(observer_->profiles_set_.size())); temporary_info_.credit_card.set_billing_address( - IntToString16( + base::IntToString16( observer_->profiles_set_[new_index].address.unique_id())); } } else if (combo_box == combo_box_month_) { diff --git a/chrome/browser/views/bookmark_bar_view_test.cc b/chrome/browser/views/bookmark_bar_view_test.cc index 5c4c722..454c194 100644 --- a/chrome/browser/views/bookmark_bar_view_test.cc +++ b/chrome/browser/views/bookmark_bar_view_test.cc @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "base/keyboard_codes.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/automation/ui_controls.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_utils.h" @@ -221,8 +221,8 @@ class BookmarkBarViewEventTestBase : public ViewEventTestBase { model_->AddURL(f11, 0, L"f11a", GURL(test_base + "f11a")); if (big_menu) { for (int i = 1; i <= 100; ++i) { - model_->AddURL(f1, i + 1, L"f" + IntToWString(i), - GURL(test_base + "f" + IntToString(i))); + model_->AddURL(f1, i + 1, L"f" + UTF8ToWide(base::IntToString(i)), + GURL(test_base + "f" + base::IntToString(i))); } } model_->AddURL(model_->GetBookmarkBarNode(), 1, L"a", diff --git a/chrome/browser/webdata/web_database_unittest.cc b/chrome/browser/webdata/web_database_unittest.cc index ce13dbf..59a2cfa6 100644 --- a/chrome/browser/webdata/web_database_unittest.cc +++ b/chrome/browser/webdata/web_database_unittest.cc @@ -12,7 +12,7 @@ #include "base/file_util.h" #include "base/path_service.h" #include "base/stl_util-inl.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/string16.h" #include "base/time.h" #include "base/values.h" @@ -100,7 +100,7 @@ class WebDatabaseTest : public testing::Test { #endif PathService::Get(chrome::DIR_TEST_DATA, &file_); const std::string test_db = "TestWebDatabase" + - Int64ToString(base::Time::Now().ToInternalValue()) + + base::Int64ToString(base::Time::Now().ToInternalValue()) + ".db"; file_ = file_.AppendASCII(test_db); file_util::Delete(file_, false); diff --git a/chrome/browser/wrench_menu_model.cc b/chrome/browser/wrench_menu_model.cc index 27d8e09..367b700 100644 --- a/chrome/browser/wrench_menu_model.cc +++ b/chrome/browser/wrench_menu_model.cc @@ -10,6 +10,7 @@ #include "app/l10n_util.h" #include "app/menus/button_menu_item_model.h" #include "app/resource_bundle.h" +#include "base/string_number_conversions.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_process.h" @@ -354,7 +355,7 @@ void WrenchMenuModel::UpdateZoomControls() { int zoom_percent = static_cast<int>(GetZoom(&enable_increment, &enable_decrement) * 100); zoom_label_ = l10n_util::GetStringFUTF16( - IDS_ZOOM_PERCENT, IntToString16(zoom_percent)); + IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); } double WrenchMenuModel::GetZoom(bool* enable_increment, diff --git a/chrome/browser/zygote_host_linux.cc b/chrome/browser/zygote_host_linux.cc index 5c58d6c..75987a4 100644 --- a/chrome/browser/zygote_host_linux.cc +++ b/chrome/browser/zygote_host_linux.cc @@ -16,6 +16,7 @@ #include "base/path_service.h" #include "base/pickle.h" #include "base/process_util.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/unix_domain_socket_posix.h" @@ -156,7 +157,7 @@ void ZygoteHost::Init(const std::string& sandbox_cmd) { std::vector<std::string> get_inode_cmdline; get_inode_cmdline.push_back(sandbox_binary_); get_inode_cmdline.push_back(base::kFindInodeSwitch); - get_inode_cmdline.push_back(Int64ToString(inode)); + get_inode_cmdline.push_back(base::Int64ToString(inode)); CommandLine get_inode_cmd(get_inode_cmdline); if (base::GetAppOutput(get_inode_cmd, &inode_output)) { StringToInt(inode_output, &pid_); @@ -272,8 +273,8 @@ pid_t ZygoteHost::ForkRenderer( adj_oom_score_cmdline.push_back(sandbox_binary_); adj_oom_score_cmdline.push_back(base::kAdjustOOMScoreSwitch); - adj_oom_score_cmdline.push_back(Int64ToString(pid)); - adj_oom_score_cmdline.push_back(IntToString(kRendererScore)); + adj_oom_score_cmdline.push_back(base::Int64ToString(pid)); + adj_oom_score_cmdline.push_back(base::IntToString(kRendererScore)); CommandLine adj_oom_score_cmd(adj_oom_score_cmdline); if (base::LaunchApp(adj_oom_score_cmdline, dummy_map, false, &sandbox_helper_process)) { diff --git a/chrome/common/child_process.cc b/chrome/common/child_process.cc index 71d025a..e64f0f3 100644 --- a/chrome/common/child_process.cc +++ b/chrome/common/child_process.cc @@ -11,8 +11,9 @@ #include "app/l10n_util.h" #include "base/message_loop.h" #include "base/process_util.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/thread.h" +#include "base/utf_string_conversions.h" #include "chrome/common/child_thread.h" #include "grit/chromium_strings.h" @@ -76,7 +77,7 @@ void ChildProcess::WaitForDebugger(const std::wstring& label) { std::wstring title = l10n_util::GetString(IDS_PRODUCT_NAME); std::wstring message = label; message += L" starting with pid: "; - message += IntToWString(base::GetCurrentProcId()); + message += UTF8ToWide(base::IntToString(base::GetCurrentProcId())); title += L" "; title += label; // makes attaching to process easier ::MessageBox(NULL, message.c_str(), title.c_str(), diff --git a/chrome/common/child_process_logging_mac.mm b/chrome/common/child_process_logging_mac.mm index f0356cd..a53b4ed 100644 --- a/chrome/common/child_process_logging_mac.mm +++ b/chrome/common/child_process_logging_mac.mm @@ -6,7 +6,9 @@ #import <Foundation/Foundation.h> +#include "base/string_number_conversions.h" #include "base/string_util.h" +#include "base/utf_string_conversions.h" #include "chrome/common/gpu_info.h" #include "chrome/installer/util/google_update_settings.h" #include "googleurl/src/gurl.h" @@ -112,19 +114,19 @@ void SetGpuKeyValue(const char* param_name, const std::string& value_str, void SetGpuInfoImpl(const GPUInfo& gpu_info, SetCrashKeyValueFuncPtr set_key_func) { SetGpuKeyValue(kGPUVendorIdParamName, - UintToString(gpu_info.vendor_id()), + base::UintToString(gpu_info.vendor_id()), set_key_func); SetGpuKeyValue(kGPUDeviceIdParamName, - UintToString(gpu_info.device_id()), + base::UintToString(gpu_info.device_id()), set_key_func); SetGpuKeyValue(kGPUDriverVersionParamName, - WideToASCII(gpu_info.driver_version()), + WideToUTF8(gpu_info.driver_version()), set_key_func); SetGpuKeyValue(kGPUPixelShaderVersionParamName, - UintToString(gpu_info.pixel_shader_version()), + base::UintToString(gpu_info.pixel_shader_version()), set_key_func); SetGpuKeyValue(kGPUVertexShaderVersionParamName, - UintToString(gpu_info.vertex_shader_version()), + base::UintToString(gpu_info.vertex_shader_version()), set_key_func); } diff --git a/chrome/common/child_process_logging_win.cc b/chrome/common/child_process_logging_win.cc index 1b18e6e..f5ffd84 100644 --- a/chrome/common/child_process_logging_win.cc +++ b/chrome/common/child_process_logging_win.cc @@ -7,6 +7,7 @@ #include <windows.h> #include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/common/chrome_constants.h" #include "chrome/installer/util/google_update_settings.h" @@ -105,11 +106,12 @@ void SetGpuInfo(const GPUInfo& gpu_info) { if (!set_gpu_info) return; } - (set_gpu_info)(UintToWString(gpu_info.vendor_id()).c_str(), - UintToWString(gpu_info.device_id()).c_str(), - gpu_info.driver_version().c_str(), - UintToWString(gpu_info.pixel_shader_version()).c_str(), - UintToWString(gpu_info.vertex_shader_version()).c_str()); + (set_gpu_info)( + base::UintToString16(gpu_info.vendor_id()).c_str(), + base::UintToString16(gpu_info.device_id()).c_str(), + gpu_info.driver_version().c_str(), + base::UintToString16(gpu_info.pixel_shader_version()).c_str(), + base::UintToString16(gpu_info.vertex_shader_version()).c_str()); } } // namespace child_process_logging diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index 9db8117..d32ef66 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -18,6 +18,7 @@ #include "base/stl_util-inl.h" #include "base/third_party/nss/blapi.h" #include "base/third_party/nss/sha256.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h" @@ -61,8 +62,13 @@ const int kRSAKeySize = 1024; // completely numeric host, since some software interprets that as an IP // address. static void ConvertHexadecimalToIDAlphabet(std::string* id) { - for (size_t i = 0; i < id->size(); ++i) - (*id)[i] = HexStringToInt(id->substr(i, 1)) + 'a'; + for (size_t i = 0; i < id->size(); ++i) { + int val; + if (base::HexStringToInt(id->substr(i, 1), &val)) + (*id)[i] = val + 'a'; + else + (*id)[i] = 'a'; + } } const int kValidWebExtentSchemes = @@ -221,7 +227,7 @@ bool Extension::LoadUserScriptHelper(const DictionaryValue* content_script, std::string run_location; if (!content_script->GetString(keys::kRunAt, &run_location)) { *error = ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidRunAt, - IntToString(definition_index)); + base::IntToString(definition_index)); return false; } @@ -233,7 +239,7 @@ bool Extension::LoadUserScriptHelper(const DictionaryValue* content_script, result->set_run_location(UserScript::DOCUMENT_IDLE); } else { *error = ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidRunAt, - IntToString(definition_index)); + base::IntToString(definition_index)); return false; } } @@ -243,7 +249,7 @@ bool Extension::LoadUserScriptHelper(const DictionaryValue* content_script, bool all_frames = false; if (!content_script->GetBoolean(keys::kAllFrames, &all_frames)) { *error = ExtensionErrorUtils::FormatErrorMessage( - errors::kInvalidAllFrames, IntToString(definition_index)); + errors::kInvalidAllFrames, base::IntToString(definition_index)); return false; } result->set_match_all_frames(all_frames); @@ -253,27 +259,27 @@ bool Extension::LoadUserScriptHelper(const DictionaryValue* content_script, ListValue* matches = NULL; if (!content_script->GetList(keys::kMatches, &matches)) { *error = ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidMatches, - IntToString(definition_index)); + base::IntToString(definition_index)); return false; } if (matches->GetSize() == 0) { *error = ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidMatchCount, - IntToString(definition_index)); + base::IntToString(definition_index)); return false; } for (size_t j = 0; j < matches->GetSize(); ++j) { std::string match_str; if (!matches->GetString(j, &match_str)) { *error = ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidMatch, - IntToString(definition_index), IntToString(j)); + base::IntToString(definition_index), base::IntToString(j)); return false; } URLPattern pattern(UserScript::kValidUserScriptSchemes); if (!pattern.Parse(match_str)) { *error = ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidMatch, - IntToString(definition_index), IntToString(j)); + base::IntToString(definition_index), base::IntToString(j)); return false; } @@ -296,7 +302,7 @@ bool Extension::LoadUserScriptHelper(const DictionaryValue* content_script, if (content_script->HasKey(keys::kJs) && !content_script->GetList(keys::kJs, &js)) { *error = ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidJsList, - IntToString(definition_index)); + base::IntToString(definition_index)); return false; } @@ -304,14 +310,14 @@ bool Extension::LoadUserScriptHelper(const DictionaryValue* content_script, if (content_script->HasKey(keys::kCss) && !content_script->GetList(keys::kCss, &css)) { *error = ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidCssList, - IntToString(definition_index)); + base::IntToString(definition_index)); return false; } // The manifest needs to have at least one js or css user script definition. if (((js ? js->GetSize() : 0) + (css ? css->GetSize() : 0)) == 0) { *error = ExtensionErrorUtils::FormatErrorMessage(errors::kMissingFile, - IntToString(definition_index)); + base::IntToString(definition_index)); return false; } @@ -322,7 +328,8 @@ bool Extension::LoadUserScriptHelper(const DictionaryValue* content_script, std::string relative; if (!js->Get(script_index, &value) || !value->GetAsString(&relative)) { *error = ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidJs, - IntToString(definition_index), IntToString(script_index)); + base::IntToString(definition_index), + base::IntToString(script_index)); return false; } GURL url = GetResourceURL(relative); @@ -339,7 +346,8 @@ bool Extension::LoadUserScriptHelper(const DictionaryValue* content_script, std::string relative; if (!css->Get(script_index, &value) || !value->GetAsString(&relative)) { *error = ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidCss, - IntToString(definition_index), IntToString(script_index)); + base::IntToString(definition_index), + base::IntToString(script_index)); return false; } GURL url = GetResourceURL(relative); @@ -365,7 +373,8 @@ bool Extension::LoadGlobsHelper( ListValue* list = NULL; if (!content_script->GetList(globs_property_name, &list)) { *error = ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidGlobList, - IntToString(content_script_index), WideToASCII(globs_property_name)); + base::IntToString(content_script_index), + WideToUTF8(globs_property_name)); return false; } @@ -373,8 +382,9 @@ bool Extension::LoadGlobsHelper( std::string glob; if (!list->GetString(i, &glob)) { *error = ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidGlob, - IntToString(content_script_index), WideToASCII(globs_property_name), - IntToString(i)); + base::IntToString(content_script_index), + WideToUTF8(globs_property_name), + base::IntToString(i)); return false; } @@ -558,14 +568,14 @@ bool Extension::LoadExtent(const DictionaryValue* manifest, std::string pattern_string; if (!pattern_list->GetString(i, &pattern_string)) { *error = ExtensionErrorUtils::FormatErrorMessage(value_error, - UintToString(i)); + base::UintToString(i)); return false; } URLPattern pattern(kValidWebExtentSchemes); if (!pattern.Parse(pattern_string)) { *error = ExtensionErrorUtils::FormatErrorMessage(value_error, - UintToString(i)); + base::UintToString(i)); return false; } @@ -573,7 +583,7 @@ bool Extension::LoadExtent(const DictionaryValue* manifest, // imply one at the end. if (pattern.path().find('*') != std::string::npos) { *error = ExtensionErrorUtils::FormatErrorMessage(value_error, - UintToString(i)); + base::UintToString(i)); return false; } pattern.set_path(pattern.path() + '*'); @@ -925,8 +935,8 @@ void Extension::DecodeIconFromPath(const FilePath& icon_path, if (decoded->width() != icon_size || decoded->height() != icon_size) { LOG(ERROR) << "Icon file has unexpected size: " - << IntToString(decoded->width()) << "x" - << IntToString(decoded->height()); + << base::IntToString(decoded->width()) << "x" + << base::IntToString(decoded->height()); return; } @@ -1074,7 +1084,7 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key, } for (size_t i = 0; i < arraysize(kIconSizes); ++i) { - std::wstring key = ASCIIToWide(IntToString(kIconSizes[i])); + std::wstring key = ASCIIToWide(base::IntToString(kIconSizes[i])); if (icons_value->HasKey(key)) { std::string icon_path; if (!icons_value->GetString(key, &icon_path)) { @@ -1199,7 +1209,7 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key, // Get plugins[i].path. if (!plugin_value->GetString(keys::kPluginsPath, &path)) { *error = ExtensionErrorUtils::FormatErrorMessage( - errors::kInvalidPluginsPath, IntToString(i)); + errors::kInvalidPluginsPath, base::IntToString(i)); return false; } @@ -1207,7 +1217,7 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key, if (plugin_value->HasKey(keys::kPluginsPublic)) { if (!plugin_value->GetBoolean(keys::kPluginsPublic, &is_public)) { *error = ExtensionErrorUtils::FormatErrorMessage( - errors::kInvalidPluginsPublic, IntToString(i)); + errors::kInvalidPluginsPublic, base::IntToString(i)); return false; } } @@ -1260,7 +1270,7 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key, if (!toolstrip_value->GetString(keys::kToolstripPath, &toolstrip_path)) { *error = ExtensionErrorUtils::FormatErrorMessage( - errors::kInvalidToolstrip, IntToString(i)); + errors::kInvalidToolstrip, base::IntToString(i)); return false; } toolstrip.toolstrip = GetResourceURL(toolstrip_path); @@ -1269,14 +1279,14 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key, if (!toolstrip_value->GetString(keys::kToolstripMolePath, &mole_path)) { *error = ExtensionErrorUtils::FormatErrorMessage( - errors::kInvalidToolstrip, IntToString(i)); + errors::kInvalidToolstrip, base::IntToString(i)); return false; } int height; if (!toolstrip_value->GetInteger(keys::kToolstripMoleHeight, &height) || (height < 0)) { *error = ExtensionErrorUtils::FormatErrorMessage( - errors::kInvalidToolstrip, IntToString(i)); + errors::kInvalidToolstrip, base::IntToString(i)); return false; } toolstrip.mole = GetResourceURL(mole_path); @@ -1284,7 +1294,7 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key, } } else { *error = ExtensionErrorUtils::FormatErrorMessage( - errors::kInvalidToolstrip, IntToString(i)); + errors::kInvalidToolstrip, base::IntToString(i)); return false; } toolstrips_.push_back(toolstrip); @@ -1303,7 +1313,7 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key, DictionaryValue* content_script; if (!list_value->GetDictionary(i, &content_script)) { *error = ExtensionErrorUtils::FormatErrorMessage( - errors::kInvalidContentScript, IntToString(i)); + errors::kInvalidContentScript, base::IntToString(i)); return false; } @@ -1391,7 +1401,7 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key, std::string permission_str; if (!permissions->GetString(i, &permission_str)) { *error = ExtensionErrorUtils::FormatErrorMessage( - errors::kInvalidPermission, IntToString(i)); + errors::kInvalidPermission, base::IntToString(i)); return false; } @@ -1407,13 +1417,13 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key, URLPattern::SCHEME_CHROMEUI); if (!pattern.Parse(permission_str)) { *error = ExtensionErrorUtils::FormatErrorMessage( - errors::kInvalidPermission, IntToString(i)); + errors::kInvalidPermission, base::IntToString(i)); return false; } if (!CanAccessURL(pattern)) { *error = ExtensionErrorUtils::FormatErrorMessage( - errors::kInvalidPermissionScheme, IntToString(i)); + errors::kInvalidPermissionScheme, base::IntToString(i)); return false; } @@ -1579,7 +1589,8 @@ void Extension::SetBackgroundPageReady() { } static std::string SizeToString(const gfx::Size& max_size) { - return IntToString(max_size.width()) + "x" + IntToString(max_size.height()); + return base::IntToString(max_size.width()) + "x" + + base::IntToString(max_size.height()); } void Extension::SetCachedImage(const ExtensionResource& source, diff --git a/chrome/common/extensions/update_manifest.cc b/chrome/common/extensions/update_manifest.cc index 4394a7b..ec8b444 100644 --- a/chrome/common/extensions/update_manifest.cc +++ b/chrome/common/extensions/update_manifest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,6 +8,7 @@ #include "base/stl_util-inl.h" #include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/values.h" #include "base/version.h" #include "chrome/common/libxml_utils.h" @@ -237,7 +238,7 @@ bool UpdateManifest::Parse(const std::string& manifest_xml) { xmlNode* first = daystarts[0]; std::string elapsed_seconds = GetAttribute(first, "elapsed_seconds"); int parsed_elapsed = kNoDaystart; - if (StringToInt(elapsed_seconds, &parsed_elapsed)) { + if (base::StringToInt(elapsed_seconds, &parsed_elapsed)) { results_.daystart_elapsed_seconds = parsed_elapsed; } } diff --git a/chrome/common/important_file_writer.cc b/chrome/common/important_file_writer.cc index 3466958..adda9fd 100644 --- a/chrome/common/important_file_writer.cc +++ b/chrome/common/important_file_writer.cc @@ -13,7 +13,7 @@ #include "base/file_util.h" #include "base/logging.h" #include "base/message_loop_proxy.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/task.h" #include "base/thread.h" #include "base/time.h" @@ -52,8 +52,8 @@ class WriteToDiskTask : public Task { } if (bytes_written < data_.length()) { file_util::Delete(tmp_file_path, false); - LogFailure("error writing, bytes_written=" + UintToString( - static_cast<unsigned int>(bytes_written))); + LogFailure("error writing, bytes_written=" + + base::Uint64ToString(bytes_written)); return; } diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc index 9591170..b93ca60 100644 --- a/chrome/common/logging_chrome.cc +++ b/chrome/common/logging_chrome.cc @@ -38,6 +38,7 @@ #include "base/file_util.h" #include "base/logging.h" #include "base/path_service.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/time.h" #include "base/utf_string_conversions.h" @@ -210,7 +211,7 @@ void InitChromeLogging(const CommandLine& command_line, std::string log_level = command_line.GetSwitchValueASCII( switches::kLoggingLevel); int level = 0; - if (StringToInt(log_level, &level)) { + if (base::StringToInt(log_level, &level)) { if ((level >= 0) && (level < LOG_NUM_SEVERITIES)) logging::SetMinLogLevel(level); } else { diff --git a/chrome/common/metrics_helpers.cc b/chrome/common/metrics_helpers.cc index 3bbaf3b..ee465e4 100644 --- a/chrome/common/metrics_helpers.cc +++ b/chrome/common/metrics_helpers.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -17,7 +17,8 @@ #include "base/md5.h" #include "base/perftimer.h" #include "base/scoped_ptr.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" +#include "base/string_util.h" // TODO(brettw) remove when ASCIIToUTF16 moves. #include "base/sys_info.h" #include "base/utf_string_conversions.h" #include "base/third_party/nspr/prtime.h" @@ -100,7 +101,7 @@ MetricsLogBase::MetricsLogBase(const std::string& client_id, int session_id, const std::string& version_string) : start_time_(Time::Now()), client_id_(client_id), - session_id_(IntToString(session_id)), + session_id_(base::IntToString(session_id)), locked_(false), xml_wrapper_(new XmlWrapper), num_events_(0) { @@ -238,7 +239,7 @@ void MetricsLogBase::RecordLoadEvent(int window_id, WriteAttribute("action", "load"); WriteIntAttribute("docid", session_index); WriteIntAttribute("window", window_id); - WriteAttribute("loadtime", Int64ToString(load_time.InMilliseconds())); + WriteAttribute("loadtime", base::Int64ToString(load_time.InMilliseconds())); std::string origin_string; @@ -295,16 +296,16 @@ void MetricsLogBase::RecordWindowEvent(WindowEventType type, OPEN_ELEMENT_FOR_SCOPE("window"); WriteAttribute("action", WindowEventTypeToString(type)); - WriteAttribute("windowid", IntToString(window_id)); + WriteAttribute("windowid", base::IntToString(window_id)); if (parent_id >= 0) - WriteAttribute("parent", IntToString(parent_id)); + WriteAttribute("parent", base::IntToString(parent_id)); WriteCommonEventAttributes(); ++num_events_; } std::string MetricsLogBase::GetCurrentTimeString() { - return Uint64ToString(Time::Now().ToTimeT()); + return base::Uint64ToString(Time::Now().ToTimeT()); } // These are the attributes that are common to every event. @@ -325,11 +326,11 @@ void MetricsLogBase::WriteAttribute(const std::string& name, } void MetricsLogBase::WriteIntAttribute(const std::string& name, int value) { - WriteAttribute(name, IntToString(value)); + WriteAttribute(name, base::IntToString(value)); } void MetricsLogBase::WriteInt64Attribute(const std::string& name, int64 value) { - WriteAttribute(name, Int64ToString(value)); + WriteAttribute(name, base::Int64ToString(value)); } // static diff --git a/chrome/common/plugin_messages.h b/chrome/common/plugin_messages.h index 315a5d3..3cf8739 100644 --- a/chrome/common/plugin_messages.h +++ b/chrome/common/plugin_messages.h @@ -15,6 +15,8 @@ #include <vector> #include "base/basictypes.h" +#include "base/string_number_conversions.h" +#include "base/utf_string_conversions.h" #include "chrome/common/common_param_traits.h" #include "chrome/common/webkit_param_traits.h" #include "gfx/native_widget_types.h" @@ -304,8 +306,8 @@ struct ParamTraits<NPIdentifier_Param> { l->append(UTF8ToWide(str)); NPN_MemFree(str); } else { - l->append(IntToWString( - WebKit::WebBindings::intFromIdentifier(p.identifier))); + l->append(UTF8ToWide(base::IntToString( + WebKit::WebBindings::intFromIdentifier(p.identifier)))); } } }; diff --git a/chrome/test/automation/autocomplete_edit_proxy.h b/chrome/test/automation/autocomplete_edit_proxy.h index 5dcf8af..7f5aa90 100644 --- a/chrome/test/automation/autocomplete_edit_proxy.h +++ b/chrome/test/automation/autocomplete_edit_proxy.h @@ -91,13 +91,13 @@ struct ParamTraits<AutocompleteMatchData> { l->append(L"["); l->append(UTF8ToWide(p.provider_name)); l->append(L" "); - l->append(IntToWString(p.relevance)); + l->append(UTF8ToWide(base::IntToString(p.relevance))); l->append(L" "); l->append(p.deletable ? L"true" : L"false"); l->append(L" "); l->append(p.fill_into_edit); l->append(L" "); - l->append(IntToWString(p.inline_autocomplete_offset)); + l->append(UTF8ToWide(base::IntToString(p.inline_autocomplete_offset))); l->append(L" "); l->append(UTF8ToWide(p.destination_url.spec())); l->append(L" "); diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc index 8c37bc5..5d7e2be 100644 --- a/chrome/test/in_process_browser_test.cc +++ b/chrome/test/in_process_browser_test.cc @@ -9,6 +9,7 @@ #include "base/file_util.h" #include "base/path_service.h" #include "base/scoped_nsautorelease_pool.h" +#include "base/string_number_conversions.h" #include "base/test/test_file_util.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" @@ -330,7 +331,7 @@ void InProcessBrowserTest::QuitBrowsers() { void InProcessBrowserTest::TimedOut() { std::string error_message = "Test timed out. Each test runs for a max of "; - error_message += IntToString(initial_timeout_); + error_message += base::IntToString(initial_timeout_); error_message += " ms (kInitialTimeoutInMS)."; GTEST_NONFATAL_FAILURE_(error_message.c_str()); diff --git a/chrome/test/interactive_ui/view_event_test_base.cc b/chrome/test/interactive_ui/view_event_test_base.cc index 8936d57..476445f 100644 --- a/chrome/test/interactive_ui/view_event_test_base.cc +++ b/chrome/test/interactive_ui/view_event_test_base.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,7 +10,7 @@ #include "base/compiler_specific.h" #include "base/message_loop.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/automation/ui_controls.h" #include "chrome/test/ui_test_utils.h" #include "views/view.h" @@ -165,7 +165,7 @@ void ViewEventTestBase::RunTestMethod(Task* task) { void ViewEventTestBase::TimedOut() { std::string error_message = "Test timed out. Each test runs for a max of "; - error_message += IntToString(kTimeoutInMS); + error_message += base::IntToString(kTimeoutInMS); error_message += " ms (kTimeoutInMS)."; GTEST_NONFATAL_FAILURE_(error_message.c_str()); diff --git a/chrome/test/page_cycler/page_cycler_test.cc b/chrome/test/page_cycler/page_cycler_test.cc index 276c446..a980139 100644 --- a/chrome/test/page_cycler/page_cycler_test.cc +++ b/chrome/test/page_cycler/page_cycler_test.cc @@ -8,7 +8,7 @@ #include "base/file_util.h" #include "base/path_service.h" #include "base/process_util.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/sys_string_conversions.h" #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/common/chrome_constants.h" @@ -215,7 +215,7 @@ class PageCyclerTest : public UITest { // run N iterations GURL::Replacements replacements; const std::string query_string = - "iterations=" + IntToString(GetTestIterations()) + "&auto=1"; + "iterations=" + base::IntToString(GetTestIterations()) + "&auto=1"; replacements.SetQuery( query_string.c_str(), url_parse::Component(0, query_string.length())); diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc index f2eba67..148eb54 100644 --- a/chrome/test/reliability/page_load_test.cc +++ b/chrome/test/reliability/page_load_test.cc @@ -627,10 +627,10 @@ void SetPageRange(const CommandLine& parsed_command_line) { if (parsed_command_line.HasSwitch(kStartPageSwitch)) { ASSERT_TRUE(parsed_command_line.HasSwitch(kEndPageSwitch)); ASSERT_TRUE( - StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( + base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( kStartPageSwitch)), &g_start_page)); ASSERT_TRUE( - StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( + base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( kEndPageSwitch)), &g_end_page)); ASSERT_TRUE(g_start_page > 0 && g_end_page > 0); ASSERT_TRUE(g_start_page < g_end_page); @@ -645,14 +645,14 @@ void SetPageRange(const CommandLine& parsed_command_line) { if (parsed_command_line.HasSwitch(kStartIndexSwitch)) { ASSERT_TRUE( - StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( + base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( kStartIndexSwitch)), &g_start_index)); ASSERT_GT(g_start_index, 0); } if (parsed_command_line.HasSwitch(kEndIndexSwitch)) { ASSERT_TRUE( - StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( + base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( kEndIndexSwitch)), &g_end_index)); ASSERT_GT(g_end_index, 0); } @@ -664,7 +664,7 @@ void SetPageRange(const CommandLine& parsed_command_line) { if (parsed_command_line.HasSwitch(kIterationSwitch)) { ASSERT_TRUE( - StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( + base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( kIterationSwitch)), &g_iterations)); ASSERT_GT(g_iterations, 0); } @@ -685,7 +685,7 @@ void SetPageRange(const CommandLine& parsed_command_line) { if (parsed_command_line.HasSwitch(kTimeoutSwitch)) { ASSERT_TRUE( - StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( + base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( kTimeoutSwitch)), &g_timeout_ms)); ASSERT_GT(g_timeout_ms, 0); } diff --git a/chrome/test/startup/startup_test.cc b/chrome/test/startup/startup_test.cc index a4ec1b9..ef25566 100644 --- a/chrome/test/startup/startup_test.cc +++ b/chrome/test/startup/startup_test.cc @@ -6,6 +6,7 @@ #include "base/file_util.h" #include "base/path_service.h" #include "base/platform_thread.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/sys_info.h" #include "base/test/test_file_util.h" @@ -226,7 +227,7 @@ class StartupTest : public UITest { if (nth_timed_tab > 0) { // Display only the time necessary to load the first n tabs. times.clear(); - name = name_base + "-" + IntToString(nth_timed_tab); + name = name_base + "-" + base::IntToString(nth_timed_tab); for (int i = 0; i < numCycles; ++i) StringAppendF(×, "%.2f,", timings[i].nth_tab_stop_ms); PrintResultList(graph, "", name.c_str(), times, "ms", important); diff --git a/chrome/test/sync/engine/test_id_factory.h b/chrome/test/sync/engine/test_id_factory.h index 70f4bba..9ae0469 100644 --- a/chrome/test/sync/engine/test_id_factory.h +++ b/chrome/test/sync/engine/test_id_factory.h @@ -10,7 +10,7 @@ #include <string> -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/sync/syncable/syncable_id.h" namespace browser_sync { @@ -33,9 +33,9 @@ class TestIdFactory { if (value == 0) return root(); else if (value < 0) - return syncable::Id::CreateFromClientString(Int64ToString(value)); + return syncable::Id::CreateFromClientString(base::Int64ToString(value)); else - return syncable::Id::CreateFromServerId(Int64ToString(value)); + return syncable::Id::CreateFromServerId(base::Int64ToString(value)); } // Create a local ID from a name. @@ -51,13 +51,13 @@ class TestIdFactory { // Autogenerate a fresh local ID. syncable::Id NewLocalId() { return syncable::Id::CreateFromClientString( - std::string("_auto ") + IntToString(-next_value())); + std::string("_auto ") + base::IntToString(-next_value())); } // Autogenerate a fresh server ID. syncable::Id NewServerId() { return syncable::Id::CreateFromServerId( - std::string("_auto ") + IntToString(next_value())); + std::string("_auto ") + base::IntToString(next_value())); } private: diff --git a/chrome/test/ui/npapi_uitest.cc b/chrome/test/ui/npapi_uitest.cc index 440faf2..253532d 100644 --- a/chrome/test/ui/npapi_uitest.cc +++ b/chrome/test/ui/npapi_uitest.cc @@ -21,6 +21,7 @@ #include "base/file_path.h" #include "base/keyboard_codes.h" +#include "base/string_number_conversions.h" #include "chrome/browser/net/url_request_mock_http_job.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/url_constants.h" @@ -54,7 +55,7 @@ TEST_F(NPAPITester, FLAKY_ManyPlugins) { for (int i = 1; i <= 15; i++) { SCOPED_TRACE(StringPrintf("Waiting for plugin #%d", i)); - ASSERT_NO_FATAL_FAILURE(WaitForFinish("arguments", IntToString(i), + ASSERT_NO_FATAL_FAILURE(WaitForFinish("arguments", base::IntToString(i), url, kTestCompleteCookie, kTestCompleteSuccess, action_max_timeout_ms())); diff --git a/chrome/test/ui/ui_layout_test.cc b/chrome/test/ui/ui_layout_test.cc index 6c5415f..59486f6 100644 --- a/chrome/test/ui/ui_layout_test.cc +++ b/chrome/test/ui/ui_layout_test.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,7 +6,7 @@ #include "base/file_util.h" #include "base/path_service.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/test/test_file_util.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" @@ -175,7 +175,7 @@ void UILayoutTest::RunLayoutTest(const std::string& test_case_file_name, // Creates a new cookie name. We will have to use a new cookie because // this function could be called multiple times. std::string status_cookie(kTestCompleteCookie); - status_cookie += IntToString(test_count_); + status_cookie += base::IntToString(test_count_); test_count_++; // Reads the layout test HTML file. diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index dde980e..e29c373 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -22,7 +22,7 @@ #include "base/process_util.h" #include "base/scoped_ptr.h" #include "base/scoped_temp_dir.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/test/test_file_util.h" #include "base/time.h" #include "chrome/app/chrome_dll_resource.h" @@ -738,7 +738,7 @@ DictionaryValue* UITestBase::GetLocalState() { DictionaryValue* UITestBase::GetDefaultProfilePreferences() { FilePath path; PathService::Get(chrome::DIR_USER_DATA, &path); - path = path.AppendASCII(WideToASCII(chrome::kNotSignedInProfile)); + path = path.AppendASCII(WideToUTF8(chrome::kNotSignedInProfile)); return LoadDictionaryValueFromPath(path.Append(chrome::kPreferencesFilename)); } @@ -1228,7 +1228,7 @@ void UITestBase::UpdateHistoryDates() { ASSERT_TRUE(db.Open(history)); Time yesterday = Time::Now() - TimeDelta::FromDays(1); - std::string yesterday_str = Int64ToString(yesterday.ToInternalValue()); + std::string yesterday_str = base::Int64ToString(yesterday.ToInternalValue()); std::string query = StringPrintf( "UPDATE segment_usage " "SET time_slot = %s " |