Index: app/gtk_util.cc =================================================================== --- app/gtk_util.cc (revision 54372) +++ app/gtk_util.cc (working copy) @@ -9,7 +9,7 @@ #include "app/l10n_util.h" #include "base/env_var.h" #include "base/logging.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/xdg_util.h" namespace gtk_util { @@ -22,11 +22,11 @@ double chars = 0; if (width) - StringToDouble(l10n_util::GetStringUTF8(width_chars), &chars); + base::StringToDouble(l10n_util::GetStringUTF8(width_chars), &chars); double lines = 0; if (height) - StringToDouble(l10n_util::GetStringUTF8(height_lines), &lines); + base::StringToDouble(l10n_util::GetStringUTF8(height_lines), &lines); GetWidgetSizeFromCharacters(widget, chars, lines, width, height); } Index: base/sys_info_chromeos.cc =================================================================== --- base/sys_info_chromeos.cc (revision 54372) +++ base/sys_info_chromeos.cc (working copy) @@ -7,8 +7,8 @@ #include "base/basictypes.h" #include "base/file_path.h" #include "base/file_util.h" +#include "base/string_number_conversions.h" #include "base/string_tokenizer.h" -#include "base/string_util.h" namespace base { @@ -54,12 +54,12 @@ StringTokenizer tokenizer(version, "."); for (int i = 0; i < 3 && tokenizer.GetNext(); i++) { if (0 == i) { - *major_version = StringToInt(tokenizer.token()); + StringToInt(tokenizer.token(), major_version); *minor_version = *bugfix_version = 0; } else if (1 == i) { - *minor_version = StringToInt(tokenizer.token()); + StringToInt(tokenizer.token(), minor_version); } else { // 2 == i - *bugfix_version = StringToInt(tokenizer.token()); + StringToInt(tokenizer.token(), bugfix_version); } } } Index: chrome/browser/autocomplete/autocomplete.cc =================================================================== --- chrome/browser/autocomplete/autocomplete.cc (revision 54372) +++ chrome/browser/autocomplete/autocomplete.cc (working copy) @@ -10,6 +10,7 @@ #include "base/basictypes.h" #include "base/command_line.h" #include "base/i18n/number_formatting.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "chrome/browser/autocomplete/history_contents_provider.h" #include "chrome/browser/autocomplete/history_quick_provider.h" @@ -239,7 +240,7 @@ // number. If it's just garbage after a colon, this is a query. if (parts->port.is_nonempty()) { int port; - return (StringToInt(WideToUTF16( + return (base::StringToInt(WideToUTF8( text.substr(parts->port.begin, parts->port.len)), &port) && (port >= 0) && (port <= 65535)) ? URL : QUERY; } Index: chrome/browser/autocomplete_history_manager.cc =================================================================== --- chrome/browser/autocomplete_history_manager.cc (revision 54372) +++ chrome/browser/autocomplete_history_manager.cc (working copy) @@ -7,7 +7,7 @@ #include #include "base/string16.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/autofill/credit_card.h" #include "chrome/browser/pref_service.h" #include "chrome/browser/profile.h" @@ -46,19 +46,21 @@ string16 group_string = number_string.substr(3, 2); string16 serial_string = number_string.substr(5, 4); - int area = StringToInt(area_string); + int area; + if (!base::StringToInt(area_string, &area)) + return false; if (area < 1 || area == 666 || (area > 733 && area < 750) || area > 772) return false; - int group = StringToInt(group_string); - if (group == 0) + int group; + if (!StringToInt(group_string, &group) || group == 0) return false; - int serial = StringToInt(serial_string); - if (serial == 0) + int serial; + if (!base::StringToInt(serial_string, &serial) || serial == 0) return false; return true; Index: chrome/browser/autofill/auto_fill_editor_gtk.cc =================================================================== --- chrome/browser/autofill/auto_fill_editor_gtk.cc (revision 54372) +++ chrome/browser/autofill/auto_fill_editor_gtk.cc (working copy) @@ -799,16 +799,19 @@ gtk_entry_set_text(GTK_ENTRY(number_), UTF16ToUTF8(card->ObfuscatedNumber()).c_str()); - int month = StringToInt( - UTF16ToUTF8(card->GetFieldText(AutoFillType(CREDIT_CARD_EXP_MONTH)))); + int month; + base::StringToInt(card->GetFieldText(AutoFillType(CREDIT_CARD_EXP_MONTH)), + &month); if (month >= 1 && month <= 12) { gtk_combo_box_set_active(GTK_COMBO_BOX(month_), month - 1); } else { gtk_combo_box_set_active(GTK_COMBO_BOX(month_), 0); } - int year = StringToInt(UTF16ToUTF8( - card->GetFieldText(AutoFillType(CREDIT_CARD_EXP_4_DIGIT_YEAR)))); + int year; + base::StringToInt( + card->GetFieldText(AutoFillType(CREDIT_CARD_EXP_4_DIGIT_YEAR)), + &year); if (year >= base_year_ && year < base_year_ + kNumYears) gtk_combo_box_set_active(GTK_COMBO_BOX(year_), year - base_year_); else Index: chrome/browser/autofill/autofill_field.cc =================================================================== --- chrome/browser/autofill/autofill_field.cc (revision 54372) +++ chrome/browser/autofill/autofill_field.cc (working copy) @@ -6,7 +6,7 @@ #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" namespace { @@ -20,7 +20,7 @@ ((hash_bin[2] & 0xFF) << 8) | (hash_bin[3] & 0xFF); - return UintToString(hash32); + return base::UintToString(hash32); } } // namespace Index: chrome/browser/autofill/form_structure.cc =================================================================== --- chrome/browser/autofill/form_structure.cc (revision 54372) +++ chrome/browser/autofill/form_structure.cc (working copy) @@ -52,7 +52,7 @@ (((static_cast(hash_bin[6])) & 0xFF) << 8) | ((static_cast(hash_bin[7])) & 0xFF); - return Uint64ToString(hash64); + return base::Uint64ToString(hash64); } } // namespace @@ -429,7 +429,7 @@ field_element->SetAttr(buzz::QName(kAttributeSignature), field->FieldSignature()); field_element->SetAttr(buzz::QName(kAttributeAutoFillType), - IntToString(*type)); + base::IntToString(*type)); encompassing_xml_element->AddElement(field_element); } } else { Index: chrome/browser/autofill/personal_data_manager.cc =================================================================== --- chrome/browser/autofill/personal_data_manager.cc (revision 54372) +++ chrome/browser/autofill/personal_data_manager.cc (working copy) @@ -8,6 +8,7 @@ #include #include "base/logging.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/autofill/autofill_manager.h" #include "chrome/browser/autofill/autofill_field.h" @@ -578,7 +579,7 @@ // has an implicit index of 1. for (size_t i = 1; i < iter->second.size(); ++i) { string16 newlabel = iter->second[i]->Label() + - UintToString16(static_cast(i + 1)); + base::UintToString16(static_cast(i + 1)); iter->second[i]->set_label(newlabel); } } @@ -600,7 +601,7 @@ // has an implicit index of 1. for (size_t i = 1; i < iter->second.size(); ++i) { string16 newlabel = iter->second[i]->Label() + - UintToString16(static_cast(i + 1)); + base::UintToString16(static_cast(i + 1)); iter->second[i]->set_label(newlabel); } } Index: chrome/browser/autofill/select_control_handler.cc =================================================================== --- chrome/browser/autofill/select_control_handler.cc (revision 54372) +++ chrome/browser/autofill/select_control_handler.cc (working copy) @@ -8,7 +8,7 @@ #include "base/basictypes.h" #include "base/logging.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/string16.h" #include "chrome/browser/autofill/form_group.h" #include "webkit/glue/form_field.h" @@ -459,7 +459,7 @@ return true; int index = 0; - if (!StringToInt(value, &index) || + if (!base::StringToInt(value, &index) || index <= 0 || static_cast(index) >= arraysize(kMonthsFull)) return false; Index: chrome/browser/bookmarks/bookmark_codec.cc =================================================================== --- chrome/browser/bookmarks/bookmark_codec.cc (revision 54372) +++ chrome/browser/bookmarks/bookmark_codec.cc (working copy) @@ -193,7 +193,7 @@ int64 id = 0; if (ids_valid_) { if (!value.GetString(kIdKey, &id_string) || - !StringToInt64(id_string, &id) || + !base::StringToInt64(id_string, &id) || ids_.count(id) != 0) { ids_valid_ = false; } else { @@ -209,8 +209,9 @@ std::string date_added_string; if (!value.GetString(kDateAddedKey, &date_added_string)) date_added_string = base::Int64ToString(Time::Now().ToInternalValue()); - base::Time date_added = base::Time::FromInternalValue( - StringToInt64(date_added_string)); + int64 internal_time; + base::StringToInt64(date_added_string, &internal_time); + base::Time date_added = base::Time::FromInternalValue(internal_time); #if !defined(OS_WIN) // We changed the epoch for dates on Mac & Linux from 1970 to the Windows // one of 1601. We assume any number we encounter from before 1970 is using @@ -267,8 +268,9 @@ } node->set_type(BookmarkNode::FOLDER); - node->set_date_group_modified(Time::FromInternalValue( - StringToInt64(last_modified_date))); + int64 internal_time; + base::StringToInt64(last_modified_date, &internal_time); + node->set_date_group_modified(Time::FromInternalValue(internal_time)); if (parent) parent->Add(parent->GetChildCount(), node); Index: chrome/browser/browser_about_handler.cc =================================================================== --- chrome/browser/browser_about_handler.cc (revision 54372) +++ chrome/browser/browser_about_handler.cc (working copy) @@ -280,7 +280,7 @@ #if defined(OS_CHROMEOS) std::string AboutNetwork(const std::string& query) { int refresh; - StringToInt(query, &refresh); + base::StringToInt(query, &refresh); return chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> GetHtmlInfo(refresh); } Index: chrome/browser/browser_init.cc =================================================================== --- chrome/browser/browser_init.cc (revision 54372) +++ chrome/browser/browser_init.cc (working copy) @@ -13,6 +13,7 @@ #include "base/histogram.h" #include "base/path_service.h" #include "base/scoped_ptr.h" +#include "base/string_number_conversions.h" #include "chrome/browser/automation/automation_provider.h" #include "chrome/browser/automation/automation_provider_list.h" #include "chrome/browser/automation/chrome_frame_automation_provider.h" @@ -499,16 +500,16 @@ if (command_line_.HasSwitch(switches::kRemoteShellPort)) { std::string port_str = command_line_.GetSwitchValueASCII(switches::kRemoteShellPort); - int64 port = StringToInt64(port_str); - if (port > 0 && port < 65535) + int64 port; + if (base::StringToInt64(port_str, &port) && port > 0 && port < 65535) g_browser_process->InitDebuggerWrapper(static_cast(port), false); else DLOG(WARNING) << "Invalid remote shell port number " << port; } else if (command_line_.HasSwitch(switches::kRemoteDebuggingPort)) { std::string port_str = command_line_.GetSwitchValueASCII(switches::kRemoteDebuggingPort); - int64 port = StringToInt64(port_str); - if (port > 0 && port < 65535) + int64 port; + if (base::StringToInt64(port_str, &port) && port > 0 && port < 65535) g_browser_process->InitDebuggerWrapper(static_cast(port), true); else DLOG(WARNING) << "Invalid http debugger port number " << port; @@ -940,7 +941,7 @@ if (command_line.HasSwitch(switches::kRestoreLastSession)) { std::string restore_session_value( command_line.GetSwitchValueASCII(switches::kRestoreLastSession)); - StringToInt(restore_session_value, &expected_tab_count); + base::StringToInt(restore_session_value, &expected_tab_count); } else { expected_tab_count = std::max(1, static_cast(command_line.args().size())); Index: chrome/browser/browser_main.cc =================================================================== --- chrome/browser/browser_main.cc (revision 54372) +++ chrome/browser/browser_main.cc (working copy) @@ -20,6 +20,7 @@ #include "base/path_service.h" #include "base/platform_thread.h" #include "base/process_util.h" +#include "base/string_number_conversions.h" #include "base/string_piece.h" #include "base/string_util.h" #include "base/sys_string_conversions.h" @@ -409,9 +410,10 @@ parsed_command_line.GetSwitchValueASCII(switches::kHostRules)); if (parsed_command_line.HasSwitch(switches::kMaxSpdySessionsPerDomain)) { - int value = StringToInt( - parsed_command_line.GetSwitchValueASCII( - switches::kMaxSpdySessionsPerDomain)); + int value; + base::StringToInt(parsed_command_line.GetSwitchValueASCII( + switches::kMaxSpdySessionsPerDomain), + &value); net::SpdySessionPool::set_max_sessions_per_domain(value); } } @@ -643,8 +645,12 @@ if (size_arg.size()) { std::vector dimensions; SplitString(size_arg, ',', &dimensions); - if (dimensions.size() == 2) - size.SetSize(StringToInt(dimensions[0]), StringToInt(dimensions[1])); + if (dimensions.size() == 2) { + int width, height; + if (base::StringToInt(dimensions[0], &width) && + base::StringToInt(dimensions[1], &height)) + size.SetSize(width, height); + } } browser::ShowLoginWizard(first_screen, size); } Index: chrome/browser/browser_main_posix.cc =================================================================== --- chrome/browser/browser_main_posix.cc (revision 54372) +++ chrome/browser/browser_main_posix.cc (working copy) @@ -11,7 +11,7 @@ #include "base/command_line.h" #include "base/eintr_wrapper.h" #include "base/logging.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/chrome_thread.h" #include "chrome/common/chrome_switches.h" @@ -187,7 +187,7 @@ switches::kFileDescriptorLimit); int fd_limit = 0; if (!fd_limit_string.empty()) { - StringToInt(fd_limit_string, &fd_limit); + base::StringToInt(fd_limit_string, &fd_limit); } #if defined(OS_MACOSX) // We use quite a few file descriptors for our IPC, and the default limit on Index: chrome/browser/browser_shutdown.cc =================================================================== --- chrome/browser/browser_shutdown.cc (revision 54372) +++ chrome/browser/browser_shutdown.cc (working copy) @@ -229,7 +229,7 @@ std::string shutdown_ms_str; int64 shutdown_ms = 0; if (file_util::ReadFileToString(shutdown_ms_file, &shutdown_ms_str)) - shutdown_ms = StringToInt64(shutdown_ms_str); + base::StringToInt64(shutdown_ms_str, &shutdown_ms); file_util::Delete(shutdown_ms_file, false); if (type == NOT_VALID || shutdown_ms == 0 || num_procs == 0) Index: chrome/browser/chromeos/boot_times_loader.cc =================================================================== --- chrome/browser/chromeos/boot_times_loader.cc (revision 54372) +++ chrome/browser/chromeos/boot_times_loader.cc (working copy) @@ -13,6 +13,7 @@ #include "base/message_loop.h" #include "base/process_util.h" #include "base/singleton.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/thread.h" #include "base/time.h" @@ -96,7 +97,7 @@ size_t chars_left = space_index != std::string::npos ? space_index : std::string::npos; std::string value_string = contents.substr(0, chars_left); - return StringToDouble(value_string, value); + return base::StringToDouble(value_string, value); } return false; } Index: chrome/browser/chromeos/cros/network_library.cc =================================================================== --- chrome/browser/chromeos/cros/network_library.cc (revision 54372) +++ chrome/browser/chromeos/cros/network_library.cc (working copy) @@ -52,8 +52,8 @@ if (network->type() == TYPE_WIFI || network->type() == TYPE_CELLULAR) { WirelessNetwork* wireless = static_cast(network); str += WrapWithTD(wireless->name()) + - WrapWithTD(IntToString(wireless->auto_connect())) + - WrapWithTD(IntToString(wireless->strength())); + WrapWithTD(base::IntToString(wireless->auto_connect())) + + WrapWithTD(base::IntToString(wireless->strength())); if (network->type() == TYPE_WIFI) { WifiNetwork* wifi = static_cast(network); str += WrapWithTD(wifi->GetEncryptionString()) + Index: chrome/browser/chromeos/customization_document.cc =================================================================== --- chrome/browser/chromeos/customization_document.cc (revision 54372) +++ chrome/browser/chromeos/customization_document.cc (working copy) @@ -10,7 +10,7 @@ #include "base/file_util.h" #include "base/json/json_reader.h" #include "base/logging.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/values.h" // Manifest attributes names. @@ -93,8 +93,9 @@ root->GetString(kBackgroundColorAttr, &background_color_string); if (!background_color_string.empty()) { if (background_color_string[0] == '#') { - background_color_ = static_cast( - 0xff000000 | HexStringToInt(background_color_string.substr(1))); + int background_int; + base::HexStringToInt(background_color_string.substr(1), &background_int); + background_color_ = static_cast(0xff000000 | background_int); } else { // Literal color constants are not supported yet. return false; Index: chrome/browser/chromeos/dom_ui/core_chromeos_options_handler.cc =================================================================== --- chrome/browser/chromeos/dom_ui/core_chromeos_options_handler.cc (revision 54372) +++ chrome/browser/chromeos/dom_ui/core_chromeos_options_handler.cc (working copy) @@ -5,7 +5,7 @@ #include "chrome/browser/chromeos/dom_ui/core_chromeos_options_handler.h" #include "base/json/json_reader.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/chromeos/cros_settings.h" namespace chromeos { @@ -39,7 +39,7 @@ break; case Value::TYPE_INTEGER: int int_value; - if (StringToInt(value_string, &int_value)) + if (base::StringToInt(value_string, &int_value)) cros_settings->SetInteger(pref_name, int_value); break; case Value::TYPE_STRING: Index: chrome/browser/chromeos/dom_ui/language_chewing_options_handler.cc =================================================================== --- chrome/browser/chromeos/dom_ui/language_chewing_options_handler.cc (revision 54372) +++ chrome/browser/chromeos/dom_ui/language_chewing_options_handler.cc (working copy) @@ -8,7 +8,8 @@ #include "app/l10n_util.h" #include "base/logging.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" +#include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/chromeos/dom_ui/language_options_util.h" #include "chrome/browser/chromeos/language_preferences.h" @@ -38,10 +39,10 @@ l10n_util::GetString(preference.message_id)); localized_strings->SetString( GetTemplateDataMinName(preference), - IntToWString(preference.min_pref_value)); + UTF8ToWide(base::IntToString(preference.min_pref_value))); localized_strings->SetString( GetTemplateDataMaxName(preference), - IntToWString(preference.max_pref_value)); + UTF8ToWide(base::IntToString(preference.max_pref_value))); } for (size_t i = 0; i < arraysize(chromeos::kChewingMultipleChoicePrefs); @@ -79,8 +80,8 @@ localized_strings->SetString( GetTemplateDataMinName(chromeos::kChewingHsuSelKeyType), - IntToWString(hsu_sel_key_type_min)); + UTF8ToWide(base::IntToString(hsu_sel_key_type_min))); localized_strings->SetString( GetTemplateDataMaxName(chromeos::kChewingHsuSelKeyType), - IntToWString(hsu_sel_key_type_max)); + UTF8ToWide(base::IntToString(hsu_sel_key_type_max))); } Index: chrome/browser/debugger/debugger_remote_service.cc =================================================================== --- chrome/browser/debugger/debugger_remote_service.cc (revision 54372) +++ chrome/browser/debugger/debugger_remote_service.cc (working copy) @@ -96,7 +96,7 @@ return; } int32 tab_uid = -1; - StringToInt(destination, &tab_uid); + base::StringToInt(destination, &tab_uid); if (command == DebuggerRemoteServiceCommand::kAttach) { // TODO(apavlov): handle 0 for a new tab @@ -205,7 +205,7 @@ void DebuggerRemoteService::AttachToTab(const std::string& destination, DictionaryValue* response) { int32 tab_uid = -1; - StringToInt(destination, &tab_uid); + base::StringToInt(destination, &tab_uid); if (tab_uid < 0) { // Bad tab_uid received from remote debugger (perhaps NaN) response->SetInteger(kResultWide, RESULT_UNKNOWN_TAB); @@ -249,7 +249,7 @@ void DebuggerRemoteService::DetachFromTab(const std::string& destination, DictionaryValue* response) { int32 tab_uid = -1; - StringToInt(destination, &tab_uid); + base::StringToInt(destination, &tab_uid); if (tab_uid == -1) { // Bad tab_uid received from remote debugger (NaN) if (response != NULL) { Index: chrome/browser/debugger/devtools_http_protocol_handler.cc =================================================================== --- chrome/browser/debugger/devtools_http_protocol_handler.cc (revision 54372) +++ chrome/browser/debugger/devtools_http_protocol_handler.cc (working copy) @@ -7,7 +7,7 @@ #include "base/compiler_specific.h" #include "base/logging.h" #include "base/message_loop_proxy.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/thread.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" @@ -218,7 +218,7 @@ } std::string page_id = request.path.substr(prefix.length()); int id = 0; - if (!StringToInt(page_id, &id)) { + if (!base::StringToInt(page_id, &id)) { Send500(socket, "Invalid page id: " + page_id); return; } Index: chrome/browser/debugger/devtools_window.cc =================================================================== --- chrome/browser/debugger/devtools_window.cc (revision 54372) +++ chrome/browser/debugger/devtools_window.cc (working copy) @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/command_line.h" +#include "base/string_number_conversions.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_process.h" @@ -296,7 +297,7 @@ // locale specific formatters (e.g., use , instead of . in German). return StringPrintf("rgba(%d,%d,%d,%s)", SkColorGetR(color), SkColorGetG(color), SkColorGetB(color), - DoubleToString(SkColorGetA(color) / 255.0).c_str()); + base::DoubleToString(SkColorGetA(color) / 255.0).c_str()); } GURL DevToolsWindow::GetDevToolsUrl() { Index: chrome/browser/debugger/extension_ports_remote_service.cc =================================================================== --- chrome/browser/debugger/extension_ports_remote_service.cc (revision 54372) +++ chrome/browser/debugger/extension_ports_remote_service.cc (working copy) @@ -180,7 +180,7 @@ int destination = -1; if (destinationString.size() != 0) - StringToInt(destinationString, &destination); + base::StringToInt(destinationString, &destination); if (command == kConnect) { if (destination != -1) // destination should be empty for this command. Property changes on: chrome/browser/debugger/extension_ports_remote_service.cc ___________________________________________________________________ Deleted: svn:mergeinfo Index: chrome/browser/debugger/inspectable_tab_proxy.cc =================================================================== --- chrome/browser/debugger/inspectable_tab_proxy.cc (revision 54372) +++ chrome/browser/debugger/inspectable_tab_proxy.cc (working copy) @@ -1,9 +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 "chrome/browser/debugger/inspectable_tab_proxy.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" @@ -98,7 +99,7 @@ void InspectableTabProxy::OnRemoteDebuggerDetached() { while (id_to_client_host_map_.size() > 0) { IdToClientHostMap::iterator it = id_to_client_host_map_.begin(); - it->second->debugger_remote_service()->DetachFromTab(IntToString(it->first), - NULL); + it->second->debugger_remote_service()->DetachFromTab( + base::IntToString(it->first), NULL); } } Index: chrome/browser/dom_ui/app_launcher_handler.cc =================================================================== --- chrome/browser/dom_ui/app_launcher_handler.cc (revision 54372) +++ chrome/browser/dom_ui/app_launcher_handler.cc (working copy) @@ -6,7 +6,7 @@ #include "app/animation.h" #include "base/base64.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/app_launched_animation.h" @@ -32,7 +32,7 @@ std::string string_value; if (list->GetString(index, &string_value)) { - *out_int = StringToInt(string_value); + base::StringToInt(string_value, out_int); return true; } Index: chrome/browser/dom_ui/browser_options_handler.cc =================================================================== --- chrome/browser/dom_ui/browser_options_handler.cc (revision 54372) +++ chrome/browser/dom_ui/browser_options_handler.cc (working copy) @@ -7,7 +7,7 @@ #include "app/l10n_util.h" #include "base/basictypes.h" #include "base/scoped_ptr.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/custom_home_pages_table_model.h" @@ -205,7 +205,8 @@ NOTREACHED(); return; } - int selected_index = StringToInt(string_value); + int selected_index; + base::StringToInt(string_value, &selected_index); std::vector model_urls = template_url_model_->GetTemplateURLs(); @@ -280,7 +281,8 @@ NOTREACHED(); return; } - int selected_index = StringToInt(string_value); + int selected_index; + base::StringToInt(string_value, &selected_index); if (selected_index < 0 || selected_index >= startup_custom_pages_table_model_->RowCount()) { NOTREACHED(); Index: chrome/browser/dom_ui/core_options_handler.cc =================================================================== --- chrome/browser/dom_ui/core_options_handler.cc (revision 54372) +++ chrome/browser/dom_ui/core_options_handler.cc (working copy) @@ -5,6 +5,7 @@ #include "chrome/browser/dom_ui/core_options_handler.h" #include "app/l10n_util.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/common/notification_service.h" @@ -141,7 +142,7 @@ break; case Value::TYPE_INTEGER: int int_value; - if (StringToInt(value_string, &int_value)) + if (base::StringToInt(value_string, &int_value)) pref_service->SetInteger(pref_name.c_str(), int_value); break; case Value::TYPE_STRING: Index: chrome/browser/dom_ui/dom_ui.cc =================================================================== --- chrome/browser/dom_ui/dom_ui.cc (revision 54372) +++ chrome/browser/dom_ui/dom_ui.cc (working copy) @@ -7,7 +7,7 @@ #include "base/i18n/rtl.h" #include "base/json/json_writer.h" #include "base/stl_util-inl.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/browser_theme_provider.h" @@ -148,7 +148,7 @@ const ListValue* list_value = static_cast(value); std::string string_value; if (list_value->GetString(0, &string_value)) { - *out_int = StringToInt(string_value); + base::StringToInt(string_value, out_int); return true; } } Index: chrome/browser/dom_ui/history2_ui.cc =================================================================== --- chrome/browser/dom_ui/history2_ui.cc (revision 54372) +++ chrome/browser/dom_ui/history2_ui.cc (working copy) @@ -10,8 +10,8 @@ #include "base/i18n/time_formatting.h" #include "base/message_loop.h" #include "base/singleton.h" +#include "base/string_number_conversions.h" #include "base/string_piece.h" -#include "base/string_util.h" #include "base/thread.h" #include "base/time.h" #include "base/values.h" @@ -321,7 +321,7 @@ static_cast(list_member); string16 string16_value; string_value->GetAsUTF16(&string16_value); - *month = StringToInt(string16_value); + base::StringToInt(string16_value, month); } } } Index: chrome/browser/dom_ui/history_ui.cc =================================================================== --- chrome/browser/dom_ui/history_ui.cc (revision 54372) +++ chrome/browser/dom_ui/history_ui.cc (working copy) @@ -10,8 +10,8 @@ #include "base/i18n/time_formatting.h" #include "base/message_loop.h" #include "base/singleton.h" +#include "base/string_number_conversions.h" #include "base/string_piece.h" -#include "base/string_util.h" #include "base/thread.h" #include "base/time.h" #include "base/values.h" @@ -321,7 +321,7 @@ static_cast(list_member); string16 string16_value; string_value->GetAsUTF16(&string16_value); - *month = StringToInt(string16_value); + base::StringToInt(string16_value, month); } } } Index: chrome/browser/dom_ui/most_visited_handler.cc =================================================================== --- chrome/browser/dom_ui/most_visited_handler.cc (revision 54372) +++ chrome/browser/dom_ui/most_visited_handler.cc (working copy) @@ -12,6 +12,7 @@ #include "base/md5.h" #include "base/singleton.h" #include "base/scoped_vector.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "base/thread.h" #include "base/values.h" @@ -269,7 +270,7 @@ r = list->GetString(4, &tmp_string); DCHECK(r) << "Missing index in addPinnedURL from the NTP Most Visited."; - index = StringToInt(tmp_string); + base::StringToInt(tmp_string, &index); AddPinnedURL(mvp, index); } Index: chrome/browser/dom_ui/new_tab_ui.cc =================================================================== --- chrome/browser/dom_ui/new_tab_ui.cc (revision 54372) +++ chrome/browser/dom_ui/new_tab_ui.cc (working copy) @@ -14,6 +14,7 @@ #include "base/histogram.h" #include "base/i18n/rtl.h" #include "base/singleton.h" +#include "base/string_number_conversions.h" #include "base/thread.h" #include "chrome/browser/browser.h" #include "chrome/browser/chrome_thread.h" @@ -196,7 +197,8 @@ static_cast(list_member); std::wstring wstring_value; if (string_value->GetAsString(&wstring_value)) { - int session_to_restore = StringToInt(WideToUTF16Hack(wstring_value)); + int session_to_restore; + base::StringToInt(WideToUTF8(wstring_value), &session_to_restore); tab_restore_service_->RestoreEntryById(browser, session_to_restore, true); // The current tab has been nuked at this point; don't touch any member Index: chrome/browser/dom_ui/ntp_resource_cache.cc =================================================================== --- chrome/browser/dom_ui/ntp_resource_cache.cc (revision 54372) +++ chrome/browser/dom_ui/ntp_resource_cache.cc (working copy) @@ -69,7 +69,7 @@ // locale specific formatters (e.g., use , instead of . in German). return StringPrintf("rgba(%d,%d,%d,%s)", SkColorGetR(color), SkColorGetG(color), SkColorGetB(color), - DoubleToString(SkColorGetA(color) / 255.0).c_str()); + base::DoubleToString(SkColorGetA(color) / 255.0).c_str()); } // Get the CSS string for the background position on the new tab page for the Index: chrome/browser/dom_ui/shown_sections_handler.cc =================================================================== --- chrome/browser/dom_ui/shown_sections_handler.cc (revision 54372) +++ chrome/browser/dom_ui/shown_sections_handler.cc (working copy) @@ -6,7 +6,7 @@ #include "base/callback.h" #include "base/command_line.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/values.h" #include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/pref_service.h" @@ -92,7 +92,8 @@ bool r = list->GetString(0, &mode_string); DCHECK(r) << "Missing value in setShownSections from the NTP Most Visited."; - int mode = StringToInt(mode_string); + int mode; + base::StringToInt(mode_string, &mode); int old_mode = pref_service_->GetInteger(prefs::kNTPShownSections); if (old_mode != mode) { Index: chrome/browser/download/download_util.cc =================================================================== --- chrome/browser/download/download_util.cc (revision 54372) +++ chrome/browser/download/download_util.cc (working copy) @@ -18,7 +18,7 @@ #include "base/i18n/time_formatting.h" #include "base/path_service.h" #include "base/singleton.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/browser_process.h" @@ -262,7 +262,7 @@ if (big_progress_icon_size == 0) { string16 locale_size_str = WideToUTF16Hack(l10n_util::GetString(IDS_DOWNLOAD_BIG_PROGRESS_SIZE)); - bool rc = StringToInt(locale_size_str, &big_progress_icon_size); + bool rc = base::StringToInt(locale_size_str, &big_progress_icon_size); if (!rc || big_progress_icon_size < kBigProgressIconSize) { NOTREACHED(); big_progress_icon_size = kBigProgressIconSize; Index: chrome/browser/extensions/extension_bookmark_manager_api.cc =================================================================== --- chrome/browser/extensions/extension_bookmark_manager_api.cc (revision 54372) +++ chrome/browser/extensions/extension_bookmark_manager_api.cc (working copy) @@ -35,7 +35,7 @@ if (!args->GetString(0, &id_string)) return NULL; int64 id; - if (!StringToInt64(id_string, &id)) + if (!base::StringToInt64(id_string, &id)) return NULL; return model->GetNodeByID(id); } @@ -58,7 +58,7 @@ if (!ids->GetString(i, &id_string)) return false; int64 id; - if (!StringToInt64(id_string, &id)) + if (!base::StringToInt64(id_string, &id)) return false; const BookmarkNode* node = model->GetNodeByID(id); if (!node) @@ -363,7 +363,7 @@ std::string id_string; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &id_string)); - if (!StringToInt64(id_string, &id)) { + if (!base::StringToInt64(id_string, &id)) { error_ = keys::kInvalidIdError; return false; } @@ -417,7 +417,7 @@ if (id_string == "") { node = model->root_node(); } else { - if (!StringToInt64(id_string, &id)) { + if (!base::StringToInt64(id_string, &id)) { error_ = keys::kInvalidIdError; return false; } Property changes on: chrome/browser/extensions/extension_bookmark_manager_api.cc ___________________________________________________________________ Deleted: svn:mergeinfo Index: chrome/browser/extensions/extension_devtools_events.cc =================================================================== --- chrome/browser/extensions/extension_devtools_events.cc (revision 54372) +++ chrome/browser/extensions/extension_devtools_events.cc (working copy) @@ -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,6 +6,7 @@ #include +#include "base/string_number_conversions.h" #include "base/string_util.h" // These string constants and the formats used in this file must stay @@ -26,7 +27,7 @@ // At this point we want something like "4.onPageEvent" std::vector parts; SplitString(event_name.substr(strlen(kDevToolsEventPrefix)), '.', &parts); - if (parts.size() == 2 && StringToInt(parts[0], tab_id)) { + if (parts.size() == 2 && base::StringToInt(parts[0], tab_id)) { return true; } } Index: chrome/browser/extensions/extension_install_ui.cc =================================================================== --- chrome/browser/extensions/extension_install_ui.cc (revision 54372) +++ chrome/browser/extensions/extension_install_ui.cc (working copy) @@ -11,6 +11,7 @@ #include "base/command_line.h" #include "base/file_util.h" #include "base/rand_util.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_list.h" @@ -99,7 +100,7 @@ IDS_EXTENSION_PROMPT2_WARNING_4_OR_MORE_HOSTS, UTF8ToUTF16(*hosts.begin()), UTF8ToUTF16(*(++hosts.begin())), - IntToString16(hosts.size() - 2))); + base::IntToString16(hosts.size() - 2))); } } Index: chrome/browser/extensions/extension_prefs.cc =================================================================== --- chrome/browser/extensions/extension_prefs.cc (revision 54372) +++ chrome/browser/extensions/extension_prefs.cc (working copy) @@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/extensions/extension_prefs.h" + #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" @@ -306,7 +307,7 @@ std::string string_value; int64 value; dictionary->GetString(kLastPingDay, &string_value); - if (StringToInt64(string_value, &value)) { + if (base::StringToInt64(string_value, &value)) { return Time::FromInternalValue(value); } } @@ -735,7 +736,7 @@ return false; int64 fetch_time_value; - if (!StringToInt64(fetch_time_string, &fetch_time_value)) + if (!base::StringToInt64(fetch_time_string, &fetch_time_value)) return false; if (crx_path) Index: chrome/browser/extensions/extensions_service.cc =================================================================== --- chrome/browser/extensions/extensions_service.cc (revision 54372) +++ chrome/browser/extensions/extensions_service.cc (working copy) @@ -10,6 +10,7 @@ #include "base/histogram.h" #include "base/stl_util-inl.h" #include "base/string16.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/time.h" #include "base/values.h" @@ -180,8 +181,9 @@ if (autoupdate_enabled) { int update_frequency = kDefaultUpdateFrequencySeconds; if (command_line->HasSwitch(switches::kExtensionsUpdateFrequency)) { - update_frequency = StringToInt(command_line->GetSwitchValueASCII( - switches::kExtensionsUpdateFrequency)); + base::StringToInt(command_line->GetSwitchValueASCII( + switches::kExtensionsUpdateFrequency), + &update_frequency); } updater_ = new ExtensionUpdater(this, prefs, update_frequency); } Index: chrome/browser/extensions/extensions_ui.cc =================================================================== --- chrome/browser/extensions/extensions_ui.cc (revision 54372) +++ chrome/browser/extensions/extensions_ui.cc (working copy) @@ -9,6 +9,7 @@ #include "base/base64.h" #include "base/callback.h" #include "base/file_util.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/thread.h" #include "chrome/browser/browser.h" @@ -67,7 +68,7 @@ return true; } -} +} // namespace //////////////////////////////////////////////////////////////////////////////// // @@ -428,8 +429,8 @@ CHECK(list->GetSize() == 2); CHECK(list->GetString(0, &render_process_id_str)); CHECK(list->GetString(1, &render_view_id_str)); - CHECK(StringToInt(render_process_id_str, &render_process_id)); - CHECK(StringToInt(render_view_id_str, &render_view_id)); + CHECK(base::StringToInt(render_process_id_str, &render_process_id)); + CHECK(base::StringToInt(render_view_id_str, &render_view_id)); RenderViewHost* host = RenderViewHost::FromID(render_process_id, render_view_id); if (!host) { Index: chrome/browser/geolocation/wifi_data_provider_linux.cc =================================================================== --- chrome/browser/geolocation/wifi_data_provider_linux.cc (revision 54372) +++ chrome/browser/geolocation/wifi_data_provider_linux.cc (working copy) @@ -14,6 +14,7 @@ #include #include "base/scoped_ptr.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" namespace { @@ -294,7 +295,7 @@ std::string mac = g_value_get_string(&mac_g_value.v); ReplaceSubstringsAfterOffset(&mac, 0U, ":", ""); std::vector mac_bytes; - if (!HexStringToBytes(mac, &mac_bytes) || mac_bytes.size() != 6) { + if (!base::HexStringToBytes(mac, &mac_bytes) || mac_bytes.size() != 6) { DLOG(WARNING) << "Can't parse mac address (found " << mac_bytes.size() << " bytes) so using raw string: " << mac; access_point_data.mac_address = UTF8ToUTF16(mac); Index: chrome/browser/gtk/certificate_viewer.cc =================================================================== --- chrome/browser/gtk/certificate_viewer.cc (revision 54372) +++ chrome/browser/gtk/certificate_viewer.cc (working copy) @@ -17,7 +17,7 @@ #include "base/i18n/time_formatting.h" #include "base/nss_util.h" #include "base/scoped_ptr.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/time.h" #include "base/utf_string_conversions.h" #include "chrome/browser/gtk/certificate_dialogs.h" @@ -394,7 +394,7 @@ if (SEC_ASN1DecodeInteger(&cert->version, &version) == SECSuccess && version != ULONG_MAX) version_str = l10n_util::GetStringFUTF8(IDS_CERT_DETAILS_VERSION_FORMAT, - UintToString16(version + 1)); + base::UintToString16(version + 1)); GtkTreeIter iter; gtk_tree_store_append(store, &iter, &cert_iter); gtk_tree_store_set( Index: chrome/browser/history/text_database.cc =================================================================== --- chrome/browser/history/text_database.cc (revision 54372) +++ chrome/browser/history/text_database.cc (working copy) @@ -13,6 +13,7 @@ #include "base/file_util.h" #include "base/histogram.h" #include "base/logging.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/browser/diagnostics/sqlite_diagnostics.h" @@ -106,8 +107,9 @@ return 0; } - int year = StringToInt(suffix.substr(0, 4)); - int month = StringToInt(suffix.substr(5, 2)); + int year, month; + base::StringToInt(suffix.substr(0, 4), &year); + base::StringToInt(suffix.substr(5, 2), &month); return year * 100 + month; } Index: chrome/browser/importer/firefox2_importer.cc =================================================================== --- chrome/browser/importer/firefox2_importer.cc (revision 54372) +++ chrome/browser/importer/firefox2_importer.cc (working copy) @@ -14,6 +14,7 @@ #include "base/path_service.h" #include "base/stl_util-inl.h" #include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/history/history_types.h" @@ -483,7 +484,8 @@ // Add date if (GetAttribute(attribute_list, kAddDateAttribute, &value)) { - int64 time = StringToInt64(value); + int64 time; + base::StringToInt64(value, &time); // Upper bound it at 32 bits. if (0 < time && time < (1LL << 32)) *add_date = Time::FromTimeT(time); Index: chrome/browser/importer/firefox_importer_utils.cc =================================================================== --- chrome/browser/importer/firefox_importer_utils.cc (revision 54372) +++ chrome/browser/importer/firefox_importer_utils.cc (working copy) @@ -11,6 +11,7 @@ #include "base/file_util.h" #include "base/logging.h" #include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/search_engines/template_url.h" @@ -438,7 +439,7 @@ // Or value could be an integer. int int_value = 0; - if (StringToInt(value, &int_value)) { + if (base::StringToInt(value, &int_value)) { prefs->SetInteger(ASCIIToWide(key), int_value); continue; } Index: chrome/browser/importer/importer_bridge.cc =================================================================== --- chrome/browser/importer/importer_bridge.cc (revision 54372) +++ chrome/browser/importer/importer_bridge.cc (working copy) @@ -184,7 +184,8 @@ std::wstring ExternalProcessImporterBridge::GetLocalizedString( int message_id) { std::wstring message; - localized_strings_->GetString(IntToWString(message_id), &message); + localized_strings_->GetString(ASCIIToWide(base::IntToString(message_id)), + &message); return message; } Index: chrome/browser/importer/mork_reader.cc =================================================================== --- chrome/browser/importer/mork_reader.cc (revision 54372) +++ chrome/browser/importer/mork_reader.cc (working copy) @@ -48,6 +48,7 @@ #include "base/i18n/icu_string_conversions.h" #include "base/logging.h" #include "base/message_loop.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "chrome/browser/history/history_types.h" #include "chrome/browser/importer/firefox_importer_utils.h" @@ -530,9 +531,10 @@ count = 1; row.set_visit_count(count); - time_t date = StringToInt64(values[kLastVisitColumn]); + int64 date; + base::StringToInt64(values[kLastVisitColumn], &date); if (date != 0) - row.set_last_visit(Time::FromTimeT(date/1000000)); + row.set_last_visit(Time::FromTimeT(date / 1000000)); bool is_typed = (values[kTypedColumn] == "1"); if (is_typed) Index: chrome/browser/importer/toolbar_importer.cc =================================================================== --- chrome/browser/importer/toolbar_importer.cc (revision 54372) +++ chrome/browser/importer/toolbar_importer.cc (working copy) @@ -7,6 +7,7 @@ #include #include "base/rand_util.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/first_run/first_run.h" @@ -231,7 +232,7 @@ // Random number construction. int random = base::RandInt(0, std::numeric_limits::max()); - std::string random_string = UintToString(random); + std::string random_string = base::UintToString(random); // Retrieve authorization token from the network. std::string url_string(kT5AuthorizationTokenUrl); @@ -264,7 +265,7 @@ // the xml blob. We must tag the connection string with a random number. std::string conn_string = kT5FrontEndUrlTemplate; int random = base::RandInt(0, std::numeric_limits::max()); - std::string random_string = UintToString(random); + std::string random_string = base::UintToString(random); conn_string.replace(conn_string.find(kRandomNumberToken), arraysize(kRandomNumberToken) - 1, random_string); @@ -520,7 +521,7 @@ return false; } int64 timestamp; - if (!StringToInt64(buffer, ×tamp)) { + if (!base::StringToInt64(buffer, ×tamp)) { return false; } entry->creation_time = base::Time::FromTimeT(timestamp); Index: chrome/browser/io_thread.cc =================================================================== --- chrome/browser/io_thread.cc (revision 54372) +++ chrome/browser/io_thread.cc (working copy) @@ -3,9 +3,11 @@ // found in the LICENSE file. #include "chrome/browser/io_thread.h" + #include "base/command_line.h" #include "base/leak_tracker.h" #include "base/logging.h" +#include "base/string_number_conversions.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/gpu_process_host.h" @@ -37,7 +39,7 @@ // Parse the switch (it should be a positive integer formatted as decimal). int n; - if (StringToInt(s, &n) && n > 0) { + if (base::StringToInt(s, &n) && n > 0) { parallelism = static_cast(n); } else { LOG(ERROR) << "Invalid switch for host resolver parallelism: " << s; Index: chrome/browser/net/chrome_url_request_context.cc =================================================================== --- chrome/browser/net/chrome_url_request_context.cc (revision 54372) +++ chrome/browser/net/chrome_url_request_context.cc (working copy) @@ -7,6 +7,7 @@ #include "base/command_line.h" #include "base/message_loop.h" #include "base/message_loop_proxy.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_thread.h" @@ -105,7 +106,7 @@ // Parse the switch (it should be a positive integer formatted as decimal). int n; - if (StringToInt(s, &n) && n > 0) { + if (base::StringToInt(s, &n) && n > 0) { num_pac_threads = static_cast(n); } else { LOG(ERROR) << "Invalid switch for number of PAC threads: " << s; Index: chrome/browser/pref_service.cc =================================================================== --- chrome/browser/pref_service.cc (revision 54372) +++ chrome/browser/pref_service.cc (working copy) @@ -13,6 +13,7 @@ #include "base/logging.h" #include "base/message_loop.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 "base/utf_string_conversions.h" @@ -44,20 +45,19 @@ } case Value::TYPE_INTEGER: { - return Value::CreateIntegerValue( - StringToInt(WideToUTF16Hack(resource_string))); - break; + int val; + base::StringToInt(WideToUTF8(resource_string), &val); + return Value::CreateIntegerValue(val); } case Value::TYPE_REAL: { - return Value::CreateRealValue( - StringToDouble(WideToUTF16Hack(resource_string))); - break; + double val; + base::StringToDouble(WideToUTF8(resource_string), &val); + return Value::CreateRealValue(val); } case Value::TYPE_STRING: { return Value::CreateStringValue(resource_string); - break; } default: { @@ -682,7 +682,7 @@ } scoped_ptr old_value(GetPrefCopy(path)); - Value* new_value = Value::CreateStringValue(Int64ToWString(value)); + Value* new_value = Value::CreateStringValue(base::Int64ToString(value)); pref_value_store_->SetUserPrefValue(path, new_value); FireObserversIfChanged(path, old_value.get()); @@ -699,12 +699,15 @@ std::wstring result(L"0"); bool rv = pref->GetValue()->GetAsString(&result); DCHECK(rv); - return StringToInt64(WideToUTF16Hack(result)); + + int64 val; + base::StringToInt64(WideToUTF8(result), &val); + return val; } void PrefService::RegisterInt64Pref(const wchar_t* path, int64 default_value) { Preference* pref = new Preference(pref_value_store_.get(), path, - Value::CreateStringValue(Int64ToWString(default_value))); + Value::CreateStringValue(base::Int64ToString(default_value))); RegisterPreference(pref); } Index: chrome/browser/process_singleton_linux.cc =================================================================== --- chrome/browser/process_singleton_linux.cc (revision 54372) +++ chrome/browser/process_singleton_linux.cc (working copy) @@ -57,6 +57,7 @@ #include "base/process_util.h" #include "base/safe_strerror_posix.h" #include "base/stl_util-inl.h" +#include "base/string_number_conversions.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" #include "base/time.h" @@ -259,7 +260,7 @@ *hostname = real_path.substr(0, pos); const std::string& pid_str = real_path.substr(pos + 1); - if (!StringToInt(pid_str, pid)) + if (!base::StringToInt(pid_str, pid)) *pid = -1; return true; @@ -269,7 +270,7 @@ const std::string& hostname, int pid) { std::wstring error = l10n_util::GetStringF(IDS_PROFILE_IN_USE_LINUX, - IntToWString(pid), + UTF8ToWide(base::IntToString(pid)), ASCIIToWide(hostname), base::SysNativeMBToWide(lock_path), l10n_util::GetString(IDS_PRODUCT_NAME)); Index: chrome/browser/profile.cc =================================================================== --- chrome/browser/profile.cc (revision 54372) +++ chrome/browser/profile.cc (working copy) @@ -11,6 +11,7 @@ #include "base/file_util.h" #include "base/path_service.h" #include "base/scoped_ptr.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "chrome/browser/appcache/chrome_appcache_service.h" #include "chrome/browser/autocomplete/autocomplete_classifier.h" @@ -116,7 +117,7 @@ // By default we let the cache determine the right size. *max_size = 0; - if (!StringToInt(value, max_size)) { + if (!base::StringToInt(value, max_size)) { *max_size = 0; } else if (max_size < 0) { *max_size = 0; Index: chrome/browser/profile_import_process_host.cc =================================================================== --- chrome/browser/profile_import_process_host.cc (revision 54372) +++ chrome/browser/profile_import_process_host.cc (working copy) @@ -7,7 +7,7 @@ #include "app/l10n_util.h" #include "base/command_line.h" #include "base/message_loop.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/values.h" #include "chrome/browser/importer/firefox_importer_utils.h" #include "chrome/browser/importer/importer_messages.h" @@ -35,20 +35,20 @@ // in the external process. DictionaryValue localized_strings; localized_strings.SetString( - IntToWString(IDS_BOOKMARK_GROUP_FROM_FIREFOX), - l10n_util::GetString(IDS_BOOKMARK_GROUP_FROM_FIREFOX)); + base::IntToString(IDS_BOOKMARK_GROUP_FROM_FIREFOX), + l10n_util::GetStringUTF8(IDS_BOOKMARK_GROUP_FROM_FIREFOX)); localized_strings.SetString( - IntToWString(IDS_BOOKMARK_GROUP_FROM_SAFARI), - l10n_util::GetString(IDS_BOOKMARK_GROUP_FROM_SAFARI)); + base::IntToString(IDS_BOOKMARK_GROUP_FROM_SAFARI), + l10n_util::GetStringUTF8(IDS_BOOKMARK_GROUP_FROM_SAFARI)); localized_strings.SetString( - IntToWString(IDS_IMPORT_FROM_FIREFOX), - l10n_util::GetString(IDS_IMPORT_FROM_FIREFOX)); + base::IntToString(IDS_IMPORT_FROM_FIREFOX), + l10n_util::GetStringUTF8(IDS_IMPORT_FROM_FIREFOX)); localized_strings.SetString( - IntToWString(IDS_IMPORT_FROM_GOOGLE_TOOLBAR), - l10n_util::GetString(IDS_IMPORT_FROM_GOOGLE_TOOLBAR)); + base::IntToString(IDS_IMPORT_FROM_GOOGLE_TOOLBAR), + l10n_util::GetStringUTF8(IDS_IMPORT_FROM_GOOGLE_TOOLBAR)); localized_strings.SetString( - IntToWString(IDS_IMPORT_FROM_SAFARI), - l10n_util::GetString(IDS_IMPORT_FROM_SAFARI)); + base::IntToString(IDS_IMPORT_FROM_SAFARI), + l10n_util::GetStringUTF8(IDS_IMPORT_FROM_SAFARI)); Send(new ProfileImportProcessMsg_StartImport( profile_info, items, localized_strings, import_to_bookmark_bar)); Index: chrome/browser/renderer_host/render_sandbox_host_linux.cc =================================================================== --- chrome/browser/renderer_host/render_sandbox_host_linux.cc (revision 54372) +++ chrome/browser/renderer_host/render_sandbox_host_linux.cc (working copy) @@ -340,7 +340,7 @@ 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); + base::StringToInt(inode_output, &pid); if (!pid) { LOG(ERROR) << "Could not get pid"; Index: chrome/browser/renderer_host/render_widget_host_view_gtk.cc =================================================================== --- chrome/browser/renderer_host/render_widget_host_view_gtk.cc (revision 54372) +++ chrome/browser/renderer_host/render_widget_host_view_gtk.cc (working copy) @@ -23,7 +23,7 @@ #include "base/command_line.h" #include "base/logging.h" #include "base/message_loop.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/task.h" #include "base/time.h" #include "chrome/browser/gtk/gtk_util.h" @@ -333,7 +333,7 @@ command_line->GetSwitchValueASCII(switches::kScrollPixels); if (!scroll_pixels_option.empty()) { double v; - if (StringToDouble(scroll_pixels_option, &v)) + if (base::StringToDouble(scroll_pixels_option, &v)) scroll_pixels = static_cast(v); } DCHECK_GT(scroll_pixels, 0); Index: chrome/browser/renderer_host/save_file_resource_handler.cc =================================================================== --- chrome/browser/renderer_host/save_file_resource_handler.cc (revision 54372) +++ chrome/browser/renderer_host/save_file_resource_handler.cc (working copy) @@ -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. @@ -6,7 +6,7 @@ #include "base/logging.h" #include "base/message_loop.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/download/save_file_manager.h" #include "net/base/io_buffer.h" @@ -115,5 +115,5 @@ void SaveFileResourceHandler::set_content_length( const std::string& content_length) { - content_length_ = StringToInt64(content_length); + base::StringToInt64(content_length, &content_length_); } Index: chrome/browser/safe_browsing/safe_browsing_blocking_page.cc =================================================================== --- chrome/browser/safe_browsing/safe_browsing_blocking_page.cc (revision 54372) +++ chrome/browser/safe_browsing/safe_browsing_blocking_page.cc (working copy) @@ -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. // @@ -11,6 +11,7 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "base/i18n/rtl.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/chrome_thread.h" @@ -332,7 +333,7 @@ DCHECK(colon_index < command.size() - 1); std::string index_str = command.substr(colon_index + 1); command = command.substr(0, colon_index); - bool result = StringToInt(index_str, &element_index); + bool result = base::StringToInt(index_str, &element_index); DCHECK(result); } Index: chrome/browser/search_engines/template_url_model.cc =================================================================== --- chrome/browser/search_engines/template_url_model.cc (revision 54372) +++ chrome/browser/search_engines/template_url_model.cc (working copy) @@ -863,10 +863,16 @@ (*default_provider)->set_short_name(name); (*default_provider)->SetURL(search_url, 0, 0); (*default_provider)->SetSuggestionsURL(suggest_url, 0, 0); - if (!id_string.empty()) - (*default_provider)->set_id(StringToInt64(id_string)); - if (!prepopulate_id.empty()) - (*default_provider)->set_prepopulate_id(StringToInt(prepopulate_id)); + if (!id_string.empty()) { + int64 value; + base::StringToInt64(id_string, &value); + (*default_provider)->set_id(value); + } + if (!prepopulate_id.empty()) { + int value; + base::StringToInt(prepopulate_id, &value); + (*default_provider)->set_prepopulate_id(value); + } return true; } Index: chrome/browser/search_engines/template_url_parser.cc =================================================================== --- chrome/browser/search_engines/template_url_parser.cc (revision 54372) +++ chrome/browser/search_engines/template_url_parser.cc (working copy) @@ -10,6 +10,7 @@ #include "base/logging.h" #include "base/scoped_ptr.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/browser/search_engines/template_url.h" @@ -313,11 +314,11 @@ } else if (name == kURLTemplateAttribute) { template_url = XMLCharToString(value); } else if (name == kURLIndexOffsetAttribute) { - index_offset = - std::max(1, StringToInt(WideToUTF16Hack(XMLCharToWide(value)))); + base::StringToInt(XMLCharToString(value), &index_offset); + index_offset = std::max(1, index_offset); } else if (name == kURLPageOffsetAttribute) { - page_offset = - std::max(1, StringToInt(WideToUTF16Hack(XMLCharToWide(value)))); + base::StringToInt(XMLCharToString(value), &page_offset); + page_offset = std::max(1, page_offset); } else if (name == kParamMethodAttribute) { is_post = LowerCaseEqualsASCII(XMLCharToString(value), "post"); } @@ -350,9 +351,9 @@ if (name == kImageTypeAttribute) { type = XMLCharToWide(value); } else if (name == kImageWidthAttribute) { - width = StringToInt(WideToUTF16Hack(XMLCharToWide(value))); + base::StringToInt(XMLCharToString(value), &width); } else if (name == kImageHeightAttribute) { - height = StringToInt(WideToUTF16Hack(XMLCharToWide(value))); + base::StringToInt(XMLCharToString(value), &height); } attributes += 2; } Index: chrome/browser/shell_integration_linux.cc =================================================================== --- chrome/browser/shell_integration_linux.cc (revision 54372) +++ chrome/browser/shell_integration_linux.cc (working copy) @@ -23,6 +23,7 @@ #include "base/path_service.h" #include "base/process_util.h" #include "base/scoped_temp_dir.h" +#include "base/string_number_conversions.h" #include "base/string_tokenizer.h" #include "base/string_util.h" #include "base/task.h" @@ -113,7 +114,7 @@ argv.push_back("user"); argv.push_back("--size"); - argv.push_back(IntToString(shortcut_info.favicon.width())); + argv.push_back(base::IntToString(shortcut_info.favicon.width())); argv.push_back(temp_file_path.value()); std::string icon_name = temp_file_path.BaseName().RemoveExtension().value(); Index: chrome/browser/sync/glue/autofill_model_associator.cc =================================================================== --- chrome/browser/sync/glue/autofill_model_associator.cc (revision 54372) +++ chrome/browser/sync/glue/autofill_model_associator.cc (working copy) @@ -8,6 +8,7 @@ #include "base/task.h" #include "base/time.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/autofill/autofill_profile.h" #include "chrome/browser/chrome_thread.h" @@ -161,7 +162,7 @@ const string16& non_unique_label, sync_api::BaseTransaction* trans) { int unique_id = 1; // Priming so we start by appending "2". while (unique_id++ < kMaxNumAttemptsToFindUniqueLabel) { - string16 suffix(UTF8ToUTF16(IntToString(unique_id))); + string16 suffix(base::IntToString16(unique_id)); string16 unique_label = non_unique_label + suffix; sync_api::ReadNode node(trans); if (node.InitByClientTagLookup(syncable::AUTOFILL, Index: chrome/browser/sync/syncable/syncable.cc =================================================================== --- chrome/browser/sync/syncable/syncable.cc (revision 54372) +++ chrome/browser/sync/syncable/syncable.cc (working copy) @@ -1581,7 +1581,7 @@ FastDump& operator<<(FastDump& dump, const syncable::Blob& blob) { if (blob.empty()) return dump; - string buffer(HexEncode(&blob[0], blob.size())); + string buffer(base::HexEncode(&blob[0], blob.size())); dump.out_->sputn(buffer.c_str(), buffer.size()); return dump; } Index: chrome/browser/sync/util/crypto_helpers.cc =================================================================== --- chrome/browser/sync/util/crypto_helpers.cc (revision 54372) +++ chrome/browser/sync/util/crypto_helpers.cc (working copy) @@ -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. @@ -11,6 +11,7 @@ #include "base/format_macros.h" #include "base/logging.h" #include "base/rand_util.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" using std::string; @@ -40,8 +41,8 @@ std::string MD5Calculator::GetHexDigest() { CalcDigest(); - string hex = HexEncode(reinterpret_cast(&bin_digest_.front()), - bin_digest_.size()); + string hex = base::HexEncode(reinterpret_cast(&bin_digest_.front()), + bin_digest_.size()); StringToLowerASCII(&hex); return hex; } Index: chrome/browser/task_manager.cc =================================================================== --- chrome/browser/task_manager.cc (revision 54372) +++ chrome/browser/task_manager.cc (working copy) @@ -10,6 +10,7 @@ #include "base/i18n/number_formatting.h" #include "base/i18n/rtl.h" #include "base/process_util.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/thread.h" #include "chrome/browser/browser_list.h" @@ -166,7 +167,8 @@ std::wstring TaskManagerModel::GetResourceProcessId(int index) const { DCHECK(index < ResourceCount()); - return IntToWString(base::GetProcId(resources_[index]->GetProcess())); + return UTF8ToWide(base::IntToString(base::GetProcId( + resources_[index]->GetProcess()))); } std::wstring TaskManagerModel::GetResourceGoatsTeleported(int index) const { Index: chrome/browser/views/about_chrome_view.cc =================================================================== --- chrome/browser/views/about_chrome_view.cc (revision 54372) +++ chrome/browser/views/about_chrome_view.cc (working copy) @@ -13,6 +13,7 @@ #include "base/callback.h" #include "base/file_version_info.h" #include "base/i18n/rtl.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/metrics/user_metrics.h" @@ -803,7 +804,7 @@ profile_); check_button_status_ = CHECKBUTTON_HIDDEN; update_label_.SetText(l10n_util::GetStringF(IDS_UPGRADE_ERROR, - IntToWString(error_code))); + UTF8ToWide(base::IntToString(error_code)))); show_timeout_indicator = true; break; default: Index: chrome/browser/views/find_bar_view.cc =================================================================== --- chrome/browser/views/find_bar_view.cc (revision 54372) +++ chrome/browser/views/find_bar_view.cc (working copy) @@ -8,7 +8,9 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/browser_theme_provider.h" #include "chrome/browser/find_bar_controller.h" #include "chrome/browser/find_bar_state.h" @@ -199,8 +201,8 @@ if (!find_text.empty() && have_valid_range) { match_count_text_->SetText( l10n_util::GetStringF(IDS_FIND_IN_PAGE_COUNT, - IntToWString(result.active_match_ordinal()), - IntToWString(result.number_of_matches()))); + UTF8ToWide(base::IntToString(result.active_match_ordinal())), + UTF8ToWide(base::IntToString(result.number_of_matches())))); UpdateMatchCountAppearance(result.number_of_matches() == 0 && result.final_update()); Index: chrome/browser/views/frame/browser_view.cc =================================================================== --- chrome/browser/views/frame/browser_view.cc (revision 54372) +++ chrome/browser/views/frame/browser_view.cc (working copy) @@ -11,6 +11,8 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "base/i18n/rtl.h" +#include "base/string_number_conversions.h" +#include "base/utf_string_conversions.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/app_modal_dialog_queue.h" #include "chrome/browser/automation/ui_controls.h" @@ -288,7 +290,8 @@ } else { warning_text = l10n_util::GetStringF(IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_WARNING, - product_name_, IntToWString(download_count)); + product_name_, + UTF8ToWide(base::IntToString(download_count))); explanation_text = l10n_util::GetStringF( IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_EXPLANATION, product_name_); Index: chrome/browser/views/wrench_menu.cc =================================================================== --- chrome/browser/views/wrench_menu.cc (revision 54372) +++ chrome/browser/views/wrench_menu.cc (working copy) @@ -8,6 +8,7 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/browser.h" @@ -463,7 +464,8 @@ increment_button_->SetEnabled(enable_increment); decrement_button_->SetEnabled(enable_decrement); zoom_label_->SetText(l10n_util::GetStringF( - IDS_ZOOM_PERCENT, IntToWString(zoom_percent))); + IDS_ZOOM_PERCENT, + UTF8ToWide(base::IntToString(zoom_percent)))); // If both increment and decrement are disabled, then we disable the zoom // label too. zoom_label_->SetEnabled(enable_increment || enable_decrement); Index: chrome/browser/web_resource/web_resource_service.cc =================================================================== --- chrome/browser/web_resource/web_resource_service.cc (revision 54372) +++ chrome/browser/web_resource/web_resource_service.cc (working copy) @@ -5,6 +5,7 @@ #include "base/command_line.h" #include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/time.h" #include "base/utf_string_conversions.h" #include "base/values.h" @@ -273,9 +274,11 @@ std::string last_update_pref = prefs_->GetString(prefs::kNTPTipsCacheUpdate); if (!last_update_pref.empty()) { + double last_update_value; + base::StringToDouble(last_update_pref, &last_update_value); int ms_until_update = kCacheUpdateDelay - static_cast((base::Time::Now() - base::Time::FromDoubleT( - StringToDouble(last_update_pref))).InMilliseconds()); + last_update_value)).InMilliseconds()); delay = ms_until_update > kCacheUpdateDelay ? kCacheUpdateDelay : (ms_until_update < kStartResourceFetchDelay ? @@ -293,6 +296,6 @@ // Update resource server and cache update time in preferences. prefs_->SetString(prefs::kNTPTipsCacheUpdate, - DoubleToString(base::Time::Now().ToDoubleT())); + base::DoubleToString(base::Time::Now().ToDoubleT())); prefs_->SetString(prefs::kNTPTipsServer, web_resource_server_); } Index: chrome/browser/zygote_host_linux.cc =================================================================== --- chrome/browser/zygote_host_linux.cc (revision 54372) +++ chrome/browser/zygote_host_linux.cc (working copy) @@ -160,7 +160,7 @@ 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_); + base::StringToInt(inode_output, &pid_); } } CHECK(pid_ > 0) << "Did not find zygote process (using sandbox binary " Index: chrome/common/extensions/extension.cc =================================================================== --- chrome/common/extensions/extension.cc (revision 54372) +++ chrome/common/extensions/extension.cc (working copy) @@ -211,7 +211,7 @@ SHA256_Update(&ctx, ubuf, input.length()); uint8 hash[Extension::kIdSize]; SHA256_End(&ctx, hash, NULL, sizeof(hash)); - *output = StringToLowerASCII(HexEncode(hash, sizeof(hash))); + *output = StringToLowerASCII(base::HexEncode(hash, sizeof(hash))); ConvertHexadecimalToIDAlphabet(output); return true; Index: chrome/installer/util/version.cc =================================================================== --- chrome/installer/util/version.cc (revision 54372) +++ chrome/installer/util/version.cc (working copy) @@ -2,11 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/installer/util/version.h" + #include #include "base/format_macros.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" -#include "chrome/installer/util/version.h" installer::Version::Version(int64 major, int64 minor, int64 build, int64 patch) @@ -42,6 +44,10 @@ return NULL; } - return new Version(StringToInt64(numbers[0]), StringToInt64(numbers[1]), - StringToInt64(numbers[2]), StringToInt64(numbers[3])); + int64 v0, v1, v2, v3; + base::StringToInt64(numbers[0], &v0); + base::StringToInt64(numbers[1], &v1); + base::StringToInt64(numbers[2], &v2); + base::StringToInt64(numbers[3], &v3); + return new Version(v0, v1, v2, v3); } Index: chrome/renderer/localized_error.cc =================================================================== --- chrome/renderer/localized_error.cc (revision 54372) +++ chrome/renderer/localized_error.cc (working copy) @@ -7,7 +7,7 @@ #include "app/l10n_util.h" #include "base/i18n/rtl.h" #include "base/logging.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/values.h" #include "googleurl/src/gurl.h" #include "grit/generated_resources.h" @@ -183,7 +183,7 @@ std::wstring details = l10n_util::GetString(options.details_resource_id); error_strings->SetString(L"details", l10n_util::GetStringF(IDS_ERRORPAGES_DETAILS_TEMPLATE, - IntToWString(-error_code), + ASCIIToWide(base::IntToString(-error_code)), ASCIIToWide(net::ErrorToString(error_code)), details)); Index: chrome/renderer/webplugin_delegate_pepper.cc =================================================================== --- chrome/renderer/webplugin_delegate_pepper.cc (revision 54372) +++ chrome/renderer/webplugin_delegate_pepper.cc (working copy) @@ -28,6 +28,7 @@ #endif #include "base/scoped_ptr.h" #include "base/stats_counters.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/task.h" #include "base/time.h" @@ -609,7 +610,7 @@ std::string hex_md5 = MD5DigestToBase16(md5_result); // Return the least significant 8 characters (i.e. 4 bytes) // of the 32 character hexadecimal result as an int. - *value = HexStringToInt(hex_md5.substr(24)); + base::HexStringToInt(hex_md5.substr(24), value); return NPERR_NO_ERROR; } return NPERR_GENERIC_ERROR; Index: chrome/test/automation/extension_proxy.cc =================================================================== --- chrome/test/automation/extension_proxy.cc (revision 54372) +++ chrome/test/automation/extension_proxy.cc (working copy) @@ -4,6 +4,7 @@ #include "chrome/test/automation/extension_proxy.h" +#include "base/string_number_conversions.h" #include "chrome/test/automation/automation_messages.h" #include "chrome/test/automation/automation_proxy.h" #include "chrome/test/automation/browser_proxy.h" @@ -94,7 +95,7 @@ // Do not modify |index| until we are sure we can get the value, just to be // nice to the caller. int converted_index; - if (!StringToInt(index_string, &converted_index)) { + if (!base::StringToInt(index_string, &converted_index)) { LOG(ERROR) << "Received index string could not be converted to int: " << index_string; return false; Index: chrome/third_party/mozilla_security_manager/nsNSSCertHelper.cpp =================================================================== --- chrome/third_party/mozilla_security_manager/nsNSSCertHelper.cpp (revision 54372) +++ chrome/third_party/mozilla_security_manager/nsNSSCertHelper.cpp (working copy) @@ -46,6 +46,7 @@ #include "app/l10n_util.h" #include "base/i18n/number_formatting.h" +#include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/third_party/mozilla_security_manager/nsNSSCertTrust.h" #include "grit/generated_resources.h" @@ -712,7 +713,7 @@ if (itemList != notice->noticeReference.noticeNumbers) rv += ", "; rv += '#'; - rv += UTF16ToUTF8(UintToString16(number)); + rv += UTF16ToUTF8(base::UintToString16(number)); } itemList++; } @@ -1073,9 +1074,9 @@ case rsaKey: { rv = l10n_util::GetStringFUTF8( IDS_CERT_RSA_PUBLIC_KEY_DUMP_FORMAT, - UintToString16(key->u.rsa.modulus.len * 8), + base::UintToString16(key->u.rsa.modulus.len * 8), UTF8ToUTF16(ProcessRawBytes(&key->u.rsa.modulus)), - UintToString16(key->u.rsa.publicExponent.len * 8), + base::UintToString16(key->u.rsa.publicExponent.len * 8), UTF8ToUTF16(ProcessRawBytes(&key->u.rsa.publicExponent))); break; } Index: media/filters/ffmpeg_video_decode_engine.cc =================================================================== --- media/filters/ffmpeg_video_decode_engine.cc (revision 54372) +++ media/filters/ffmpeg_video_decode_engine.cc (working copy) @@ -5,7 +5,7 @@ #include "media/filters/ffmpeg_video_decode_engine.h" #include "base/command_line.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "base/task.h" #include "media/base/buffers.h" #include "media/base/callback.h" @@ -69,7 +69,7 @@ const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); std::string threads(cmd_line->GetSwitchValueASCII(switches::kVideoThreads)); if ((!threads.empty() && - !StringToInt(threads, &decode_threads)) || + !base::StringToInt(threads, &decode_threads)) || decode_threads < 0 || decode_threads > kMaxDecodeThreads) { decode_threads = kDecodeThreads; } Index: net/base/net_util.cc =================================================================== --- net/base/net_util.cc (revision 54372) +++ net/base/net_util.cc (working copy) @@ -45,6 +45,7 @@ #include "base/path_service.h" #include "base/singleton.h" #include "base/stl_util-inl.h" +#include "base/string_number_conversions.h" #include "base/string_piece.h" #include "base/string_tokenizer.h" #include "base/string_util.h" @@ -1660,9 +1661,12 @@ return; if (i == size || allowed_ports[i] == kComma) { size_t length = i - last; - if (length > 0) - ports.insert(StringToInt(WideToASCII( - allowed_ports.substr(last, length)))); + if (length > 0) { + int port; + base::StringToInt(WideToUTF8(allowed_ports.substr(last, length)), + &port); + ports.insert(port); + } last = i + 1; } } @@ -1887,7 +1891,7 @@ // Parse the prefix length. int number_of_bits = -1; - if (!StringToInt(parts[1], &number_of_bits)) + if (!base::StringToInt(parts[1], &number_of_bits)) return false; // Make sure the prefix length is in a valid range. Index: net/base/sdch_manager.cc =================================================================== --- net/base/sdch_manager.cc (revision 54372) +++ net/base/sdch_manager.cc (working copy) @@ -2,14 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "net/base/sdch_manager.h" + #include "base/base64.h" #include "base/field_trial.h" #include "base/histogram.h" #include "base/logging.h" #include "base/sha2.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "net/base/registry_controlled_domain.h" -#include "net/base/sdch_manager.h" #include "net/url_request/url_request_http_job.h" using base::Time; @@ -240,9 +242,12 @@ if (value != "1.0") return false; } else if (name == "max-age") { - expiration = Time::Now() + TimeDelta::FromSeconds(StringToInt64(value)); + int64 seconds; + base::StringToInt64(value, &seconds); + expiration = Time::Now() + TimeDelta::FromSeconds(seconds); } else if (name == "port") { - int port = StringToInt(value); + int port; + base::StringToInt(value, &port); if (port >= 0) ports.insert(port); } Index: net/base/transport_security_state.cc =================================================================== --- net/base/transport_security_state.cc (revision 54372) +++ net/base/transport_security_state.cc (working copy) @@ -10,6 +10,7 @@ #include "base/logging.h" #include "base/scoped_ptr.h" #include "base/sha2.h" +#include "base/string_number_conversions.h" #include "base/string_tokenizer.h" #include "base/string_util.h" #include "base/values.h" @@ -140,7 +141,7 @@ case AFTER_MAX_AGE_EQUALS: if (IsAsciiWhitespace(*tokenizer.token_begin())) continue; - if (!StringToInt(tokenizer.token(), &max_age_candidate)) + if (!base::StringToInt(tokenizer.token(), &max_age_candidate)) return false; if (max_age_candidate < 0) return false; Index: net/ftp/ftp_ctrl_response_buffer.cc =================================================================== --- net/ftp/ftp_ctrl_response_buffer.cc (revision 54372) +++ net/ftp/ftp_ctrl_response_buffer.cc (working copy) @@ -5,7 +5,8 @@ #include "net/ftp/ftp_ctrl_response_buffer.h" #include "base/logging.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" +//#include "base/string_util.h" #include "net/base/net_errors.h" namespace net { @@ -69,7 +70,7 @@ ParsedLine result; if (line.length() >= 3) { - if (StringToInt(line.substr(0, 3), &result.status_code)) + if (base::StringToInt(line.substr(0, 3), &result.status_code)) result.has_status_code = (100 <= result.status_code && result.status_code <= 599); if (result.has_status_code && line.length() >= 4 && line[3] == ' ') { Index: net/ftp/ftp_directory_listing_parser_ls.cc =================================================================== --- net/ftp/ftp_directory_listing_parser_ls.cc (revision 54372) +++ net/ftp/ftp_directory_listing_parser_ls.cc (working copy) @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this +// 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,6 +6,7 @@ #include +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "net/ftp/ftp_util.h" @@ -107,7 +108,7 @@ received_total_line_ = true; int total_number; - if (!StringToInt(columns[1], &total_number)) + if (!base::StringToInt(columns[1], &total_number)) return false; if (total_number < 0) return false; @@ -137,7 +138,7 @@ entry.type = FtpDirectoryListingEntry::FILE; } - if (!StringToInt64(columns[2 + column_offset], &entry.size)) + if (!base::StringToInt64(columns[2 + column_offset], &entry.size)) return false; if (entry.size < 0) return false; Index: net/ftp/ftp_directory_listing_parser_mlsd.cc =================================================================== --- net/ftp/ftp_directory_listing_parser_mlsd.cc (revision 54372) +++ net/ftp/ftp_directory_listing_parser_mlsd.cc (working copy) @@ -8,6 +8,7 @@ #include #include "base/stl_util-inl.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" @@ -26,15 +27,15 @@ if (text.length() < 14) return false; - if (!StringToInt(text.substr(0, 4), &time_exploded.year)) + if (!base::StringToInt(text.substr(0, 4), &time_exploded.year)) return false; - if (!StringToInt(text.substr(4, 2), &time_exploded.month)) + if (!base::StringToInt(text.substr(4, 2), &time_exploded.month)) return false; - if (!StringToInt(text.substr(6, 2), &time_exploded.day_of_month)) + if (!base::StringToInt(text.substr(6, 2), &time_exploded.day_of_month)) return false; - if (!StringToInt(text.substr(8, 2), &time_exploded.hour)) + if (!base::StringToInt(text.substr(8, 2), &time_exploded.hour)) return false; - if (!StringToInt(text.substr(10, 2), &time_exploded.minute)) + if (!base::StringToInt(text.substr(10, 2), &time_exploded.minute)) return false; // We don't know the time zone of the server, so just use local time. Index: net/ftp/ftp_directory_listing_parser_netware.cc =================================================================== --- net/ftp/ftp_directory_listing_parser_netware.cc (revision 54372) +++ net/ftp/ftp_directory_listing_parser_netware.cc (working copy) @@ -6,6 +6,7 @@ #include +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "net/ftp/ftp_util.h" @@ -68,7 +69,7 @@ if (!LooksLikeNetwarePermissionsListing(columns[1])) return false; - if (!StringToInt64(columns[3], &entry.size)) + if (!base::StringToInt64(columns[3], &entry.size)) return false; if (entry.size < 0) return false; Index: net/ftp/ftp_directory_listing_parser_vms.cc =================================================================== --- net/ftp/ftp_directory_listing_parser_vms.cc (revision 54372) +++ net/ftp/ftp_directory_listing_parser_vms.cc (working copy) @@ -6,8 +6,9 @@ #include +#include "base/string_number_conversions.h" +#include "base/utf_string_conversions.h" #include "base/string_util.h" -#include "base/utf_string_conversions.h" #include "net/ftp/ftp_util.h" namespace { @@ -23,7 +24,7 @@ if (listing_parts.size() != 2) return false; int version_number; - if (!StringToInt(listing_parts[1], &version_number)) + if (!base::StringToInt(listing_parts[1], &version_number)) return false; if (version_number < 0) return false; @@ -126,12 +127,12 @@ SplitString(columns[1], '-', &date_parts); if (date_parts.size() != 3) return false; - if (!StringToInt(date_parts[0], &time_exploded.day_of_month)) + if (!base::StringToInt(date_parts[0], &time_exploded.day_of_month)) return false; if (!net::FtpUtil::ThreeLetterMonthToNumber(date_parts[1], &time_exploded.month)) return false; - if (!StringToInt(date_parts[2], &time_exploded.year)) + if (!base::StringToInt(date_parts[2], &time_exploded.year)) return false; // Time can be in format HH:MM, HH:MM:SS, or HH:MM:SS.mm. Try to recognize the @@ -147,9 +148,9 @@ SplitString(time_column, ':', &time_parts); if (time_parts.size() != 2) return false; - if (!StringToInt(time_parts[0], &time_exploded.hour)) + if (!base::StringToInt(time_parts[0], &time_exploded.hour)) return false; - if (!StringToInt(time_parts[1], &time_exploded.minute)) + if (!base::StringToInt(time_parts[1], &time_exploded.minute)) return false; // We don't know the time zone of the server, so just use local time. Index: net/ftp/ftp_directory_listing_parser_windows.cc =================================================================== --- net/ftp/ftp_directory_listing_parser_windows.cc (revision 54372) +++ net/ftp/ftp_directory_listing_parser_windows.cc (working copy) @@ -6,6 +6,7 @@ #include +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "net/ftp/ftp_util.h" @@ -22,11 +23,11 @@ SplitString(columns[0], '-', &date_parts); if (date_parts.size() != 3) return false; - if (!StringToInt(date_parts[0], &time_exploded.month)) + if (!base::StringToInt(date_parts[0], &time_exploded.month)) return false; - if (!StringToInt(date_parts[1], &time_exploded.day_of_month)) + if (!base::StringToInt(date_parts[1], &time_exploded.day_of_month)) return false; - if (!StringToInt(date_parts[2], &time_exploded.year)) + if (!base::StringToInt(date_parts[2], &time_exploded.year)) return false; if (time_exploded.year < 0) return false; @@ -44,9 +45,9 @@ SplitString(columns[1].substr(0, 5), ':', &time_parts); if (time_parts.size() != 2) return false; - if (!StringToInt(time_parts[0], &time_exploded.hour)) + if (!base::StringToInt(time_parts[0], &time_exploded.hour)) return false; - if (!StringToInt(time_parts[1], &time_exploded.minute)) + if (!base::StringToInt(time_parts[1], &time_exploded.minute)) return false; if (!time_exploded.HasValidValues()) return false; @@ -91,7 +92,7 @@ entry.size = -1; } else { entry.type = FtpDirectoryListingEntry::FILE; - if (!StringToInt64(columns[2], &entry.size)) + if (!base::StringToInt64(columns[2], &entry.size)) return false; if (entry.size < 0) return false; Index: net/ftp/ftp_network_transaction.cc =================================================================== --- net/ftp/ftp_network_transaction.cc (revision 54372) +++ net/ftp/ftp_network_transaction.cc (working copy) @@ -6,6 +6,7 @@ #include "base/compiler_specific.h" #include "base/histogram.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "net/base/connection_type_histograms.h" @@ -978,7 +979,7 @@ if (response.lines.size() != 1) return Stop(ERR_INVALID_RESPONSE); int64 size; - if (!StringToInt64(response.lines[0], &size)) + if (!base::StringToInt64(response.lines[0], &size)) return Stop(ERR_INVALID_RESPONSE); if (size < 0) return Stop(ERR_INVALID_RESPONSE); Index: net/ftp/ftp_util.cc =================================================================== --- net/ftp/ftp_util.cc (revision 54372) +++ net/ftp/ftp_util.cc (working copy) @@ -7,6 +7,7 @@ #include #include "base/logging.h" +#include "base/string_number_conversions.h" #include "base/string_tokenizer.h" #include "base/string_util.h" #include "base/time.h" @@ -155,18 +156,18 @@ if (!ThreeLetterMonthToNumber(month, &time_exploded.month)) return false; - if (!StringToInt(day, &time_exploded.day_of_month)) + if (!base::StringToInt(day, &time_exploded.day_of_month)) return false; - if (!StringToInt(rest, &time_exploded.year)) { + if (!base::StringToInt(rest, &time_exploded.year)) { // Maybe it's time. Does it look like time (MM:HH)? if (rest.length() != 5 || rest[2] != ':') return false; - if (!StringToInt(rest.substr(0, 2), &time_exploded.hour)) + if (!base::StringToInt(rest.substr(0, 2), &time_exploded.hour)) return false; - if (!StringToInt(rest.substr(3, 2), &time_exploded.minute)) + if (!base::StringToInt(rest.substr(3, 2), &time_exploded.minute)) return false; // Guess the year. Index: net/http/http_chunked_decoder.cc =================================================================== --- net/http/http_chunked_decoder.cc (revision 54372) +++ net/http/http_chunked_decoder.cc (working copy) @@ -41,6 +41,7 @@ #include "net/http/http_chunked_decoder.h" #include "base/logging.h" +#include "base/string_number_conversions.h" #include "base/string_piece.h" #include "base/string_util.h" #include "net/base/net_errors.h" @@ -188,7 +189,7 @@ return false; int parsed_number; - bool ok = HexStringToInt(std::string(start, len), &parsed_number); + bool ok = base::HexStringToInt(std::string(start, len), &parsed_number); if (ok && parsed_number >= 0) { *out = parsed_number; return true; Index: net/http/http_network_transaction.cc =================================================================== --- net/http/http_network_transaction.cc (revision 54372) +++ net/http/http_network_transaction.cc (working copy) @@ -100,7 +100,7 @@ if (upload_data_stream) { request_headers->SetHeader( HttpRequestHeaders::kContentLength, - Uint64ToString(upload_data_stream->size())); + base::Uint64ToString(upload_data_stream->size())); } else if (request_info->method == "POST" || request_info->method == "PUT" || request_info->method == "HEAD") { // An empty POST/PUT request still needs a content length. As for HEAD, @@ -156,7 +156,7 @@ } int port; - if (!StringToInt(port_protocol_vector[0], &port) || + if (!base::StringToInt(port_protocol_vector[0], &port) || port <= 0 || port >= 1 << 16) { DLOG(WARNING) << HttpAlternateProtocols::kHeader << " header has unrecognizable port: " Index: net/http/http_response_headers.cc =================================================================== --- net/http/http_response_headers.cc (revision 54372) +++ net/http/http_response_headers.cc (working copy) @@ -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. @@ -13,6 +13,7 @@ #include "base/logging.h" #include "base/pickle.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/time.h" #include "net/base/escape.h" @@ -591,7 +592,7 @@ raw_headers_.push_back(' '); raw_headers_.append(code, p); raw_headers_.push_back(' '); - response_code_ = static_cast(StringToInt64(std::string(code, p))); + base::StringToInt(std::string(code, p), &response_code_); // Skip whitespace. while (*p == ' ') @@ -965,8 +966,9 @@ if (LowerCaseEqualsASCII(value.begin(), value.begin() + kMaxAgePrefixLen, kMaxAgePrefix)) { - *result = TimeDelta::FromSeconds( - StringToInt64(value.substr(kMaxAgePrefixLen))); + int64 seconds; + base::StringToInt64(value.substr(kMaxAgePrefixLen), &seconds); + *result = TimeDelta::FromSeconds(seconds); return true; } } @@ -980,7 +982,9 @@ if (!EnumerateHeader(NULL, "Age", &value)) return false; - *result = TimeDelta::FromSeconds(StringToInt64(value)); + int64 seconds; + base::StringToInt64(value, &seconds); + *result = TimeDelta::FromSeconds(seconds); return true; } @@ -1071,7 +1075,7 @@ return -1; int64 result; - bool ok = StringToInt64(content_length_val, &result); + bool ok = base::StringToInt64(content_length_val, &result); if (!ok || result < 0) return -1; @@ -1138,7 +1142,7 @@ byte_range_resp_spec.begin() + minus_position; HttpUtil::TrimLWS(&first_byte_pos_begin, &first_byte_pos_end); - bool ok = StringToInt64( + bool ok = base::StringToInt64( std::string(first_byte_pos_begin, first_byte_pos_end), first_byte_position); @@ -1149,7 +1153,7 @@ byte_range_resp_spec.end(); HttpUtil::TrimLWS(&last_byte_pos_begin, &last_byte_pos_end); - ok &= StringToInt64( + ok &= base::StringToInt64( std::string(last_byte_pos_begin, last_byte_pos_end), last_byte_position); if (!ok) { @@ -1174,7 +1178,7 @@ if (LowerCaseEqualsASCII(instance_length_begin, instance_length_end, "*")) { return false; - } else if (!StringToInt64( + } else if (!base::StringToInt64( std::string(instance_length_begin, instance_length_end), instance_length)) { *instance_length = -1; Index: net/http/http_util.cc =================================================================== --- net/http/http_util.cc (revision 54372) +++ net/http/http_util.cc (working copy) @@ -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,6 +10,7 @@ #include #include "base/logging.h" +#include "base/string_number_conversions.h" #include "base/string_piece.h" #include "base/string_util.h" #include "net/base/net_util.h" @@ -244,7 +245,7 @@ // Try to obtain first-byte-pos. if (!first_byte_pos.empty()) { int64 first_byte_position = -1; - if (!StringToInt64(first_byte_pos, &first_byte_position)) + if (!base::StringToInt64(first_byte_pos, &first_byte_position)) return false; range.set_first_byte_position(first_byte_position); } @@ -259,7 +260,7 @@ // We have last-byte-pos or suffix-byte-range-spec in this case. if (!last_byte_pos.empty()) { int64 last_byte_position; - if (!StringToInt64(last_byte_pos, &last_byte_position)) + if (!base::StringToInt64(last_byte_pos, &last_byte_position)) return false; if (range.HasFirstBytePosition()) range.set_last_byte_position(last_byte_position); Index: net/proxy/proxy_bypass_rules.cc =================================================================== --- net/proxy/proxy_bypass_rules.cc (revision 54372) +++ net/proxy/proxy_bypass_rules.cc (working copy) @@ -5,6 +5,7 @@ #include "net/proxy/proxy_bypass_rules.h" #include "base/logging.h" +#include "base/string_number_conversions.h" #include "base/string_tokenizer.h" #include "base/string_util.h" #include "net/base/net_util.h" @@ -253,7 +254,7 @@ host = raw; port = -1; if (pos_colon != std::string::npos) { - if (!StringToInt(raw.substr(pos_colon + 1), &port) || + if (!base::StringToInt(raw.substr(pos_colon + 1), &port) || (port < 0 || port > 0xFFFF)) { return false; // Port was invalid. } Index: net/proxy/proxy_config_service_linux.cc =================================================================== --- net/proxy/proxy_config_service_linux.cc (revision 54372) +++ net/proxy/proxy_config_service_linux.cc (working copy) @@ -633,7 +633,9 @@ const char* mode = "none"; indirect_manual_ = false; auto_no_pac_ = false; - switch (StringToInt(value)) { + int int_value; + base::StringToInt(value, &int_value); + switch (int_value) { case 0: // No proxy, or maybe kioslaverc syntax error. break; case 1: // Manual configuration. @@ -664,12 +666,15 @@ // We count "true" or any nonzero number as true, otherwise false. // Note that if the value is not actually numeric StringToInt() // will return 0, which we count as false. - reversed_bypass_list_ = (value == "true" || StringToInt(value)); + int int_value; + base::StringToInt(value, &int_value); + reversed_bypass_list_ = (value == "true" || int_value); } else if (key == "NoProxyFor") { AddHostList("/system/http_proxy/ignore_hosts", value); } else if (key == "AuthMode") { // Check for authentication, just so we can warn. - int mode = StringToInt(value); + int mode; + base::StringToInt(value, &mode); if (mode) { // ProxyConfig does not support authentication parameters, but // Chrome will prompt for the password later. So we ignore this. Index: net/server/http_listen_socket.cc =================================================================== --- net/server/http_listen_socket.cc (revision 54372) +++ net/server/http_listen_socket.cc (working copy) @@ -13,6 +13,7 @@ #include "base/compiler_specific.h" #include "base/logging.h" #include "base/md5.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "net/server/http_listen_socket.h" #include "net/server/http_server_request_info.h" @@ -81,7 +82,7 @@ if (spaces == 0) return 0; int64 number = 0; - if (!StringToInt64(result, &number)) + if (!base::StringToInt64(result, &number)) return 0; return htonl(static_cast(number / spaces)); } Index: net/test/test_server.h =================================================================== --- net/test/test_server.h (revision 54372) +++ net/test/test_server.h (working copy) @@ -14,7 +14,8 @@ #include "base/file_path.h" #include "base/process_util.h" #include "base/ref_counted.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" +//#include "base/string_util.h" #include "googleurl/src/gurl.h" #if defined(OS_WIN) @@ -197,7 +198,7 @@ scheme_.push_back('s'); host_name_ = host_name; - port_str_ = IntToString(port); + port_str_ = base::IntToString(port); return true; } Index: net/url_request/url_request_job.cc =================================================================== --- net/url_request/url_request_job.cc (revision 54372) +++ net/url_request/url_request_job.cc (working copy) @@ -6,6 +6,7 @@ #include "base/histogram.h" #include "base/message_loop.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "net/base/auth.h" #include "net/base/io_buffer.h" @@ -495,7 +496,7 @@ std::string content_length; request_->GetResponseHeaderByName("content-length", &content_length); if (!content_length.empty()) - expected_content_size_ = StringToInt64(content_length); + base::StringToInt64(content_length, &expected_content_size_); } else { // Chrome today only sends "Accept-Encoding" for compression schemes. // So, if there is a filter on the response, we know that the content Index: net/websockets/websocket_throttle.cc =================================================================== --- net/websockets/websocket_throttle.cc (revision 54372) +++ net/websockets/websocket_throttle.cc (working copy) @@ -10,7 +10,7 @@ #include "base/message_loop.h" #include "base/ref_counted.h" #include "base/singleton.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "net/base/io_buffer.h" #include "net/base/sys_addrinfo.h" #include "net/socket_stream/socket_stream.h" @@ -25,21 +25,21 @@ reinterpret_cast(addrinfo->ai_addr); return StringPrintf("%d:%s", addrinfo->ai_family, - HexEncode(&addr->sin_addr, 4).c_str()); + base::HexEncode(&addr->sin_addr, 4).c_str()); } case AF_INET6: { const struct sockaddr_in6* const addr6 = reinterpret_cast(addrinfo->ai_addr); return StringPrintf("%d:%s", addrinfo->ai_family, - HexEncode(&addr6->sin6_addr, - sizeof(addr6->sin6_addr)).c_str()); + base::HexEncode(&addr6->sin6_addr, + sizeof(addr6->sin6_addr)).c_str()); } default: return StringPrintf("%d:%s", addrinfo->ai_family, - HexEncode(addrinfo->ai_addr, - addrinfo->ai_addrlen).c_str()); + base::HexEncode(addrinfo->ai_addr, + addrinfo->ai_addrlen).c_str()); } } Index: printing/image.cc =================================================================== --- printing/image.cc (revision 54372) +++ printing/image.cc (working copy) @@ -6,7 +6,7 @@ #include "base/file_util.h" #include "base/md5.h" -#include "base/string_util.h" +#include "base/string_number_conversions.h" #include "gfx/codec/png_codec.h" #include "gfx/rect.h" #include "skia/ext/platform_device.h" @@ -96,7 +96,7 @@ std::string Image::checksum() const { MD5Digest digest; MD5Sum(&data_[0], data_.size(), &digest); - return HexEncode(&digest, sizeof(digest)); + return base::HexEncode(&digest, sizeof(digest)); } bool Image::SaveToPng(const FilePath& filepath) const { Index: printing/page_overlays.cc =================================================================== --- printing/page_overlays.cc (revision 54372) +++ printing/page_overlays.cc (working copy) @@ -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. @@ -6,6 +6,7 @@ #include "app/text_elider.h" #include "base/logging.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "printing/printed_document.h" @@ -169,21 +170,21 @@ offset = ReplaceKey(&output, offset, wcslen(kPage), - IntToWString(page.page_number())); + UTF8ToWide(base::IntToString(page.page_number()))); } else if (0 == output.compare(offset, wcslen(kPageCount), kPageCount)) { offset = ReplaceKey(&output, offset, wcslen(kPageCount), - IntToWString(document.page_count())); + UTF8ToWide(base::IntToString(document.page_count()))); } else if (0 == output.compare(offset, wcslen(kPageOnTotal), kPageOnTotal)) { std::wstring replacement; - replacement = IntToWString(page.page_number()); + replacement = UTF8ToWide(base::IntToString(page.page_number())); replacement += L"/"; - replacement += IntToWString(document.page_count()); + replacement += UTF8ToWide(base::IntToString(document.page_count())); offset = ReplaceKey(&output, offset, wcslen(kPageOnTotal), Index: webkit/database/database_tracker.cc =================================================================== --- webkit/database/database_tracker.cc (revision 54372) +++ webkit/database/database_tracker.cc (working copy) @@ -214,7 +214,8 @@ if (id < 0) return FilePath(); - FilePath file_name = FilePath::FromWStringHack(Int64ToWString(id)); + FilePath file_name = FilePath::FromWStringHack( + UTF8ToWide(base::Int64ToString(id))); return db_dir_.Append(FilePath::FromWStringHack( UTF16ToWide(GetOriginDirectory(origin_identifier)))).Append(file_name); }