diff options
138 files changed, 254 insertions, 259 deletions
diff --git a/android_webview/native/aw_web_contents_delegate.cc b/android_webview/native/aw_web_contents_delegate.cc index 1d22633..bc7e026 100644 --- a/android_webview/native/aw_web_contents_delegate.cc +++ b/android_webview/native/aw_web_contents_delegate.cc @@ -16,7 +16,6 @@ #include "base/lazy_instance.h" #include "base/message_loop/message_loop.h" #include "base/strings/string_util.h" -#include "base/strings/utf_string_conversions.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" @@ -115,7 +114,7 @@ void AwWebContentsDelegate::RunFileChooser(WebContents* web_contents, web_contents->GetRenderViewHost()->GetRoutingID(), mode_flags, ConvertUTF16ToJavaString(env, - base::JoinString(params.accept_types, base::ASCIIToUTF16(","))).obj(), + JoinString(params.accept_types, ',')).obj(), params.title.empty() ? NULL : ConvertUTF16ToJavaString(env, params.title).obj(), params.default_file_name.empty() ? NULL : @@ -294,7 +293,7 @@ static void FilesSelectedInChooser( mode = FileChooserParams::Open; } DVLOG(0) << "File Chooser result: mode = " << mode - << ", file paths = " << base::JoinString(file_path_str, ":"); + << ", file paths = " << JoinString(file_path_str, ":"); rvh->FilesSelectedInChooser(files, mode); } diff --git a/ash/system/chromeos/tray_display.cc b/ash/system/chromeos/tray_display.cc index 20040ec..9419b77 100644 --- a/ash/system/chromeos/tray_display.cc +++ b/ash/system/chromeos/tray_display.cc @@ -108,7 +108,7 @@ base::string16 GetAllDisplayInfo() { lines.push_back(GetDisplayInfoLine(id)); } - return base::JoinString(lines, base::ASCIIToUTF16("\n")); + return JoinString(lines, '\n'); } void OpenSettings() { diff --git a/ash/system/chromeos/tray_display_unittest.cc b/ash/system/chromeos/tray_display_unittest.cc index f6c205f..bef870e 100644 --- a/ash/system/chromeos/tray_display_unittest.cc +++ b/ash/system/chromeos/tray_display_unittest.cc @@ -46,7 +46,7 @@ base::string16 GetTooltipText(const base::string16& headline, IDS_ASH_STATUS_TRAY_DISPLAY_SINGLE_DISPLAY, name2, base::UTF8ToUTF16(data2))); } - return base::JoinString(lines, base::ASCIIToUTF16("\n")); + return JoinString(lines, '\n'); } base::string16 GetMirroredTooltipText(const base::string16& headline, diff --git a/ash/system/user/button_from_view.cc b/ash/system/user/button_from_view.cc index b3c434d..c48401c 100644 --- a/ash/system/user/button_from_view.cc +++ b/ash/system/user/button_from_view.cc @@ -89,7 +89,7 @@ void ButtonFromView::GetAccessibleState(ui::AXViewState* state) { std::vector<base::string16> labels; for (int i = 0; i < child_count(); ++i) GetAccessibleLabelFromDescendantViews(child_at(i), labels); - state->name = base::JoinString(labels, base::ASCIIToUTF16(" ")); + state->name = JoinString(labels, base::ASCIIToUTF16(" ")); } void ButtonFromView::ShowActive() { diff --git a/ash/system/user/user_card_view.cc b/ash/system/user/user_card_view.cc index 5201688..3844251 100644 --- a/ash/system/user/user_card_view.cc +++ b/ash/system/user/user_card_view.cc @@ -355,7 +355,7 @@ void UserCardView::GetAccessibleState(ui::AXViewState* state) { std::vector<base::string16> labels; for (int i = 0; i < child_count(); ++i) GetAccessibleLabelFromDescendantViews(child_at(i), labels); - state->name = base::JoinString(labels, base::ASCIIToUTF16(" ")); + state->name = JoinString(labels, base::ASCIIToUTF16(" ")); } void UserCardView::AddPublicModeUserContent(int max_width) { diff --git a/base/debug/crash_logging.cc b/base/debug/crash_logging.cc index 058b476..f9b4449 100644 --- a/base/debug/crash_logging.cc +++ b/base/debug/crash_logging.cc @@ -119,7 +119,7 @@ void SetCrashKeyFromAddresses(const base::StringPiece& key, hex_backtrace.push_back(s); } - value = base::JoinString(hex_backtrace, " "); + value = JoinString(hex_backtrace, ' '); // Warn if this exceeds the breakpad limits. DCHECK_LE(value.length(), kBreakpadValueMax); diff --git a/base/strings/string_util.cc b/base/strings/string_util.cc index a0c95ec..ae5fb80 100644 --- a/base/strings/string_util.cc +++ b/base/strings/string_util.cc @@ -884,36 +884,43 @@ char16* WriteInto(base::string16* str, size_t length_with_null) { return WriteIntoT(str, length_with_null); } +} // namespace base + template<typename STR> -static STR JoinStringT(const std::vector<STR>& parts, - BasicStringPiece<STR> sep) { +static STR JoinStringT(const std::vector<STR>& parts, const STR& sep) { if (parts.empty()) return STR(); STR result(parts[0]); - auto iter = parts.begin(); + typename std::vector<STR>::const_iterator iter = parts.begin(); ++iter; for (; iter != parts.end(); ++iter) { - sep.AppendToString(&result); + result += sep; result += *iter; } return result; } +std::string JoinString(const std::vector<std::string>& parts, char sep) { + return JoinStringT(parts, std::string(1, sep)); +} + +string16 JoinString(const std::vector<string16>& parts, char16 sep) { + return JoinStringT(parts, string16(1, sep)); +} + std::string JoinString(const std::vector<std::string>& parts, - StringPiece separator) { + const std::string& separator) { return JoinStringT(parts, separator); } string16 JoinString(const std::vector<string16>& parts, - StringPiece16 separator) { + const string16& separator) { return JoinStringT(parts, separator); } -} // namespace base - template<class FormatStringType, class OutStringType> OutStringType DoReplaceStringPlaceholders(const FormatStringType& format_string, const std::vector<OutStringType>& subst, std::vector<size_t>* offsets) { diff --git a/base/strings/string_util.h b/base/strings/string_util.h index b75a9f88..e4abce2 100644 --- a/base/strings/string_util.h +++ b/base/strings/string_util.h @@ -491,12 +491,6 @@ BASE_EXPORT char16* WriteInto(base::string16* str, size_t length_with_null); BASE_EXPORT wchar_t* WriteInto(std::wstring* str, size_t length_with_null); #endif -// Does the opposite of SplitString(). -BASE_EXPORT std::string JoinString(const std::vector<std::string>& parts, - StringPiece separator); -BASE_EXPORT string16 JoinString(const std::vector<string16>& parts, - StringPiece16 separator); - } // namespace base #if defined(OS_WIN) @@ -507,6 +501,22 @@ BASE_EXPORT string16 JoinString(const std::vector<string16>& parts, #error Define string operations appropriately for your platform #endif +//----------------------------------------------------------------------------- + +// Does the opposite of SplitString(). +BASE_EXPORT base::string16 JoinString(const std::vector<base::string16>& parts, + base::char16 s); +BASE_EXPORT std::string JoinString( + const std::vector<std::string>& parts, char s); + +// Join |parts| using |separator|. +BASE_EXPORT std::string JoinString( + const std::vector<std::string>& parts, + const std::string& separator); +BASE_EXPORT base::string16 JoinString( + const std::vector<base::string16>& parts, + const base::string16& separator); + // Replace $1-$2-$3..$9 in the format string with |a|-|b|-|c|..|i| respectively. // Additionally, any number of consecutive '$' characters is replaced by that // number less one. Eg $$->$, $$$->$$, etc. The offsets parameter here can be diff --git a/base/strings/string_util_unittest.cc b/base/strings/string_util_unittest.cc index 5d5ba8b..1593f81 100644 --- a/base/strings/string_util_unittest.cc +++ b/base/strings/string_util_unittest.cc @@ -669,7 +669,26 @@ TEST(StringUtilTest, HexDigitToInt) { EXPECT_EQ(15, HexDigitToInt('f')); } +// Test for JoinString TEST(StringUtilTest, JoinString) { + std::vector<std::string> in; + EXPECT_EQ("", JoinString(in, ',')); + + in.push_back("a"); + EXPECT_EQ("a", JoinString(in, ',')); + + in.push_back("b"); + in.push_back("c"); + EXPECT_EQ("a,b,c", JoinString(in, ',')); + + in.push_back(std::string()); + EXPECT_EQ("a,b,c,", JoinString(in, ',')); + in.push_back(" "); + EXPECT_EQ("a|b|c|| ", JoinString(in, '|')); +} + +// Test for JoinString overloaded with std::string separator +TEST(StringUtilTest, JoinStringWithString) { std::string separator(", "); std::vector<std::string> parts; EXPECT_EQ(std::string(), JoinString(parts, separator)); @@ -687,7 +706,8 @@ TEST(StringUtilTest, JoinString) { EXPECT_EQ("a|b|c|| ", JoinString(parts, "|")); } -TEST(StringUtilTest, JoinString16) { +// Test for JoinString overloaded with string16 separator +TEST(StringUtilTest, JoinStringWithString16) { string16 separator = ASCIIToUTF16(", "); std::vector<string16> parts; EXPECT_EQ(string16(), JoinString(parts, separator)); diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc index 7c0bc4e..2a56b6c 100644 --- a/base/test/launcher/test_launcher.cc +++ b/base/test/launcher/test_launcher.cc @@ -570,7 +570,7 @@ void TestLauncher::OnTestFinished(const TestResult& result) { snippet_lines.begin() + truncated_size); snippet_lines.insert(snippet_lines.begin(), "<truncated>"); } - fprintf(stdout, "%s", base::JoinString(snippet_lines, "\n").c_str()); + fprintf(stdout, "%s", JoinString(snippet_lines, "\n").c_str()); fflush(stdout); } diff --git a/base/test/launcher/test_launcher_ios.cc b/base/test/launcher/test_launcher_ios.cc index 3179bb3..ecd31ae 100644 --- a/base/test/launcher/test_launcher_ios.cc +++ b/base/test/launcher/test_launcher_ios.cc @@ -121,7 +121,7 @@ class IOSUnitTestPlatformDelegate : public base::UnitTestPlatformDelegate { base::CommandLine cmd_line(dir_exe_.AppendASCII(test_name_ + ".app")); cmd_line.AppendSwitchPath(switches::kTestLauncherOutput, output_file); cmd_line.AppendSwitchASCII(base::kGTestFilterFlag, - base::JoinString(test_names, ":")); + JoinString(test_names, ":")); return cmd_line; } diff --git a/base/test/launcher/test_launcher_nacl_nonsfi.cc b/base/test/launcher/test_launcher_nacl_nonsfi.cc index bf117af..fa52604 100644 --- a/base/test/launcher/test_launcher_nacl_nonsfi.cc +++ b/base/test/launcher/test_launcher_nacl_nonsfi.cc @@ -113,7 +113,7 @@ class NonSfiUnitTestPlatformDelegate : public base::UnitTestPlatformDelegate { cmd_line.AppendSwitchPath( switches::kTestLauncherOutput, output_file); cmd_line.AppendSwitchASCII( - base::kGTestFilterFlag, base::JoinString(test_names, ":")); + base::kGTestFilterFlag, JoinString(test_names, ":")); return cmd_line; } diff --git a/base/trace_event/trace_event_impl.cc b/base/trace_event/trace_event_impl.cc index cd8cf4a..f01a888 100644 --- a/base/trace_event/trace_event_impl.cc +++ b/base/trace_event/trace_event_impl.cc @@ -2352,7 +2352,7 @@ void TraceLog::AddMetadataEventsWhileLocked() { InitializeMetadataEvent(AddEventToThreadSharedChunkWhileLocked(NULL, false), current_thread_id, "process_labels", "labels", - base::JoinString(labels, ",")); + JoinString(labels, ',')); } // Thread sort indices. diff --git a/chrome/browser/android/preferences/pref_service_bridge.cc b/chrome/browser/android/preferences/pref_service_bridge.cc index 1d85d79..5b13882 100644 --- a/chrome/browser/android/preferences/pref_service_bridge.cc +++ b/chrome/browser/android/preferences/pref_service_bridge.cc @@ -835,7 +835,7 @@ void PrefServiceBridge::PrependToAcceptLanguagesIfNecessary( parts.push_back(language); } parts.push_back(*accept_languages); - *accept_languages = base::JoinString(parts, ","); + *accept_languages = JoinString(parts, ','); } } diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 163c614..e00b5e1 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -1231,7 +1231,7 @@ void MaybeAppendBlinkSettingsSwitchForFieldTrial( } command_line->AppendSwitchASCII(switches::kBlinkSettings, - base::JoinString(blink_settings, ",")); + JoinString(blink_settings, ',')); } } // namespace diff --git a/chrome/browser/chromeos/accessibility/accessibility_manager.cc b/chrome/browser/chromeos/accessibility/accessibility_manager.cc index 993d426..279bf3b 100644 --- a/chrome/browser/chromeos/accessibility/accessibility_manager.cc +++ b/chrome/browser/chromeos/accessibility/accessibility_manager.cc @@ -845,7 +845,7 @@ void AccessibilityManager::UpdateBrailleImeState() { else preload_engines.erase(it); pref_service->SetString(prefs::kLanguagePreloadEngines, - base::JoinString(preload_engines, ",")); + JoinString(preload_engines, ',')); braille_ime_current_ = false; } diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc index 89a42bb..bff428c 100644 --- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc +++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc @@ -610,8 +610,7 @@ void InputMethodManagerImpl::StateImpl::SetInputMethodLoginDefaultFromVPD( manager_->MigrateInputMethods(&layouts); PrefService* prefs = g_browser_process->local_state(); - prefs->SetString(prefs::kHardwareKeyboardLayout, - base::JoinString(layouts, ",")); + prefs->SetString(prefs::kHardwareKeyboardLayout, JoinString(layouts, ",")); // This asks the file thread to save the prefs (i.e. doesn't block). // The latest values of Local State reside in memory so we can safely diff --git a/chrome/browser/chromeos/input_method/input_method_syncer.cc b/chrome/browser/chromeos/input_method/input_method_syncer.cc index 6823f23..b76080c 100644 --- a/chrome/browser/chromeos/input_method/input_method_syncer.cc +++ b/chrome/browser/chromeos/input_method/input_method_syncer.cc @@ -92,7 +92,7 @@ std::string CheckAndResolveLocales(const std::string& languages) { value_iter = values.erase(value_iter); } - return base::JoinString(values, ","); + return JoinString(values, ','); } // Appends tokens from |src| that are not in |dest| to |dest|. @@ -197,14 +197,14 @@ void InputMethodSyncer::MergeSyncedPrefs() { // Append the synced values to the current values. MergeLists(&new_tokens, synced_tokens); - preferred_languages_syncable_.SetValue(base::JoinString(new_tokens, ",")); + preferred_languages_syncable_.SetValue(JoinString(new_tokens, ',')); base::SplitString( enabled_extension_imes_syncable_.GetValue(), ',', &synced_tokens); base::SplitString(enabled_extension_imes_.GetValue(), ',', &new_tokens); MergeLists(&new_tokens, synced_tokens); - enabled_extension_imes_syncable_.SetValue(base::JoinString(new_tokens, ",")); + enabled_extension_imes_syncable_.SetValue(JoinString(new_tokens, ',')); // Revert preload engines to legacy component IDs. base::SplitString(preload_engines_.GetValue(), ',', &new_tokens); @@ -214,7 +214,7 @@ void InputMethodSyncer::MergeSyncedPrefs() { preload_engines_syncable_.GetValue(), ',', &synced_tokens); MergeLists(&new_tokens, synced_tokens); - preload_engines_syncable_.SetValue(base::JoinString(new_tokens, ",")); + preload_engines_syncable_.SetValue(JoinString(new_tokens, ',')); // Second, set the local prefs, incorporating new values from the sync server. preload_engines_.SetValue( @@ -278,7 +278,7 @@ std::string InputMethodSyncer::AddSupportedInputMethodValues( // Do the actual merging. MergeLists(&old_tokens, new_tokens); - return base::JoinString(old_tokens, ","); + return JoinString(old_tokens, ','); } void InputMethodSyncer::FinishMerge(const std::string& languages) { @@ -311,7 +311,7 @@ void InputMethodSyncer::OnPreferenceChanged(const std::string& pref_name) { base::SplitString(preload_engines_.GetValue(), ',', &engines); std::transform(engines.begin(), engines.end(), engines.begin(), extension_ime_util::GetComponentIDByInputMethodID); - preload_engines_syncable_.SetValue(base::JoinString(engines, ",")); + preload_engines_syncable_.SetValue(JoinString(engines, ',')); } void InputMethodSyncer::OnIsSyncingChanged() { diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc index 0a02b53..af0f026 100644 --- a/chrome/browser/chromeos/login/session/user_session_manager.cc +++ b/chrome/browser/chromeos/login/session/user_session_manager.cc @@ -156,7 +156,7 @@ void InitLocaleAndInputMethodsForNewUser( // Save the input methods in the user's preferences. StringPrefMember language_preload_engines; language_preload_engines.Init(prefs::kLanguagePreloadEngines, prefs); - language_preload_engines.SetValue(base::JoinString(input_method_ids, ",")); + language_preload_engines.SetValue(JoinString(input_method_ids, ',')); BootTimesRecorder::Get()->AddLoginTimeMarker("IMEStarted", false); // Second, we'll set kLanguagePreferredLanguages. @@ -184,7 +184,7 @@ void InitLocaleAndInputMethodsForNewUser( // Save the preferred languages in the user's preferences. prefs->SetString(prefs::kLanguagePreferredLanguages, - base::JoinString(language_codes, ",")); + JoinString(language_codes, ',')); // Indicate that we need to merge the syncable input methods when we sync, // since we have not applied the synced prefs before. diff --git a/chrome/browser/chromeos/power/peripheral_battery_observer.cc b/chrome/browser/chromeos/power/peripheral_battery_observer.cc index 22089fa..32438ae2 100644 --- a/chrome/browser/chromeos/power/peripheral_battery_observer.cc +++ b/chrome/browser/chromeos/power/peripheral_battery_observer.cc @@ -66,7 +66,7 @@ std::string ExtractBluetoothAddress(const std::string& path) { std::vector<std::string> result; base::SplitString(reverse_address, ':', &result); std::reverse(result.begin(), result.end()); - std::string address = base::JoinString(result, ":"); + std::string address = JoinString(result, ':'); return address; } diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc index e19c8ff..db334bf 100644 --- a/chrome/browser/chromeos/preferences.cc +++ b/chrome/browser/chromeos/preferences.cc @@ -627,7 +627,7 @@ void Preferences::SetLanguageConfigStringListAsCSV(const char* section, // Transfers the xkb id to extension-xkb id. if (input_method_manager_->MigrateInputMethods(&split_values)) - preload_engines_.SetValue(base::JoinString(split_values, ",")); + preload_engines_.SetValue(JoinString(split_values, ',')); if (section == std::string(language_prefs::kGeneralSectionName) && name == std::string(language_prefs::kPreloadEnginesConfigName)) { diff --git a/chrome/browser/chromeos/preferences_unittest.cc b/chrome/browser/chromeos/preferences_unittest.cc index f790cba..60a4829 100644 --- a/chrome/browser/chromeos/preferences_unittest.cc +++ b/chrome/browser/chromeos/preferences_unittest.cc @@ -344,7 +344,7 @@ class InputMethodPreferencesTest : public PreferencesTest { base::SplitString(value, ',', &tokens); std::transform(tokens.begin(), tokens.end(), tokens.begin(), &extension_ime_util::GetInputMethodIDByEngineID); - return base::JoinString(tokens, ","); + return JoinString(tokens, ','); } StringPrefMember preferred_languages_; diff --git a/chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc b/chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc index 44e4820..263d03cb 100644 --- a/chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc +++ b/chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc @@ -80,7 +80,7 @@ void DebugDaemonLogSource::OnGetRoutes(bool succeeded, DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (succeeded) - (*response_)[kRoutesKeyName] = base::JoinString(routes, "\n"); + (*response_)[kRoutesKeyName] = JoinString(routes, '\n'); else (*response_)[kRoutesKeyName] = kNotAvailable; RequestCompleted(); diff --git a/chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc b/chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc index d97fca42..6b7232e 100644 --- a/chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc +++ b/chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc @@ -55,7 +55,7 @@ GaiaWebAuthFlow::GaiaWebAuthFlow(Delegate* delegate, std::vector<std::string> client_id_parts; base::SplitString(oauth2_client_id, '.', &client_id_parts); std::reverse(client_id_parts.begin(), client_id_parts.end()); - redirect_scheme_ = base::JoinString(client_id_parts, "."); + redirect_scheme_ = JoinString(client_id_parts, '.'); std::string signin_scoped_device_id; // profile_ can be nullptr in unittests. SigninClient* signin_client = @@ -69,7 +69,7 @@ GaiaWebAuthFlow::GaiaWebAuthFlow(Delegate* delegate, std::string oauth2_authorize_params = base::StringPrintf( kOAuth2AuthorizeFormat, oauth2_client_id.c_str(), - net::EscapeUrlEncodedData(base::JoinString(scopes, " "), true).c_str(), + net::EscapeUrlEncodedData(JoinString(scopes, ' '), true).c_str(), token_key->extension_id.c_str(), redirect_scheme_.c_str(), token_key->extension_id.c_str(), diff --git a/chrome/browser/extensions/api/networking_private/crypto_verify_impl.cc b/chrome/browser/extensions/api/networking_private/crypto_verify_impl.cc index 2385a3e..9110b02 100644 --- a/chrome/browser/extensions/api/networking_private/crypto_verify_impl.cc +++ b/chrome/browser/extensions/api/networking_private/crypto_verify_impl.cc @@ -168,7 +168,7 @@ CryptoVerifyImpl::Credentials::Credentials( data_parts.push_back(properties.device_bssid); data_parts.push_back(properties.public_key); data_parts.push_back(properties.nonce); - unsigned_data = base::JoinString(data_parts, ","); + unsigned_data = JoinString(data_parts, ","); device_bssid = properties.device_bssid; public_key = properties.public_key; diff --git a/chrome/browser/extensions/chrome_content_verifier_delegate.cc b/chrome/browser/extensions/chrome_content_verifier_delegate.cc index c181e5e..5e412e7 100644 --- a/chrome/browser/extensions/chrome_content_verifier_delegate.cc +++ b/chrome/browser/extensions/chrome_content_verifier_delegate.cc @@ -135,7 +135,7 @@ GURL ChromeContentVerifierDelegate::GetSignatureFetchUrl( parts.push_back("id=" + extension_id); parts.push_back("v=" + version.GetString()); std::string x_value = - net::EscapeQueryParamValue(base::JoinString(parts, "&"), true); + net::EscapeQueryParamValue(JoinString(parts, "&"), true); std::string query = "response=redirect&x=" + x_value; GURL base_url = extension_urls::GetWebstoreUpdateUrl(); diff --git a/chrome/browser/extensions/content_capabilities_browsertest.cc b/chrome/browser/extensions/content_capabilities_browsertest.cc index cb7a512..8a4b96b 100644 --- a/chrome/browser/extensions/content_capabilities_browsertest.cc +++ b/chrome/browser/extensions/content_capabilities_browsertest.cc @@ -74,7 +74,7 @@ class ContentCapabilitiesTest : public ExtensionApiTest { v.push_back(s1); if (!s2.empty()) v.push_back(s2); - std::string list = base::JoinString(v, "\",\""); + std::string list = JoinString(v, "\",\""); if (!list.empty()) list = "\"" + list + "\""; return "[" + list + "]"; diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc index 2effb1a..714906c 100644 --- a/chrome/browser/extensions/crx_installer.cc +++ b/chrome/browser/extensions/crx_installer.cc @@ -536,8 +536,8 @@ void CrxInstaller::OnInstallChecksComplete(int failed_checks) { if (error_on_unsupported_requirements_) { ReportFailureFromUIThread( CrxInstallError(CrxInstallError::ERROR_DECLINED, - base::UTF8ToUTF16(base::JoinString( - install_checker_.requirement_errors(), " ")))); + base::UTF8ToUTF16(JoinString( + install_checker_.requirement_errors(), ' ')))); return; } install_flags_ |= kInstallFlagHasRequirementErrors; diff --git a/chrome/browser/extensions/extension_install_prompt.cc b/chrome/browser/extensions/extension_install_prompt.cc index 4cdcf4d..6c093e1 100644 --- a/chrome/browser/extensions/extension_install_prompt.cc +++ b/chrome/browser/extensions/extension_install_prompt.cc @@ -269,8 +269,7 @@ void ExtensionInstallPrompt::Prompt::SetPermissions( detail_line); } - details = base::JoinString(detail_lines_with_bullets, - base::ASCIIToUTF16("\n")); + details = JoinString(detail_lines_with_bullets, '\n'); } install_permissions.details.push_back(details); install_permissions.is_showing_details.push_back(false); diff --git a/chrome/browser/extensions/extension_message_bubble_controller.cc b/chrome/browser/extensions/extension_message_bubble_controller.cc index 0bc2802..ac198fd 100644 --- a/chrome/browser/extensions/extension_message_bubble_controller.cc +++ b/chrome/browser/extensions/extension_message_bubble_controller.cc @@ -141,7 +141,7 @@ base::string16 ExtensionMessageBubbleController::GetExtensionListForDisplay() { base::string16 prefix = bullet_point + base::ASCIIToUTF16(" "); for (base::string16& str : extension_list) str.insert(0, prefix); - return base::JoinString(extension_list, base::ASCIIToUTF16("\n")); + return JoinString(extension_list, base::ASCIIToUTF16("\n")); } const ExtensionIdList& ExtensionMessageBubbleController::GetExtensionIdList() { diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index 3378d72..0a4c7fa 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -1806,9 +1806,8 @@ TEST_F(ExtensionServiceTest, InstallUserScript) { EXPECT_TRUE(installed_) << "Nothing was installed."; EXPECT_FALSE(was_update_) << path.value(); ASSERT_EQ(1u, loaded_.size()) << "Nothing was loaded."; - EXPECT_EQ(0u, errors.size()) - << "There were errors: " - << base::JoinString(errors, base::ASCIIToUTF16(",")); + EXPECT_EQ(0u, errors.size()) << "There were errors: " + << JoinString(errors, ','); EXPECT_TRUE(service()->GetExtensionById(loaded_[0]->id(), false)) << path.value(); diff --git a/chrome/browser/extensions/extension_startup_browsertest.cc b/chrome/browser/extensions/extension_startup_browsertest.cc index ad5f1ab..bf8faf4 100644 --- a/chrome/browser/extensions/extension_startup_browsertest.cc +++ b/chrome/browser/extensions/extension_startup_browsertest.cc @@ -67,9 +67,7 @@ class ExtensionStartupTestBase : public InProcessBrowserTest { unauthenticated_load_allowed_ = false; #endif } else { - base::FilePath::StringType paths = - base::JoinString(load_extensions_, - base::FilePath::StringType(1, ',')); + base::FilePath::StringType paths = JoinString(load_extensions_, ','); command_line->AppendSwitchNative(switches::kLoadExtension, paths); command_line->AppendSwitch(switches::kDisableExtensionsFileAccessCheck); diff --git a/chrome/browser/extensions/requirements_checker_browsertest.cc b/chrome/browser/extensions/requirements_checker_browsertest.cc index 7ff03d9..efda739 100644 --- a/chrome/browser/extensions/requirements_checker_browsertest.cc +++ b/chrome/browser/extensions/requirements_checker_browsertest.cc @@ -65,7 +65,7 @@ class RequirementsCheckerBrowserTest : public ExtensionBrowserTest { " \"entries\": [\n" " {\n" " \"id\": 1,\n" - " \"features\": [\"" + base::JoinString(features, "\", \"") + "\"]\n" + " \"features\": [\"" + JoinString(features, "\", \"") + "\"]\n" " }\n" " ]\n" "}"; diff --git a/chrome/browser/extensions/unpacked_installer.cc b/chrome/browser/extensions/unpacked_installer.cc index 6fd2f9b..5f702b9b 100644 --- a/chrome/browser/extensions/unpacked_installer.cc +++ b/chrome/browser/extensions/unpacked_installer.cc @@ -251,7 +251,7 @@ void UnpackedInstaller::OnInstallChecksComplete(int failed_checks) { if (!install_checker_.requirement_errors().empty()) { ReportExtensionLoadError( - base::JoinString(install_checker_.requirement_errors(), " ")); + JoinString(install_checker_.requirement_errors(), ' ')); return; } diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc index 6ab5475..cbfd025a 100644 --- a/chrome/browser/extensions/webstore_installer.cc +++ b/chrome/browser/extensions/webstore_installer.cc @@ -217,8 +217,7 @@ GURL WebstoreInstaller::GetWebstoreInstallURL( GURL url(url_string + "?response=redirect&" + update_client::UpdateQueryParams::Get( update_client::UpdateQueryParams::CRX) + - "&x=" + net::EscapeQueryParamValue(base::JoinString(params, "&"), - true)); + "&x=" + net::EscapeQueryParamValue(JoinString(params, '&'), true)); DCHECK(url.is_valid()); return url; diff --git a/chrome/browser/net/firefox_proxy_settings.cc b/chrome/browser/net/firefox_proxy_settings.cc index 203d9557..2b23e01 100644 --- a/chrome/browser/net/firefox_proxy_settings.cc +++ b/chrome/browser/net/firefox_proxy_settings.cc @@ -236,7 +236,7 @@ bool FirefoxProxySettings::ToProxyConfig(net::ProxyConfig* config) { } config->proxy_rules().bypass_rules.ParseFromStringUsingSuffixMatching( - base::JoinString(proxy_bypass_list_, ";")); + JoinString(proxy_bypass_list_, ';')); return true; } diff --git a/chrome/browser/net/predictor.cc b/chrome/browser/net/predictor.cc index 0241aa0..9299b63 100644 --- a/chrome/browser/net/predictor.cc +++ b/chrome/browser/net/predictor.cc @@ -504,7 +504,7 @@ struct RightToLeftStringSorter { std::vector<std::string> parts; base::SplitString(url.host(), '.', &parts); std::reverse(parts.begin(), parts.end()); - std::string reversed_host = base::JoinString(parts, "."); + std::string reversed_host = JoinString(parts, '.'); // Return the new URL. GURL::Replacements url_components; diff --git a/chrome/browser/net/safe_search_util.cc b/chrome/browser/net/safe_search_util.cc index ac29b6f..9e34a64 100644 --- a/chrome/browser/net/safe_search_util.cc +++ b/chrome/browser/net/safe_search_util.cc @@ -63,7 +63,7 @@ std::string AddSafeSearchParameters(const std::string& query) { new_parameters.push_back(safe_parameter); new_parameters.push_back(ssui_parameter); - return base::JoinString(new_parameters, "&"); + return JoinString(new_parameters, '&'); } } // namespace diff --git a/chrome/browser/search/suggestions/suggestions_source.cc b/chrome/browser/search/suggestions/suggestions_source.cc index 79ea0be..486d53d 100644 --- a/chrome/browser/search/suggestions/suggestions_source.cc +++ b/chrome/browser/search/suggestions/suggestions_source.cc @@ -78,7 +78,7 @@ void RenderOutputHtml(const SuggestionsProfile& profile, } out.push_back("</ul>"); out.push_back(kHtmlFooter); - *output = base::JoinString(out, base::StringPiece()); + *output = JoinString(out, ""); } // Fills |output| with the HTML needed to display that no suggestions are @@ -90,7 +90,7 @@ void RenderOutputHtmlNoSuggestions(std::string* output) { out.push_back("<h1>Suggestions</h1>\n"); out.push_back("<p>You have no suggestions.</p>\n"); out.push_back(kHtmlFooter); - *output = base::JoinString(out, base::StringPiece()); + *output = JoinString(out, ""); } } // namespace diff --git a/chrome/browser/ssl/certificate_error_report.cc b/chrome/browser/ssl/certificate_error_report.cc index c63e897..67e8edd 100644 --- a/chrome/browser/ssl/certificate_error_report.cc +++ b/chrome/browser/ssl/certificate_error_report.cc @@ -56,7 +56,7 @@ bool CertificateChainToString(scoped_refptr<net::X509Certificate> cert, if (!cert->GetPEMEncodedChain(&pem_encoded_chain)) return false; - *result = base::JoinString(pem_encoded_chain, base::StringPiece()); + *result = JoinString(pem_encoded_chain, std::string()); return true; } diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc index 327fbad..b47aa2e 100644 --- a/chrome/browser/ssl/ssl_blocking_page.cc +++ b/chrome/browser/ssl/ssl_blocking_page.cc @@ -455,7 +455,7 @@ void SSLBlockingPage::PopulateInterstitialStrings( ssl_info_.cert->GetPEMEncodedChain( &encoded_chain); load_time_data->SetString( - "pem", base::JoinString(encoded_chain, base::StringPiece())); + "pem", JoinString(encoded_chain, std::string())); cert_report_helper_->PopulateExtendedReportingOption(load_time_data); } diff --git a/chrome/browser/sxs_linux.cc b/chrome/browser/sxs_linux.cc index 2990693..040011d 100644 --- a/chrome/browser/sxs_linux.cc +++ b/chrome/browser/sxs_linux.cc @@ -81,7 +81,7 @@ bool DoAddChannelMarkToUserDataDir(const base::FilePath& user_data_dir) { user_data_dir_channels.push_back(product_channel_name); return base::ImportantFileWriter::WriteFileAtomically( channels_path, - base::JoinString(user_data_dir_channels, "\n")); + JoinString(user_data_dir_channels, "\n")); } } // namespace diff --git a/chrome/browser/sync/profile_sync_service_android_unittest.cc b/chrome/browser/sync/profile_sync_service_android_unittest.cc index 0377f12..14c6d0b 100644 --- a/chrome/browser/sync/profile_sync_service_android_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_android_unittest.cc @@ -97,7 +97,7 @@ TEST_F(ProfileSyncServiceAndroidTest, ModelTypesToInvalidationNames) { } std::sort(invalidation_names.begin(), invalidation_names.end()); - EXPECT_EQ(base::JoinString(invalidation_names, ", "), + EXPECT_EQ(JoinString(invalidation_names, ", "), ProfileSyncServiceAndroid::ModelTypeSelectionToStringForTest( model_type_selection)); } diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database.cc b/chrome/browser/sync_file_system/drive_backend/metadata_database.cc index 0859ba1..f120fe3 100644 --- a/chrome/browser/sync_file_system/drive_backend/metadata_database.cc +++ b/chrome/browser/sync_file_system/drive_backend/metadata_database.cc @@ -1743,7 +1743,7 @@ scoped_ptr<base::ListValue> MetadataDatabase::DumpMetadata() { std::vector<std::string> parents; for (int i = 0; i < details.parent_folder_ids_size(); ++i) parents.push_back(details.parent_folder_ids(i)); - dict->SetString("parents", base::JoinString(parents, ",")); + dict->SetString("parents", JoinString(parents, ",")); } files->Append(dict); } diff --git a/chrome/browser/thumbnails/thumbnail_list_source.cc b/chrome/browser/thumbnails/thumbnail_list_source.cc index 0cad21f..604b3d3 100644 --- a/chrome/browser/thumbnails/thumbnail_list_source.cc +++ b/chrome/browser/thumbnails/thumbnail_list_source.cc @@ -164,6 +164,6 @@ void ThumbnailListSource::OnMostVisitedURLsAvailable( } out.push_back(kHtmlFooter); - std::string out_html = base::JoinString(out, base::StringPiece()); + std::string out_html = JoinString(out, ""); callback.Run(base::RefCountedString::TakeString(&out_html)); } diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc index b664989..ad9e51f 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc @@ -316,7 +316,7 @@ MultiUserWindowManagerChromeOSTest::GetOwnersOfVisibleWindowsAsString() { std::vector<std::string> owner_list; owner_list.insert(owner_list.begin(), owners.begin(), owners.end()); - return base::JoinString(owner_list, " "); + return JoinString(owner_list, ' '); } // Testing basic assumptions like default state and existence of manager. diff --git a/chrome/browser/ui/autofill/autofill_dialog_types.cc b/chrome/browser/ui/autofill/autofill_dialog_types.cc index b990097..95dfd44 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_types.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_types.cc @@ -34,7 +34,7 @@ DialogNotification::DialogNotification(Type type, size_t start = pieces[0].size(); size_t end = start + pieces[1].size(); link_range_ = gfx::Range(start, end); - display_text_ = base::JoinString(pieces, base::StringPiece16()); + display_text_ = JoinString(pieces, base::string16()); } } diff --git a/chrome/browser/ui/autofill/data_model_wrapper.cc b/chrome/browser/ui/autofill/data_model_wrapper.cc index 8391286..2bc42aa 100644 --- a/chrome/browser/ui/autofill/data_model_wrapper.cc +++ b/chrome/browser/ui/autofill/data_model_wrapper.cc @@ -79,7 +79,7 @@ bool DataModelWrapper::GetDisplayText( non_address_info += base::ASCIIToUTF16("\n") + phone; *vertically_compact = base::UTF8ToUTF16(single_line) + non_address_info; - *horizontally_compact = base::UTF8ToUTF16(base::JoinString(lines, "\n")) + + *horizontally_compact = base::UTF8ToUTF16(JoinString(lines, "\n")) + non_address_info; return true; diff --git a/chrome/browser/ui/cocoa/global_error_bubble_controller.mm b/chrome/browser/ui/cocoa/global_error_bubble_controller.mm index d62343f..c2604d9 100644 --- a/chrome/browser/ui/cocoa/global_error_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/global_error_bubble_controller.mm @@ -82,7 +82,7 @@ class Bridge : public GlobalErrorBubbleViewBase { [title_ setStringValue:SysUTF16ToNSString(error_->GetBubbleViewTitle())]; std::vector<base::string16> messages = error_->GetBubbleViewMessages(); - base::string16 message = base::JoinString(messages, base::ASCIIToUTF16("\n")); + base::string16 message = JoinString(messages, '\n'); base::scoped_nsobject<NSMutableAttributedString> messageValue( [[NSMutableAttributedString alloc] diff --git a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc index 638407e..f9c8b53 100644 --- a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc +++ b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc @@ -319,8 +319,7 @@ void SelectFileDialogImplGTK::AddFilters(GtkFileChooser* chooser) { // the extensions themselves if the description is blank. std::vector<std::string> fallback_labels_vector(fallback_labels.begin(), fallback_labels.end()); - std::string fallback_label = - base::JoinString(fallback_labels_vector, ","); + std::string fallback_label = JoinString(fallback_labels_vector, ','); gtk_file_filter_set_name(filter, fallback_label.c_str()); } diff --git a/chrome/browser/ui/webui/gcm_internals_ui.cc b/chrome/browser/ui/webui/gcm_internals_ui.cc index 5fe3189..f5754ce 100644 --- a/chrome/browser/ui/webui/gcm_internals_ui.cc +++ b/chrome/browser/ui/webui/gcm_internals_ui.cc @@ -162,7 +162,7 @@ void GcmInternalsUIMessageHandler::ReturnResults( device_info->SetBoolean("connectionClientCreated", stats->connection_client_created); device_info->SetString("registeredAppIds", - base::JoinString(stats->registered_app_ids, ",")); + JoinString(stats->registered_app_ids, ",")); if (stats->connection_client_created) device_info->SetString("connectionState", stats->connection_state); if (stats->android_id > 0) { diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc index 60551e7..6dfb690 100644 --- a/chrome/common/chrome_content_client.cc +++ b/chrome/common/chrome_content_client.cc @@ -190,8 +190,8 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) { codecs.push_back(kCdmSupportedCodecAac); codecs.push_back(kCdmSupportedCodecAvc1); #endif // defined(USE_PROPRIETARY_CODECS) - std::string codec_string = base::JoinString( - codecs, base::string16(1, kCdmSupportedCodecsValueDelimiter)); + std::string codec_string = + JoinString(codecs, kCdmSupportedCodecsValueDelimiter); widevine_cdm_mime_type.additional_param_names.push_back( base::ASCIIToUTF16(kCdmSupportedCodecsParamName)); widevine_cdm_mime_type.additional_param_values.push_back( @@ -255,7 +255,7 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path, // E.g., "Shockwave Flash 10.2 r154": plugin.description = plugin.name + " " + flash_version_numbers[0] + "." + flash_version_numbers[1] + " r" + flash_version_numbers[2]; - plugin.version = base::JoinString(flash_version_numbers, "."); + plugin.version = JoinString(flash_version_numbers, '.'); content::WebPluginMimeType swf_mime_type(content::kFlashPluginSwfMimeType, content::kFlashPluginSwfExtension, content::kFlashPluginSwfDescription); diff --git a/chrome/common/extensions/command.cc b/chrome/common/extensions/command.cc index fc4b47bc..ba42e1c 100644 --- a/chrome/common/extensions/command.cc +++ b/chrome/common/extensions/command.cc @@ -272,7 +272,7 @@ std::string NormalizeShortcutSuggestion(const std::string& suggestion, else if (tokens[i] == values::kKeyMacCtrl) tokens[i] = values::kKeyCtrl; } - return base::JoinString(tokens, "+"); + return JoinString(tokens, '+'); } } // namespace diff --git a/chrome/common/extensions/permissions/chrome_permission_message_rules.cc b/chrome/common/extensions/permissions/chrome_permission_message_rules.cc index 1083cff2..7b68bfa 100644 --- a/chrome/common/extensions/permissions/chrome_permission_message_rules.cc +++ b/chrome/common/extensions/permissions/chrome_permission_message_rules.cc @@ -6,7 +6,6 @@ #include "base/stl_util.h" #include "base/strings/string_util.h" -#include "base/strings/utf_string_conversions.h" #include "chrome/grit/generated_resources.h" #include "extensions/common/permissions/api_permission_set.h" #include "extensions/common/permissions/coalesced_permission_message.h" @@ -99,8 +98,8 @@ class SpaceSeparatedListFormatter : public ChromePermissionMessageFormatter { DCHECK(permissions.size() > 0); std::vector<base::string16> hostnames = permissions.GetAllPermissionParameters(); - base::string16 hosts_string = - base::JoinString(hostnames, base::ASCIIToUTF16(" ")); + base::string16 hosts_string = JoinString( + std::vector<base::string16>(hostnames.begin(), hostnames.end()), ' '); return CoalescedPermissionMessage( l10n_util::GetStringFUTF16(hostnames.size() == 1 ? message_id_for_one_host_ diff --git a/chrome/common/extensions/permissions/permission_set_unittest.cc b/chrome/common/extensions/permissions/permission_set_unittest.cc index 5070f17..e8a3f09 100644 --- a/chrome/common/extensions/permissions/permission_set_unittest.cc +++ b/chrome/common/extensions/permissions/permission_set_unittest.cc @@ -69,14 +69,14 @@ std::string LegacyPermissionIDsToString(const PermissionMessageIDs& ids) { std::vector<std::string> strs; for (const PermissionMessage::ID& id : ids) strs.push_back(base::IntToString(id)); - return base::StringPrintf("[ %s ]", base::JoinString(strs, ", ").c_str()); + return base::StringPrintf("[ %s ]", JoinString(strs, ", ").c_str()); } std::string PermissionIDsToString(const PermissionIDSet& ids) { std::vector<std::string> strs; for (const PermissionID& id : ids) strs.push_back(base::IntToString(id.id())); - return base::StringPrintf("[ %s ]", base::JoinString(strs, ", ").c_str()); + return base::StringPrintf("[ %s ]", JoinString(strs, ", ").c_str()); } std::string CoalescedPermissionIDsToString( @@ -84,7 +84,7 @@ std::string CoalescedPermissionIDsToString( std::vector<std::string> strs; for (const CoalescedPermissionMessage& msg : msgs) strs.push_back(PermissionIDsToString(msg.permissions())); - return base::JoinString(strs, " "); + return JoinString(strs, " "); } // Check that the given |permissions| produce a single warning message, diff --git a/chrome/installer/setup/update_active_setup_version_work_item.cc b/chrome/installer/setup/update_active_setup_version_work_item.cc index 7372675..4d35494 100644 --- a/chrome/installer/setup/update_active_setup_version_work_item.cc +++ b/chrome/installer/setup/update_active_setup_version_work_item.cc @@ -69,5 +69,5 @@ base::string16 UpdateActiveSetupVersionWorkItem::GetUpdatedActiveSetupVersion( version_components[OS_UPGRADES] = base::UintToString16(previous_value + 1); } - return base::JoinString(version_components, L","); + return JoinString(version_components, L','); } diff --git a/chrome/test/base/extension_js_browser_test.cc b/chrome/test/base/extension_js_browser_test.cc index f6396d0..b84d223 100644 --- a/chrome/test/base/extension_js_browser_test.cc +++ b/chrome/test/base/extension_js_browser_test.cc @@ -42,8 +42,7 @@ bool ExtensionJSBrowserTest::RunJavascriptTestF(bool is_async, } scripts.push_back(BuildRunTestJSCall(is_async, "RUN_TEST_F", args)); - base::string16 script_16 = - base::JoinString(scripts, base::ASCIIToUTF16("\n")); + base::string16 script_16 = JoinString(scripts, '\n'); std::string script = base::UTF16ToUTF8(script_16); std::string result = diff --git a/chrome/test/base/web_ui_browser_test.cc b/chrome/test/base/web_ui_browser_test.cc index 0b9d3a5..4ba0b0b 100644 --- a/chrome/test/base/web_ui_browser_test.cc +++ b/chrome/test/base/web_ui_browser_test.cc @@ -11,7 +11,6 @@ #include "base/memory/ref_counted_memory.h" #include "base/path_service.h" #include "base/strings/string_util.h" -#include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/chrome_content_browser_client.h" #include "chrome/browser/profiles/profile.h" @@ -419,7 +418,7 @@ bool WebUIBrowserTest::RunJavascriptUsingHandler( if (!libraries_preloaded_) { BuildJavascriptLibraries(&libraries); if (!preload_host) { - content = base::JoinString(libraries, base::ASCIIToUTF16("\n")); + content = JoinString(libraries, '\n'); libraries.clear(); } } diff --git a/chrome/test/chromedriver/chrome_launcher.cc b/chrome/test/chromedriver/chrome_launcher.cc index 9c35f8f..5a79d67 100644 --- a/chrome/test/chromedriver/chrome_launcher.cc +++ b/chrome/test/chromedriver/chrome_launcher.cc @@ -749,8 +749,8 @@ Status ProcessExtensions(const std::vector<std::string>& extensions, } if (extension_paths.size()) { - base::FilePath::StringType extension_paths_value = base::JoinString( - extension_paths, base::FilePath::StringType(1, ',')); + base::FilePath::StringType extension_paths_value = JoinString( + extension_paths, FILE_PATH_LITERAL(',')); UpdateExtensionSwitch(switches, "load-extension", extension_paths_value); } bg_pages->swap(bg_pages_tmp); diff --git a/chromecast/base/metrics/cast_metrics_helper.cc b/chromecast/base/metrics/cast_metrics_helper.cc index 218da4a..6d07b4a 100644 --- a/chromecast/base/metrics/cast_metrics_helper.cc +++ b/chromecast/base/metrics/cast_metrics_helper.cc @@ -78,14 +78,12 @@ std::string CastMetricsHelper::EncodeAppInfoIntoMetricsName( const std::string& app_id, const std::string& session_id, const std::string& sdk_version) { - std::string result(action_name); - result.push_back(kMetricsNameAppInfoDelimiter); - result.append(app_id); - result.push_back(kMetricsNameAppInfoDelimiter); - result.append(session_id); - result.push_back(kMetricsNameAppInfoDelimiter); - result.append(sdk_version); - return result; + std::vector<std::string> parts; + parts.push_back(action_name); + parts.push_back(app_id); + parts.push_back(session_id); + parts.push_back(sdk_version); + return JoinString(parts, kMetricsNameAppInfoDelimiter); } // static diff --git a/chromecast/base/process_utils.cc b/chromecast/base/process_utils.cc index 9e379a0..523fb1c 100644 --- a/chromecast/base/process_utils.cc +++ b/chromecast/base/process_utils.cc @@ -17,7 +17,7 @@ bool GetAppOutput(const std::vector<std::string>& argv, std::string* output) { DCHECK(output); // Join the args into one string, creating the command. - std::string command = base::JoinString(argv, " "); + std::string command = JoinString(argv, ' '); // Open the process. FILE* fp = popen(command.c_str(), "r"); diff --git a/chromeos/network/network_change_notifier_chromeos.cc b/chromeos/network/network_change_notifier_chromeos.cc index 52ee616..4561091 100644 --- a/chromeos/network/network_change_notifier_chromeos.cc +++ b/chromeos/network/network_change_notifier_chromeos.cc @@ -211,8 +211,9 @@ void NetworkChangeNotifierChromeos::UpdateState( NET_LOG_EVENT( "NCNDefaultDNSServerChanged", base::StringPrintf( - "%s -> %s", base::JoinString(dns_servers_, ",").c_str(), - base::JoinString(default_network->dns_servers(), ",").c_str())); + "%s -> %s", + JoinString(dns_servers_, ",").c_str(), + JoinString(default_network->dns_servers(), ",").c_str())); *dns_changed = true; } diff --git a/chromeos/network/onc/onc_validator.cc b/chromeos/network/onc/onc_validator.cc index 4c2067a..4e2e732 100644 --- a/chromeos/network/onc/onc_validator.cc +++ b/chromeos/network/onc/onc_validator.cc @@ -325,7 +325,7 @@ std::string JoinStringRange(const std::vector<const char*>& strings, const std::string& separator) { std::vector<std::string> string_vector; std::copy(strings.begin(), strings.end(), std::back_inserter(string_vector)); - return base::JoinString(string_vector, separator); + return JoinString(string_vector, separator); } } // namespace @@ -952,7 +952,7 @@ bool Validator::ValidateCertificate(base::DictionaryValue* result) { } std::string Validator::MessageHeader() { - std::string path = path_.empty() ? "toplevel" : base::JoinString(path_, "."); + std::string path = path_.empty() ? "toplevel" : JoinString(path_, "."); std::string message = "At " + path + ": "; return message; } diff --git a/cloud_print/virtual_driver/win/install/setup.cc b/cloud_print/virtual_driver/win/install/setup.cc index fe764a10..07aefbc 100644 --- a/cloud_print/virtual_driver/win/install/setup.cc +++ b/cloud_print/virtual_driver/win/install/setup.cc @@ -283,7 +283,7 @@ HRESULT InstallDriver(const base::FilePath& install_path) { driver_info.pDriverPath = const_cast<LPWSTR>(xps_path.value().c_str()); driver_info.pConfigFile = const_cast<LPWSTR>(ui_path.value().c_str()); - base::string16 dependent_files(base::JoinString(dependent_array, L"\n")); + base::string16 dependent_files(JoinString(dependent_array, L'\n')); dependent_files.push_back(L'\n'); std::replace(dependent_files.begin(), dependent_files.end(), L'\n', L'\0'); driver_info.pDependentFiles = &dependent_files[0]; diff --git a/components/autofill/content/browser/wallet/wallet_address.cc b/components/autofill/content/browser/wallet/wallet_address.cc index 0e11196..6fa2453 100644 --- a/components/autofill/content/browser/wallet/wallet_address.cc +++ b/components/autofill/content/browser/wallet/wallet_address.cc @@ -340,7 +340,7 @@ base::string16 Address::GetInfo(const AutofillType& type, return recipient_name(); case ADDRESS_HOME_STREET_ADDRESS: - return base::JoinString(street_address_, base::ASCIIToUTF16("\n")); + return JoinString(street_address_, base::ASCIIToUTF16("\n")); case ADDRESS_HOME_LINE1: return GetStreetAddressLine(0); diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc index ef46edb..3412281 100644 --- a/components/autofill/content/renderer/autofill_agent.cc +++ b/components/autofill/content/renderer/autofill_agent.cc @@ -503,7 +503,7 @@ void AutofillAgent::AcceptDataListSuggestion( last_part.append(suggested_value); parts[parts.size() - 1] = last_part; - new_value = base::JoinString(parts, base::ASCIIToUTF16(",")); + new_value = JoinString(parts, ','); } FillFieldWithValue(new_value, input_element); } diff --git a/components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc b/components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc index 3544f4d..d6b95e9 100644 --- a/components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc +++ b/components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc @@ -269,8 +269,7 @@ TEST_F(MAYBE_PasswordFormConversionUtilsTest, IdentifyingUsernameFields) { EXPECT_EQ(base::UTF8ToUTF16(cases[i].expected_username_value), password_form->username_value); EXPECT_EQ(base::UTF8ToUTF16(cases[i].expected_other_possible_usernames), - base::JoinString(password_form->other_possible_usernames, - base::ASCIIToUTF16("+"))); + JoinString(password_form->other_possible_usernames, '+')); } else { EXPECT_TRUE(password_form->username_value.empty()); EXPECT_TRUE(password_form->other_possible_usernames.empty()); diff --git a/components/autofill/core/browser/address.cc b/components/autofill/core/browser/address.cc index 389bed2..9aaa3b6 100644 --- a/components/autofill/core/browser/address.cc +++ b/components/autofill/core/browser/address.cc @@ -71,7 +71,7 @@ base::string16 Address::GetRawInfo(ServerFieldType type) const { return base::ASCIIToUTF16(country_code_); case ADDRESS_HOME_STREET_ADDRESS: - return base::JoinString(street_address_, base::ASCIIToUTF16("\n")); + return JoinString(street_address_, '\n'); default: NOTREACHED(); diff --git a/components/autofill/core/browser/autofill_profile.cc b/components/autofill/core/browser/autofill_profile.cc index bec1121..7012a9b 100644 --- a/components/autofill/core/browser/autofill_profile.cc +++ b/components/autofill/core/browser/autofill_profile.cc @@ -328,7 +328,7 @@ base::string16 AutofillProfile::GetInfo(const AutofillType& type, std::vector<std::string> lines; ::i18n::addressinput::GetFormattedNationalAddress(*address_data, &lines); - return base::UTF8ToUTF16(base::JoinString(lines, "\n")); + return base::UTF8ToUTF16(JoinString(lines, '\n')); } const FormGroup* form_group = FormGroupForType(type); diff --git a/components/autofill/core/browser/contact_info.cc b/components/autofill/core/browser/contact_info.cc index ccb45cc..6e13759 100644 --- a/components/autofill/core/browser/contact_info.cc +++ b/components/autofill/core/browser/contact_info.cc @@ -125,7 +125,7 @@ NameParts SplitName(const base::string16& name) { std::vector<base::string16> family_tokens(reverse_family_tokens.rbegin(), reverse_family_tokens.rend()); - parts.family = base::JoinString(family_tokens, base::ASCIIToUTF16(" ")); + parts.family = JoinString(family_tokens, base::char16(' ')); // Take the last remaining token as the middle name (if there are at least 2 // tokens). @@ -135,7 +135,7 @@ NameParts SplitName(const base::string16& name) { } // Remainder is given name. - parts.given = base::JoinString(name_tokens, base::ASCIIToUTF16(" ")); + parts.given = JoinString(name_tokens, base::char16(' ')); return parts; } @@ -262,7 +262,7 @@ base::string16 NameInfo::FullName() const { if (!family_.empty()) full_name.push_back(family_); - return base::JoinString(full_name, base::ASCIIToUTF16(" ")); + return JoinString(full_name, ' '); } base::string16 NameInfo::MiddleInitial() const { diff --git a/components/autofill/core/browser/webdata/autofill_wallet_syncable_service.cc b/components/autofill/core/browser/webdata/autofill_wallet_syncable_service.cc index 3fed7f6..e49fda7 100644 --- a/components/autofill/core/browser/webdata/autofill_wallet_syncable_service.cc +++ b/components/autofill/core/browser/webdata/autofill_wallet_syncable_service.cc @@ -82,7 +82,7 @@ AutofillProfile ProfileFromSpecifics( std::vector<std::string> street_address(address.street_address().begin(), address.street_address().end()); profile.SetRawInfo(ADDRESS_HOME_STREET_ADDRESS, - base::UTF8ToUTF16(base::JoinString(street_address, "\n"))); + base::UTF8ToUTF16(JoinString(street_address, '\n'))); profile.SetRawInfo(COMPANY_NAME, base::UTF8ToUTF16(address.company_name())); profile.SetRawInfo(ADDRESS_HOME_STATE, diff --git a/components/autofill/core/common/password_form.cc b/components/autofill/core/common/password_form.cc index 0f369db..fdd6144 100644 --- a/components/autofill/core/common/password_form.cc +++ b/components/autofill/core/common/password_form.cc @@ -36,8 +36,7 @@ void PasswordFormToJSON(const PasswordForm& form, target->SetBoolean("new_password_marked_by_site", form.new_password_marked_by_site); target->SetString("other_possible_usernames", - base::JoinString(form.other_possible_usernames, - base::ASCIIToUTF16("|"))); + JoinString(form.other_possible_usernames, '|')); target->SetBoolean("blacklisted", form.blacklisted_by_user); target->SetBoolean("preferred", form.preferred); target->SetBoolean("ssl_valid", form.ssl_valid); diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc index 05edc7b..12e1591 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc @@ -527,7 +527,7 @@ TEST_F(DataReductionProxyConfigTest, AreProxiesBypassed) { if (tests[i].allowed && tests[i].fallback_allowed) proxies.push_back(fallback_origin); - std::string proxy_rules = "http=" + base::JoinString(proxies, ",") + + std::string proxy_rules = "http=" + JoinString(proxies, ",") + ",direct://;" + "https=" + ssl_origin + ",direct://;"; @@ -578,8 +578,7 @@ TEST_F(DataReductionProxyConfigTest, AreProxiesBypassedRetryDelay) { proxies.push_back(origin); proxies.push_back(fallback_origin); - std::string proxy_rules = - "http=" + base::JoinString(proxies, ",") + ",direct://;"; + std::string proxy_rules = "http=" + JoinString(proxies, ",") + ",direct://;"; rules.ParseFromString(proxy_rules); diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator.cc index f39d95e..9bfd9bd 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator.cc @@ -63,7 +63,7 @@ void DataReductionProxyConfigurator::Enable( } config.proxy_rules().bypass_rules.ParseFromString( - base::JoinString(bypass_rules_, ", ")); + JoinString(bypass_rules_, ", ")); // The ID is set to a bogus value. It cannot be left uninitialized, else the // config will return invalid. net::ProxyConfig::ID unused_id = 1; diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc index 6a55084..8717fcb 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc @@ -398,7 +398,7 @@ void DataReductionProxyRequestOptions::RegenerateRequestHeaderValue() { for (const auto& experiment : experiments_) headers.push_back(FormatOption(kExperimentsOption, experiment)); - header_value_ = base::JoinString(headers, ", "); + header_value_ = JoinString(headers, ", "); } } // namespace data_reduction_proxy diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc index a48459f..99eb96e 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc @@ -129,7 +129,7 @@ void SetHeaderExpectations(const std::string& session, std::string(kExperimentsOption) + "=" + experiment); } if (!expected_options.empty()) - *expected_header = base::JoinString(expected_options, ", "); + *expected_header = JoinString(expected_options, ", "); } } // namespace diff --git a/components/history/core/browser/top_sites_database.cc b/components/history/core/browser/top_sites_database.cc index d1f024d..74ab115 100644 --- a/components/history/core/browser/top_sites_database.cc +++ b/components/history/core/browser/top_sites_database.cc @@ -85,7 +85,7 @@ std::string GetRedirects(const MostVisitedURL& url) { std::vector<std::string> redirects; for (size_t i = 0; i < url.redirects.size(); i++) redirects.push_back(url.redirects[i].spec()); - return base::JoinString(redirects, " "); + return JoinString(redirects, ' '); } // Decodes redirects from a string and sets them for the url. diff --git a/components/nacl/renderer/platform_info.cc b/components/nacl/renderer/platform_info.cc index 22edf18..712526c 100644 --- a/components/nacl/renderer/platform_info.cc +++ b/components/nacl/renderer/platform_info.cc @@ -75,7 +75,7 @@ std::string GetCpuFeatures() { else if (cpu.has_sse2()) features.push_back("+sse2"); // TODO: AES, POPCNT, LZCNT, ... - return base::JoinString(features, ","); + return JoinString(features, ','); } } // namespace nacl diff --git a/components/policy/core/browser/policy_error_map.cc b/components/policy/core/browser/policy_error_map.cc index 3360c3d..04411b6 100644 --- a/components/policy/core/browser/policy_error_map.cc +++ b/components/policy/core/browser/policy_error_map.cc @@ -186,7 +186,7 @@ base::string16 PolicyErrorMap::GetErrors(const std::string& policy) { std::vector<base::string16> list; for (const_iterator it = range.first; it != range.second; ++it) list.push_back(it->second); - return base::JoinString(list, base::ASCIIToUTF16("\n")); + return JoinString(list, '\n'); } bool PolicyErrorMap::empty() { diff --git a/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc b/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc index 834e42a..7c07fc2 100644 --- a/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc +++ b/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc @@ -93,7 +93,7 @@ void CryptAuthGCMManagerImpl::OnMessage(const std::string& app_id, PA_LOG(INFO) << "GCM message received:\n" << " sender_id: " << message.sender_id << "\n" << " collapse_key: " << message.collapse_key << "\n" - << " data:\n " << base::JoinString(fields, "\n "); + << " data:\n " << JoinString(fields, "\n "); if (message.data.find(kRegistrationTickleTypeKey) == message.data.end()) { PA_LOG(WARNING) << "GCM message does not contain 'registrationTickleType'."; diff --git a/components/search_engines/default_search_policy_handler.cc b/components/search_engines/default_search_policy_handler.cc index 38df010..573af72 100644 --- a/components/search_engines/default_search_policy_handler.cc +++ b/components/search_engines/default_search_policy_handler.cc @@ -169,7 +169,7 @@ void DefaultSearchEncodingsPolicyHandler::ApplyPolicySettings( string_parts.push_back(s); } } - std::string encodings = base::JoinString(string_parts, ";"); + std::string encodings = JoinString(string_parts, ';'); prefs->SetString(prefs::kDefaultSearchProviderEncodings, encodings); } diff --git a/components/search_engines/default_search_pref_migration_unittest.cc b/components/search_engines/default_search_pref_migration_unittest.cc index 73d9d0b..6d1b6ea 100644 --- a/components/search_engines/default_search_pref_migration_unittest.cc +++ b/components/search_engines/default_search_pref_migration_unittest.cc @@ -91,7 +91,7 @@ void DefaultSearchPrefMigrationTest::SaveDefaultSearchProviderToLegacyPrefs( GURL icon_gurl = t_url->favicon_url(); if (!icon_gurl.is_empty()) icon_url = icon_gurl.spec(); - encodings = base::JoinString(t_url->input_encodings(), ";"); + encodings = JoinString(t_url->input_encodings(), ';'); short_name = base::UTF16ToUTF8(t_url->short_name()); keyword = base::UTF16ToUTF8(t_url->keyword()); id_string = base::Int64ToString(t_url->id()); diff --git a/components/search_engines/keyword_table.cc b/components/search_engines/keyword_table.cc index a4ad483..7de6217 100644 --- a/components/search_engines/keyword_table.cc +++ b/components/search_engines/keyword_table.cc @@ -80,7 +80,7 @@ const std::string ColumnsForVersion(int version, bool concatenated) { columns.push_back("new_tab_url"); } - return base::JoinString(columns, std::string(concatenated ? " || " : ", ")); + return JoinString(columns, std::string(concatenated ? " || " : ", ")); } @@ -115,8 +115,7 @@ void BindURLToStatement(const TemplateURLData& data, std::string()); s->BindInt64(starting_column + 6, data.date_created.ToTimeT()); s->BindInt(starting_column + 7, data.usage_count); - s->BindString(starting_column + 8, - base::JoinString(data.input_encodings, ";")); + s->BindString(starting_column + 8, JoinString(data.input_encodings, ';')); s->BindBool(starting_column + 9, data.show_in_default_list); s->BindString(starting_column + 10, data.suggestions_url); s->BindInt(starting_column + 11, data.prepopulate_id); diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc index dbb74fc..8202fa4 100644 --- a/components/search_engines/template_url.cc +++ b/components/search_engines/template_url.cc @@ -337,7 +337,7 @@ std::string TemplateURLRef::ReplaceSearchTerms( return url; GURL::Replacements replacements; - std::string query_str = base::JoinString(query_params, "&"); + std::string query_str = JoinString(query_params, "&"); replacements.SetQueryStr(query_str); return gurl.ReplaceComponents(replacements).possibly_invalid_spec(); } diff --git a/components/search_engines/template_url_service.cc b/components/search_engines/template_url_service.cc index 12abbe8..7ba2ff0 100644 --- a/components/search_engines/template_url_service.cc +++ b/components/search_engines/template_url_service.cc @@ -1197,8 +1197,7 @@ syncer::SyncData TemplateURLService::CreateSyncDataFromTemplateURL( se_specifics->set_safe_for_autoreplace(turl.safe_for_autoreplace()); se_specifics->set_originating_url(turl.originating_url().spec()); se_specifics->set_date_created(turl.date_created().ToInternalValue()); - se_specifics->set_input_encodings( - base::JoinString(turl.input_encodings(), ";")); + se_specifics->set_input_encodings(JoinString(turl.input_encodings(), ';')); se_specifics->set_show_in_default_list(turl.show_in_default_list()); se_specifics->set_suggestions_url(turl.suggestions_url()); se_specifics->set_prepopulate_id(turl.prepopulate_id()); diff --git a/components/search_engines/template_url_service_sync_unittest.cc b/components/search_engines/template_url_service_sync_unittest.cc index d411256..66a6123 100644 --- a/components/search_engines/template_url_service_sync_unittest.cc +++ b/components/search_engines/template_url_service_sync_unittest.cc @@ -68,8 +68,7 @@ syncer::SyncData CreateCustomSyncData(const TemplateURL& turl, se_specifics->set_safe_for_autoreplace(turl.safe_for_autoreplace()); se_specifics->set_originating_url(turl.originating_url().spec()); se_specifics->set_date_created(turl.date_created().ToInternalValue()); - se_specifics->set_input_encodings( - base::JoinString(turl.input_encodings(), ";")); + se_specifics->set_input_encodings(JoinString(turl.input_encodings(), ';')); se_specifics->set_show_in_default_list(turl.show_in_default_list()); se_specifics->set_suggestions_url(turl.suggestions_url()); se_specifics->set_prepopulate_id(turl.prepopulate_id()); diff --git a/components/signin/core/browser/gaia_cookie_manager_service.cc b/components/signin/core/browser/gaia_cookie_manager_service.cc index dcc74ae..4beff36 100644 --- a/components/signin/core/browser/gaia_cookie_manager_service.cc +++ b/components/signin/core/browser/gaia_cookie_manager_service.cc @@ -114,7 +114,7 @@ GaiaCookieManagerService::ExternalCcResultFetcher::GetExternalCcResult() { ++it) { results.push_back(it->first + ":" + it->second); } - return base::JoinString(results, ","); + return JoinString(results, ","); } void GaiaCookieManagerService::ExternalCcResultFetcher::Start() { diff --git a/components/translate/core/browser/translate_prefs.cc b/components/translate/core/browser/translate_prefs.cc index 24547005..768be0e 100644 --- a/components/translate/core/browser/translate_prefs.cc +++ b/components/translate/core/browser/translate_prefs.cc @@ -326,7 +326,7 @@ void TranslatePrefs::GetLanguageList(std::vector<std::string>* languages) { void TranslatePrefs::UpdateLanguageList( const std::vector<std::string>& languages) { #if defined(OS_CHROMEOS) - std::string languages_str = base::JoinString(languages, ","); + std::string languages_str = JoinString(languages, ','); prefs_->SetString(preferred_languages_pref_.c_str(), languages_str); #endif @@ -335,7 +335,7 @@ void TranslatePrefs::UpdateLanguageList( // some web sites don't understand 'en-US' but 'en'. See crosbug.com/9884. std::vector<std::string> accept_languages; ExpandLanguageCodes(languages, &accept_languages); - std::string accept_languages_str = base::JoinString(accept_languages, ","); + std::string accept_languages_str = JoinString(accept_languages, ','); prefs_->SetString(accept_languages_pref_.c_str(), accept_languages_str); } @@ -485,8 +485,7 @@ void TranslatePrefs::MigrateUserPrefs(PrefService* user_prefs, accept_languages.push_back(lang); } - std::string new_accept_languages_str = - base::JoinString(accept_languages, ","); + std::string new_accept_languages_str = JoinString(accept_languages, ","); user_prefs->SetString(accept_languages_pref, new_accept_languages_str); } } diff --git a/components/view_manager/gesture_manager_unittest.cc b/components/view_manager/gesture_manager_unittest.cc index feece31..cc180b3 100644 --- a/components/view_manager/gesture_manager_unittest.cc +++ b/components/view_manager/gesture_manager_unittest.cc @@ -108,7 +108,7 @@ class TestGestureManagerDelegate : public GestureManagerDelegate { ~TestGestureManagerDelegate() override {} std::string GetAndClearDescriptions() { - const std::string result(base::JoinString(descriptions_, "\n")); + const std::string result(JoinString(descriptions_, '\n')); descriptions_.clear(); return result; } diff --git a/components/view_manager/test_change_tracker.cc b/components/view_manager/test_change_tracker.cc index ac7183d..33e0f96 100644 --- a/components/view_manager/test_change_tracker.cc +++ b/components/view_manager/test_change_tracker.cc @@ -133,7 +133,7 @@ std::string ChangeViewDescription(const std::vector<Change>& changes) { std::vector<std::string> view_strings(changes[0].views.size()); for (size_t i = 0; i < changes[0].views.size(); ++i) view_strings[i] = "[" + changes[0].views[i].ToString() + "]"; - return base::JoinString(view_strings, ","); + return JoinString(view_strings, ','); } TestView ViewDataToTestView(const ViewDataPtr& data) { diff --git a/content/browser/accessibility/accessibility_tree_formatter_utils_win.cc b/content/browser/accessibility/accessibility_tree_formatter_utils_win.cc index 0355078..063f5cd 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_utils_win.cc +++ b/content/browser/accessibility/accessibility_tree_formatter_utils_win.cc @@ -11,7 +11,6 @@ #include "base/memory/singleton.h" #include "base/strings/string_util.h" -#include "base/strings/utf_string_conversions.h" #include "third_party/iaccessible2/ia2_api_all.h" namespace content { @@ -315,7 +314,7 @@ void IAccessibleStateToStringVector(int32 ia_state, base::string16 IAccessibleStateToString(int32 ia_state) { std::vector<base::string16> strings; IAccessibleStateToStringVector(ia_state, &strings); - return base::JoinString(strings, base::ASCIIToUTF16(",")); + return JoinString(strings, ','); } void IAccessible2StateToStringVector(int32 ia2_state, @@ -332,7 +331,7 @@ void IAccessible2StateToStringVector(int32 ia2_state, base::string16 IAccessible2StateToString(int32 ia2_state) { std::vector<base::string16> strings; IAccessible2StateToStringVector(ia2_state, &strings); - return base::JoinString(strings, base::ASCIIToUTF16(",")); + return JoinString(strings, ','); } base::string16 AccessibilityEventToString(int32 event_id) { diff --git a/content/browser/accessibility/dump_accessibility_browsertest_base.cc b/content/browser/accessibility/dump_accessibility_browsertest_base.cc index 2a9a1ef..f6da92c 100644 --- a/content/browser/accessibility/dump_accessibility_browsertest_base.cc +++ b/content/browser/accessibility/dump_accessibility_browsertest_base.cc @@ -202,7 +202,7 @@ void DumpAccessibilityTestBase::RunTest( // file length differences are found. expected_lines.push_back(kMarkEndOfFile); actual_lines.push_back(kMarkEndOfFile); - std::string actual_contents = base::JoinString(actual_lines, "\n"); + std::string actual_contents = JoinString(actual_lines, "\n"); std::vector<int> diff_lines = DiffLines(expected_lines, actual_lines); bool is_different = diff_lines.size() > 0; diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc index 3c25275..87bad09 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc @@ -566,7 +566,7 @@ void GpuDataManagerImplPrivate::UpdateGpuInfoHelper() { gpu::GpuControlList::kOsAny, std::string(), gpu_info_); disabled_extensions_ = - base::JoinString(gpu_driver_bug_list_->GetDisabledExtensions(), " "); + JoinString(gpu_driver_bug_list_->GetDisabledExtensions(), ' '); } gpu::GpuDriverBugList::AppendWorkaroundsFromCommandLine( &gpu_driver_bugs_, *base::CommandLine::ForCurrentProcess()); diff --git a/content/browser/renderer_host/pepper/pepper_socket_utils.cc b/content/browser/renderer_host/pepper/pepper_socket_utils.cc index 718eec2..45d35ce 100644 --- a/content/browser/renderer_host/pepper/pepper_socket_utils.cc +++ b/content/browser/renderer_host/pepper/pepper_socket_utils.cc @@ -81,11 +81,10 @@ bool GetCertificateFields(const net::X509Certificate& cert, new base::StringValue(issuer.country_name)); fields->SetField( PP_X509CERTIFICATE_PRIVATE_ISSUER_ORGANIZATION_NAME, - new base::StringValue(base::JoinString(issuer.organization_names, "\n"))); + new base::StringValue(JoinString(issuer.organization_names, '\n'))); fields->SetField( PP_X509CERTIFICATE_PRIVATE_ISSUER_ORGANIZATION_UNIT_NAME, - new base::StringValue( - base::JoinString(issuer.organization_unit_names, "\n"))); + new base::StringValue(JoinString(issuer.organization_unit_names, '\n'))); const net::CertPrincipal& subject = cert.subject(); fields->SetField(PP_X509CERTIFICATE_PRIVATE_SUBJECT_COMMON_NAME, @@ -98,12 +97,10 @@ bool GetCertificateFields(const net::X509Certificate& cert, new base::StringValue(subject.country_name)); fields->SetField( PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_NAME, - new base::StringValue( - base::JoinString(subject.organization_names, "\n"))); + new base::StringValue(JoinString(subject.organization_names, '\n'))); fields->SetField( PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_UNIT_NAME, - new base::StringValue( - base::JoinString(subject.organization_unit_names, "\n"))); + new base::StringValue(JoinString(subject.organization_unit_names, '\n'))); const std::string& serial_number = cert.serial_number(); fields->SetField(PP_X509CERTIFICATE_PRIVATE_SERIAL_NUMBER, diff --git a/content/browser/renderer_host/pepper/pepper_tcp_socket.cc b/content/browser/renderer_host/pepper/pepper_tcp_socket.cc index 16b19b2..8d590f7 100644 --- a/content/browser/renderer_host/pepper/pepper_tcp_socket.cc +++ b/content/browser/renderer_host/pepper/pepper_tcp_socket.cc @@ -313,11 +313,10 @@ bool PepperTCPSocket::GetCertificateFields( new base::StringValue(issuer.country_name)); fields->SetField( PP_X509CERTIFICATE_PRIVATE_ISSUER_ORGANIZATION_NAME, - new base::StringValue(base::JoinString(issuer.organization_names, "\n"))); + new base::StringValue(JoinString(issuer.organization_names, '\n'))); fields->SetField( PP_X509CERTIFICATE_PRIVATE_ISSUER_ORGANIZATION_UNIT_NAME, - new base::StringValue( - base::JoinString(issuer.organization_unit_names, "\n"))); + new base::StringValue(JoinString(issuer.organization_unit_names, '\n'))); const net::CertPrincipal& subject = cert.subject(); fields->SetField(PP_X509CERTIFICATE_PRIVATE_SUBJECT_COMMON_NAME, @@ -330,12 +329,10 @@ bool PepperTCPSocket::GetCertificateFields( new base::StringValue(subject.country_name)); fields->SetField( PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_NAME, - new base::StringValue( - base::JoinString(subject.organization_names, "\n"))); + new base::StringValue(JoinString(subject.organization_names, '\n'))); fields->SetField( PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_UNIT_NAME, - new base::StringValue( - base::JoinString(subject.organization_unit_names, "\n"))); + new base::StringValue(JoinString(subject.organization_unit_names, '\n'))); const std::string& serial_number = cert.serial_number(); fields->SetField(PP_X509CERTIFICATE_PRIVATE_SERIAL_NUMBER, diff --git a/content/browser/renderer_host/websocket_host.cc b/content/browser/renderer_host/websocket_host.cc index 3c89b5c..8d0046b 100644 --- a/content/browser/renderer_host/websocket_host.cc +++ b/content/browser/renderer_host/websocket_host.cc @@ -353,7 +353,7 @@ void WebSocketHost::OnAddChannelRequest( DVLOG(3) << "WebSocketHost::OnAddChannelRequest" << " routing_id=" << routing_id_ << " socket_url=\"" << socket_url << "\" requested_protocols=\"" - << base::JoinString(requested_protocols, ", ") << "\" origin=\"" + << JoinString(requested_protocols, ", ") << "\" origin=\"" << origin.string() << "\""; DCHECK(!channel_); @@ -377,7 +377,7 @@ void WebSocketHost::AddChannel( DVLOG(3) << "WebSocketHost::AddChannel" << " routing_id=" << routing_id_ << " socket_url=\"" << socket_url << "\" requested_protocols=\"" - << base::JoinString(requested_protocols, ", ") << "\" origin=\"" + << JoinString(requested_protocols, ", ") << "\" origin=\"" << origin.string() << "\""; DCHECK(!channel_); diff --git a/content/browser/speech/google_one_shot_remote_engine.cc b/content/browser/speech/google_one_shot_remote_engine.cc index 48afc80..92e4cb3 100644 --- a/content/browser/speech/google_one_shot_remote_engine.cc +++ b/content/browser/speech/google_one_shot_remote_engine.cc @@ -205,8 +205,7 @@ void GoogleOneShotRemoteEngine::StartRecognition() { std::string api_key = google_apis::GetAPIKey(); parts.push_back("key=" + net::EscapeQueryParamValue(api_key, true)); - GURL url(std::string(kDefaultSpeechRecognitionUrl) + - base::JoinString(parts, "&")); + GURL url(std::string(kDefaultSpeechRecognitionUrl) + JoinString(parts, '&')); encoder_.reset(AudioEncoder::Create(kDefaultAudioCodec, config_.audio_sample_rate, diff --git a/content/browser/speech/google_streaming_remote_engine.cc b/content/browser/speech/google_streaming_remote_engine.cc index 0082cec..fc8c6d2 100644 --- a/content/browser/speech/google_streaming_remote_engine.cc +++ b/content/browser/speech/google_streaming_remote_engine.cc @@ -320,7 +320,7 @@ GoogleStreamingRemoteEngine::ConnectBothStreams(const FSMEventArgs&) { downstream_args.push_back("output=pb"); GURL downstream_url(std::string(kWebServiceBaseUrl) + std::string(kDownstreamUrl) + - base::JoinString(downstream_args, "&")); + JoinString(downstream_args, '&')); downstream_fetcher_ = URLFetcher::Create( kDownstreamUrlFetcherIdForTesting, downstream_url, URLFetcher::GET, this); @@ -372,7 +372,7 @@ GoogleStreamingRemoteEngine::ConnectBothStreams(const FSMEventArgs&) { } GURL upstream_url(std::string(kWebServiceBaseUrl) + std::string(kUpstreamUrl) + - base::JoinString(upstream_args, "&")); + JoinString(upstream_args, '&')); upstream_fetcher_ = URLFetcher::Create(kUpstreamUrlFetcherIdForTesting, upstream_url, URLFetcher::POST, this); diff --git a/content/child/websocket_bridge.cc b/content/child/websocket_bridge.cc index 6893937..a5cca24 100644 --- a/content/child/websocket_bridge.cc +++ b/content/child/websocket_bridge.cc @@ -220,7 +220,7 @@ void WebSocketBridge::connect( url::DeprecatedSerializedOrigin origin_to_pass(origin); DVLOG(1) << "Bridge#" << channel_id_ << " Connect(" << url << ", (" - << base::JoinString(protocols_to_pass, ", ") << "), " + << JoinString(protocols_to_pass, ", ") << "), " << origin_to_pass.string() << ")"; ChildThreadImpl::current()->Send(new WebSocketHostMsg_AddChannelRequest( diff --git a/extensions/browser/api/bluetooth/bluetooth_private_api.cc b/extensions/browser/api/bluetooth/bluetooth_private_api.cc index 0ac112a..1fd4870 100644 --- a/extensions/browser/api/bluetooth/bluetooth_private_api.cc +++ b/extensions/browser/api/bluetooth/bluetooth_private_api.cc @@ -227,7 +227,7 @@ void BluetoothPrivateSetAdapterStateFunction::SendError() { std::back_inserter(failed_vector)); std::vector<std::string> replacements(1); - replacements[0] = base::JoinString(failed_vector, ", "); + replacements[0] = JoinString(failed_vector, ", "); std::string error = ReplaceStringPlaceholders(kSetAdapterPropertyError, replacements, NULL); SetError(error); diff --git a/extensions/browser/api/management/management_api.cc b/extensions/browser/api/management/management_api.cc index 1581414..468c0c5 100644 --- a/extensions/browser/api/management/management_api.cc +++ b/extensions/browser/api/management/management_api.cc @@ -499,7 +499,7 @@ void ManagementSetEnabledFunction::OnRequirementsChecked( } else { // TODO(devlin): Should we really be noisy here all the time? Respond(Error(keys::kMissingRequirementsError, - base::JoinString(requirements_errors, " "))); + JoinString(requirements_errors, ' '))); } } diff --git a/extensions/browser/api/vpn_provider/vpn_provider_api.cc b/extensions/browser/api/vpn_provider/vpn_provider_api.cc index e3b80ae..069f171 100644 --- a/extensions/browser/api/vpn_provider/vpn_provider_api.cc +++ b/extensions/browser/api/vpn_provider/vpn_provider_api.cc @@ -112,14 +112,13 @@ void ConvertParameters(const api_vpn::Parameters& parameters, parameter_value->SetStringWithoutPathExpansion( shill::kSubnetPrefixParameterThirdPartyVpn, cidr_parts[1]); - std::string ip_delimiter(1, shill::kIPDelimiter); parameter_value->SetStringWithoutPathExpansion( shill::kExclusionListParameterThirdPartyVpn, - base::JoinString(parameters.exclusion_list, ip_delimiter)); + JoinString(parameters.exclusion_list, shill::kIPDelimiter)); parameter_value->SetStringWithoutPathExpansion( shill::kInclusionListParameterThirdPartyVpn, - base::JoinString(parameters.inclusion_list, ip_delimiter)); + JoinString(parameters.inclusion_list, shill::kIPDelimiter)); if (parameters.mtu) { parameter_value->SetStringWithoutPathExpansion( @@ -132,16 +131,15 @@ void ConvertParameters(const api_vpn::Parameters& parameters, *parameters.broadcast_address); } - std::string non_ip_delimiter(1, shill::kNonIPDelimiter); if (parameters.domain_search) { parameter_value->SetStringWithoutPathExpansion( shill::kDomainSearchParameterThirdPartyVpn, - base::JoinString(*parameters.domain_search, non_ip_delimiter)); + JoinString(*parameters.domain_search, shill::kNonIPDelimiter)); } parameter_value->SetStringWithoutPathExpansion( shill::kDnsServersParameterThirdPartyVpn, - base::JoinString(parameters.dns_servers, ip_delimiter)); + JoinString(parameters.dns_servers, shill::kIPDelimiter)); return; } diff --git a/extensions/browser/content_verifier.cc b/extensions/browser/content_verifier.cc index b85e8ee..3bbe4a9 100644 --- a/extensions/browser/content_verifier.cc +++ b/extensions/browser/content_verifier.cc @@ -124,8 +124,7 @@ static base::FilePath MakeImagePathRelative(const base::FilePath& path) { // Note that elsewhere we always normalize path separators to '/' so this // should work for all platforms. - return base::FilePath( - base::JoinString(parts, base::FilePath::StringType(1, '/'))); + return base::FilePath(JoinString(parts, '/')); } void ContentVerifier::OnExtensionLoaded( diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/browser/updater/extension_downloader.cc index d1d6468..a038ebb 100644 --- a/extensions/browser/updater/extension_downloader.cc +++ b/extensions/browser/updater/extension_downloader.cc @@ -136,7 +136,7 @@ bool IncrementAuthUserIndex(GURL* url) { return false; new_query_parts.push_back( base::StringPrintf("%s=%d", kAuthUserQueryKey, user_index + 1)); - std::string new_query_string = base::JoinString(new_query_parts, "&"); + std::string new_query_string = JoinString(new_query_parts, '&'); url::Component new_query(0, new_query_string.size()); url::Replacements<char> replacements; replacements.SetQuery(new_query_string.c_str(), new_query); @@ -469,7 +469,7 @@ void ExtensionDownloader::CreateManifestFetcher() { std::vector<std::string> id_vector( manifests_queue_.active_request()->extension_ids().begin(), manifests_queue_.active_request()->extension_ids().end()); - std::string id_list = base::JoinString(id_vector, ","); + std::string id_list = JoinString(id_vector, ','); VLOG(2) << "Fetching " << manifests_queue_.active_request()->full_url() << " for " << id_list; } diff --git a/extensions/browser/updater/manifest_fetch_data.cc b/extensions/browser/updater/manifest_fetch_data.cc index f72f32e..6511a1e 100644 --- a/extensions/browser/updater/manifest_fetch_data.cc +++ b/extensions/browser/updater/manifest_fetch_data.cc @@ -143,8 +143,7 @@ bool ManifestFetchData::AddExtension(const std::string& id, } std::string extra = full_url_.has_query() ? "&" : "?"; - extra += - "x=" + net::EscapeQueryParamValue(base::JoinString(parts, "&"), true); + extra += "x=" + net::EscapeQueryParamValue(JoinString(parts, '&'), true); // Check against our max url size, exempting the first extension added. int new_size = full_url_.possibly_invalid_spec().size() + extra.size(); diff --git a/extensions/common/api/sockets/sockets_manifest_permission.cc b/extensions/common/api/sockets/sockets_manifest_permission.cc index 6dbd4fc..0f7613e 100644 --- a/extensions/common/api/sockets/sockets_manifest_permission.cc +++ b/extensions/common/api/sockets/sockets_manifest_permission.cc @@ -131,9 +131,9 @@ void AddSubdomainHostMessage(const SocketPermissionEntrySet& sockets, messages->push_back(PermissionMessage( PermissionMessage::kSocketDomainHosts, l10n_util::GetStringFUTF16( - id, base::JoinString(std::vector<base::string16>(domains.begin(), - domains.end()), - base::ASCIIToUTF16(" "))))); + id, JoinString(std::vector<base::string16>(domains.begin(), + domains.end()), + ' ')))); } if (ids) { for (const auto& domain : domains) @@ -163,9 +163,9 @@ void AddSpecificHostMessage(const SocketPermissionEntrySet& sockets, messages->push_back(PermissionMessage( PermissionMessage::kSocketSpecificHosts, l10n_util::GetStringFUTF16( - id, base::JoinString(std::vector<base::string16>( - hostnames.begin(), hostnames.end()), - base::ASCIIToUTF16(" "))))); + id, JoinString(std::vector<base::string16>(hostnames.begin(), + hostnames.end()), + ' ')))); } if (ids) { for (const auto& hostname : hostnames) diff --git a/extensions/common/csp_validator.cc b/extensions/common/csp_validator.cc index a984e3d..06ea4ef 100644 --- a/extensions/common/csp_validator.cc +++ b/extensions/common/csp_validator.cc @@ -297,7 +297,7 @@ std::string SanitizeContentSecurityPolicy( } } - return base::JoinString(sane_csp_parts, " "); + return JoinString(sane_csp_parts, ' '); } bool ContentSecurityPolicyIsSandboxed( diff --git a/extensions/common/features/base_feature_provider.cc b/extensions/common/features/base_feature_provider.cc index 472e1f55..9d24d84 100644 --- a/extensions/common/features/base_feature_provider.cc +++ b/extensions/common/features/base_feature_provider.cc @@ -62,7 +62,7 @@ BaseFeatureProvider::BaseFeatureProvider(const base::DictionaryValue& root, std::stack<std::pair<std::string, const base::DictionaryValue*> > parse_stack; while (!split.empty()) { - std::string parent_name = base::JoinString(split, "."); + std::string parent_name = JoinString(split, '.'); split.pop_back(); if (root.HasKey(parent_name)) { const base::DictionaryValue* parent = nullptr; @@ -176,7 +176,7 @@ Feature* BaseFeatureProvider::GetParent(Feature* feature) const { if (split.size() < 2) return nullptr; split.pop_back(); - return GetFeature(base::JoinString(split, ".")); + return GetFeature(JoinString(split, '.')); } // Children of a given API are named starting with parent.name()+".", which diff --git a/extensions/common/permissions/permission_message_test_util.cc b/extensions/common/permissions/permission_message_test_util.cc index 32890fd..47e9913 100644 --- a/extensions/common/permissions/permission_message_test_util.cc +++ b/extensions/common/permissions/permission_message_test_util.cc @@ -102,7 +102,7 @@ base::string16 MessagesVectorToString( if (messages.empty()) return base::ASCIIToUTF16("\n"); return base::ASCIIToUTF16("\"") + - base::JoinString(messages, base::ASCIIToUTF16("\"\n\"")) + + JoinString(messages, base::ASCIIToUTF16("\"\n\"")) + base::ASCIIToUTF16("\"\n"); } diff --git a/extensions/common/permissions/socket_permission_entry.cc b/extensions/common/permissions/socket_permission_entry.cc index 8b2d355..6adf307 100644 --- a/extensions/common/permissions/socket_permission_entry.cc +++ b/extensions/common/permissions/socket_permission_entry.cc @@ -178,7 +178,7 @@ bool SocketPermissionEntry::ParseHostPattern( } else { result.match_subdomains_ = false; } - result.pattern_.host = base::JoinString(host_components, "."); + result.pattern_.host = JoinString(host_components, kDot); } if (pattern_tokens.size() == 1 || pattern_tokens[1].empty() || diff --git a/extensions/common/permissions/usb_device_permission.cc b/extensions/common/permissions/usb_device_permission.cc index 59b28d5..4384b32 100644 --- a/extensions/common/permissions/usb_device_permission.cc +++ b/extensions/common/permissions/usb_device_permission.cc @@ -117,11 +117,11 @@ void AddPermissionsToLists(const std::set<UsbDevicePermissionData>& data_set, } if (messages) { - messages->push_back(PermissionMessage( - PermissionMessage::kUsbDevice, - l10n_util::GetStringUTF16( - IDS_EXTENSION_PROMPT_WARNING_USB_DEVICE_LIST), - base::JoinString(details, base::ASCIIToUTF16("\n")))); + messages->push_back( + PermissionMessage(PermissionMessage::kUsbDevice, + l10n_util::GetStringUTF16( + IDS_EXTENSION_PROMPT_WARNING_USB_DEVICE_LIST), + JoinString(details, base::char16('\n')))); } if (ids) { for (const auto& detail : details) diff --git a/extensions/common/url_pattern.cc b/extensions/common/url_pattern.cc index 502c459..b72ce30 100644 --- a/extensions/common/url_pattern.cc +++ b/extensions/common/url_pattern.cc @@ -249,7 +249,7 @@ URLPattern::ParseResult URLPattern::Parse(const std::string& pattern) { host_components.erase(host_components.begin(), host_components.begin() + 1); } - host_ = base::JoinString(host_components, "."); + host_ = JoinString(host_components, '.'); path_start_pos = host_end_pos; } diff --git a/extensions/renderer/print_native_handler.cc b/extensions/renderer/print_native_handler.cc index b6ee63a..8e71eb5 100644 --- a/extensions/renderer/print_native_handler.cc +++ b/extensions/renderer/print_native_handler.cc @@ -26,7 +26,7 @@ void PrintNativeHandler::Print( for (int i = 0; i < args.Length(); ++i) components.push_back(*v8::String::Utf8Value(args[i])); - LOG(ERROR) << base::JoinString(components, ","); + LOG(ERROR) << JoinString(components, ','); } } // namespace extensions diff --git a/gin/modules/console.cc b/gin/modules/console.cc index 231d8fc..75241df 100644 --- a/gin/modules/console.cc +++ b/gin/modules/console.cc @@ -25,7 +25,7 @@ void Log(Arguments* args) { args->ThrowError(); return; } - std::cout << base::JoinString(messages, " ") << std::endl; + std::cout << JoinString(messages, ' ') << std::endl; } WrapperInfo g_wrapper_info = { kEmbedderNativeGin }; diff --git a/google_apis/gaia/fake_gaia.cc b/google_apis/gaia/fake_gaia.cc index 7c73dd8..bbf5216 100644 --- a/google_apis/gaia/fake_gaia.cc +++ b/google_apis/gaia/fake_gaia.cc @@ -708,7 +708,7 @@ void FakeGaia::HandleTokenInfo(const HttpRequest& request, response_dict.SetString("user_id", token_info->user_id); std::vector<std::string> scope_vector(token_info->scopes.begin(), token_info->scopes.end()); - response_dict.SetString("scope", base::JoinString(scope_vector, " ")); + response_dict.SetString("scope", JoinString(scope_vector, " ")); response_dict.SetInteger("expires_in", token_info->expires_in); response_dict.SetString("email", token_info->email); FormatJSONResponse(response_dict, http_response); diff --git a/google_apis/gaia/gaia_auth_util.cc b/google_apis/gaia/gaia_auth_util.cc index 5464da6..e9ec545 100644 --- a/google_apis/gaia/gaia_auth_util.cc +++ b/google_apis/gaia/gaia_auth_util.cc @@ -36,8 +36,7 @@ std::string CanonicalizeEmailImpl(const std::string& email_address, base::RemoveChars(parts[0], ".", &parts[0]); } - std::string new_email = base::StringToLowerASCII( - base::JoinString(parts, "@")); + std::string new_email = base::StringToLowerASCII(JoinString(parts, at)); VLOG(1) << "Canonicalized " << email_address << " to " << new_email; return new_email; } diff --git a/google_apis/gaia/gaia_oauth_client.cc b/google_apis/gaia/gaia_oauth_client.cc index c021623..14c3cc3 100644 --- a/google_apis/gaia/gaia_oauth_client.cc +++ b/google_apis/gaia/gaia_oauth_client.cc @@ -137,7 +137,7 @@ void GaiaOAuthClient::Core::RefreshToken( "&grant_type=refresh_token"; if (!scopes.empty()) { - std::string scopes_string = base::JoinString(scopes, " "); + std::string scopes_string = JoinString(scopes, ' '); post_body += "&scope=" + net::EscapeUrlEncodedData(scopes_string, true); } diff --git a/google_apis/gaia/oauth2_access_token_fetcher_impl.cc b/google_apis/gaia/oauth2_access_token_fetcher_impl.cc index 1945c79..b513b78 100644 --- a/google_apis/gaia/oauth2_access_token_fetcher_impl.cc +++ b/google_apis/gaia/oauth2_access_token_fetcher_impl.cc @@ -283,7 +283,7 @@ std::string OAuth2AccessTokenFetcherImpl::MakeGetAccessTokenBody( enc_client_secret.c_str(), enc_refresh_token.c_str()); } else { - std::string scopes_string = base::JoinString(scopes, " "); + std::string scopes_string = JoinString(scopes, ' '); return base::StringPrintf( kGetAccessTokenBodyWithScopeFormat, enc_client_id.c_str(), diff --git a/google_apis/gaia/oauth2_mint_token_flow.cc b/google_apis/gaia/oauth2_mint_token_flow.cc index c2a6501..0316c63 100644 --- a/google_apis/gaia/oauth2_mint_token_flow.cc +++ b/google_apis/gaia/oauth2_mint_token_flow.cc @@ -167,7 +167,7 @@ std::string OAuth2MintTokenFlow::CreateApiCallBody() { net::EscapeUrlEncodedData(force_value, true).c_str(), net::EscapeUrlEncodedData(response_type_value, true).c_str(), net::EscapeUrlEncodedData( - base::JoinString(parameters_.scopes, " "), true).c_str(), + JoinString(parameters_.scopes, ' '), true).c_str(), net::EscapeUrlEncodedData(parameters_.client_id, true).c_str(), net::EscapeUrlEncodedData(parameters_.extension_id, true).c_str()); if (!parameters_.device_id.empty()) { diff --git a/media/capture/capture_resolution_chooser.cc b/media/capture/capture_resolution_chooser.cc index d61fd76..768e129 100644 --- a/media/capture/capture_resolution_chooser.cc +++ b/media/capture/capture_resolution_chooser.cc @@ -231,7 +231,7 @@ void CaptureResolutionChooser::UpdateSnappedFrameSizes( for (const gfx::Size& size : snapped_sizes_) stringified_sizes.push_back(size.ToString()); VLOG_STREAM(1) << "Recomputed snapped frame sizes: " - << base::JoinString(stringified_sizes, " <--> "); + << JoinString(stringified_sizes, " <--> "); } } diff --git a/net/websockets/websocket_basic_handshake_stream.cc b/net/websockets/websocket_basic_handshake_stream.cc index a253e2e..616dbb1 100644 --- a/net/websockets/websocket_basic_handshake_stream.cc +++ b/net/websockets/websocket_basic_handshake_stream.cc @@ -99,7 +99,7 @@ void AddVectorHeaderIfNonEmpty(const char* name, HttpRequestHeaders* headers) { if (value.empty()) return; - headers->SetHeader(name, base::JoinString(value, ", ")); + headers->SetHeader(name, JoinString(value, ", ")); } GetHeaderResult GetSingleHeaderValue(const HttpResponseHeaders* headers, @@ -346,7 +346,7 @@ bool ValidateExtensions(const HttpResponseHeaders* headers, } } } - *accepted_extensions_descriptor = base::JoinString(header_values, ", "); + *accepted_extensions_descriptor = JoinString(header_values, ", "); return true; } diff --git a/remoting/base/capabilities.cc b/remoting/base/capabilities.cc index 4903aed..1226492 100644 --- a/remoting/base/capabilities.cc +++ b/remoting/base/capabilities.cc @@ -36,7 +36,7 @@ std::string IntersectCapabilities(const std::string& client_capabilities, base::STLSetIntersection<std::vector<std::string> >( client_caps, host_caps); - return base::JoinString(result, " "); + return JoinString(result, " "); } } // namespace remoting diff --git a/remoting/base/capabilities_unittest.cc b/remoting/base/capabilities_unittest.cc index 90c12a0..71dbd56 100644 --- a/remoting/base/capabilities_unittest.cc +++ b/remoting/base/capabilities_unittest.cc @@ -67,7 +67,7 @@ TEST(CapabilitiesTest, HasCapability) { base::SPLIT_WANT_NONEMPTY); do { EXPECT_EQ(data[i].result, - HasCapability(base::JoinString(caps, " "), data[i].key)); + HasCapability(JoinString(caps, " "), data[i].key)); } while (std::next_permutation(caps.begin(), caps.end())); } } @@ -98,8 +98,7 @@ TEST(CapabilitiesTest, Intersect) { data[i].left, " ", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); do { EXPECT_EQ(data[i].result, - IntersectCapabilities(base::JoinString(caps, " "), - data[i].right)); + IntersectCapabilities(JoinString(caps, " "), data[i].right)); } while (std::next_permutation(caps.begin(), caps.end())); } } diff --git a/sql/recovery.cc b/sql/recovery.cc index 4308129..f179a63 100644 --- a/sql/recovery.cc +++ b/sql/recovery.cc @@ -456,12 +456,12 @@ bool Recovery::AutoRecoverTable(const char* table_name, "CREATE VIRTUAL TABLE temp.recover_%s USING recover(corrupt.%s, %s)", table_name, table_name, - base::JoinString(create_column_decls, ",").c_str())); + JoinString(create_column_decls, ',').c_str())); std::string recover_insert(base::StringPrintf( "INSERT OR REPLACE INTO main.%s SELECT %s FROM temp.recover_%s", table_name, - base::JoinString(insert_columns, ",").c_str(), + JoinString(insert_columns, ',').c_str(), table_name)); std::string recover_drop(base::StringPrintf( diff --git a/tools/set_default_handler/set_default_handler_main.cc b/tools/set_default_handler/set_default_handler_main.cc index 92edb6c..8b4b343 100644 --- a/tools/set_default_handler/set_default_handler_main.cc +++ b/tools/set_default_handler/set_default_handler_main.cc @@ -56,7 +56,7 @@ int wmain(int argc, wchar_t* argv[]) { printf("success\n"); } else if (!choices.empty()) { printf("failed to set program. possible choices: %ls\n", - base::JoinString(choices, L", ").c_str()); + JoinString(choices, L", ").c_str()); } else { printf("failed with HRESULT: %0x08X\n", result); } diff --git a/ui/app_list/search/history.cc b/ui/app_list/search/history.cc index 7d38bb2..6c54024 100644 --- a/ui/app_list/search/history.cc +++ b/ui/app_list/search/history.cc @@ -17,8 +17,7 @@ namespace { // Normalize the given string by joining all its tokens with a space. std::string NormalizeString(const std::string& utf8) { TokenizedString tokenized(base::UTF8ToUTF16(utf8)); - return base::UTF16ToUTF8( - base::JoinString(tokenized.tokens(), base::ASCIIToUTF16(" "))); + return base::UTF16ToUTF8(JoinString(tokenized.tokens(), ' ')); } } // namespace diff --git a/ui/app_list/search/tokenized_string_char_iterator_unittest.cc b/ui/app_list/search/tokenized_string_char_iterator_unittest.cc index d5fe1b3..3846014 100644 --- a/ui/app_list/search/tokenized_string_char_iterator_unittest.cc +++ b/ui/app_list/search/tokenized_string_char_iterator_unittest.cc @@ -48,7 +48,7 @@ void TestEveryChar(const std::string& text, const std::string& expects) { iter.NextChar(); } - EXPECT_EQ(expects, base::JoinString(results, " ")); + EXPECT_EQ(expects, JoinString(results, ' ')); TestBeyondTheEnd(&iter); } @@ -62,7 +62,7 @@ void TestNextToken(const std::string& text, const std::string& expects) { iter.NextToken(); } - EXPECT_EQ(expects, base::JoinString(results, " ")); + EXPECT_EQ(expects, JoinString(results, ' ')); TestBeyondTheEnd(&iter); } @@ -80,7 +80,7 @@ void TestFirstTwoCharInEveryToken(const std::string& text, iter.NextToken(); } - EXPECT_EQ(expects, base::JoinString(results, " ")); + EXPECT_EQ(expects, JoinString(results, ' ')); TestBeyondTheEnd(&iter); } diff --git a/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc b/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc index 73ec4bf..e7a815c4 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc +++ b/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc @@ -199,7 +199,7 @@ void OSExchangeDataProviderAuraX11::SetFilenames( paths.push_back(url_spec); } - std::string joined_data = base::JoinString(paths, "\n"); + std::string joined_data = JoinString(paths, '\n'); scoped_refptr<base::RefCountedMemory> mem( base::RefCountedString::TakeString(&joined_data)); format_map_.Insert(atom_cache_.GetAtom(Clipboard::kMimeTypeURIList), mem); diff --git a/ui/gfx/font_list_impl.cc b/ui/gfx/font_list_impl.cc index 907f4ef..4037032 100644 --- a/ui/gfx/font_list_impl.cc +++ b/ui/gfx/font_list_impl.cc @@ -18,7 +18,7 @@ namespace { std::string BuildDescription(const std::vector<std::string>& families, int style, int size_pixels) { - std::string description = base::JoinString(families, ","); + std::string description = JoinString(families, ','); description += ","; if (style & gfx::Font::BOLD) diff --git a/ui/gfx/font_render_params_linux.cc b/ui/gfx/font_render_params_linux.cc index b62c525..f09f703 100644 --- a/ui/gfx/font_render_params_linux.cc +++ b/ui/gfx/font_render_params_linux.cc @@ -192,8 +192,7 @@ bool QueryFontconfig(const FontRenderParamsQuery& query, uint32 HashFontRenderParamsQuery(const FontRenderParamsQuery& query) { return base::Hash(base::StringPrintf( "%d|%d|%d|%s|%f", query.pixel_size, query.point_size, query.style, - base::JoinString(query.families, ",").c_str(), - query.device_scale_factor)); + JoinString(query.families, ',').c_str(), query.device_scale_factor)); } } // namespace diff --git a/ui/gfx/text_elider_unittest.cc b/ui/gfx/text_elider_unittest.cc index b0baa42..5eeea5c 100644 --- a/ui/gfx/text_elider_unittest.cc +++ b/ui/gfx/text_elider_unittest.cc @@ -668,8 +668,7 @@ TEST(TextEliderTest, MAYBE_ElideRectangleText) { TRUNCATE_LONG_WORDS, &lines)); if (cases[i].output) { - const std::string result = - UTF16ToUTF8(base::JoinString(lines, ASCIIToUTF16("|"))); + const std::string result = UTF16ToUTF8(JoinString(lines, '|')); EXPECT_EQ(cases[i].output, result) << "Case " << i << " failed!"; } else { EXPECT_TRUE(lines.empty()) << "Case " << i << " failed!"; @@ -716,8 +715,7 @@ TEST(TextEliderTest, MAYBE_ElideRectangleTextPunctuation) { wrap_behavior, &lines)); if (cases[i].output) { - const std::string result = - UTF16ToUTF8(base::JoinString(lines, base::ASCIIToUTF16("|"))); + const std::string result = UTF16ToUTF8(JoinString(lines, '|')); EXPECT_EQ(cases[i].output, result) << "Case " << i << " failed!"; } else { EXPECT_TRUE(lines.empty()) << "Case " << i << " failed!"; @@ -786,8 +784,7 @@ TEST(TextEliderTest, MAYBE_ElideRectangleTextLongWords) { &lines)); std::string expected_output(cases[i].output); base::ReplaceSubstringsAfterOffset(&expected_output, 0, "...", kEllipsis); - const std::string result = - UTF16ToUTF8(base::JoinString(lines, base::ASCIIToUTF16("|"))); + const std::string result = UTF16ToUTF8(JoinString(lines, '|')); EXPECT_EQ(expected_output, result) << "Case " << i << " failed!"; } } diff --git a/ui/gl/gl_context.cc b/ui/gl/gl_context.cc index 2098411..1049bfd 100644 --- a/ui/gl/gl_context.cc +++ b/ui/gl/gl_context.cc @@ -100,7 +100,7 @@ std::string GLContext::GetExtensions() { DCHECK(extension != nullptr); exts.push_back(extension); } - return base::JoinString(exts, " "); + return JoinString(exts, " "); } std::string GLContext::GetGLVersion() { diff --git a/ui/gl/gl_gl_api_implementation.cc b/ui/gl/gl_gl_api_implementation.cc index 76af744..1d6fcb1 100644 --- a/ui/gl/gl_gl_api_implementation.cc +++ b/ui/gl/gl_gl_api_implementation.cc @@ -492,7 +492,7 @@ void RealGLApi::InitializeFilteredExtensions() { } // Construct filtered extensions string for GL_EXTENSIONS string lookups. - filtered_exts_str_ = base::JoinString(filtered_exts_, " "); + filtered_exts_str_ = JoinString(filtered_exts_, " "); } } @@ -530,7 +530,7 @@ void VirtualGLApi::Initialize(DriverGL* driver, GLContext* real_context) { if (it != ext.end()) ext.erase(it); - extensions_ = base::JoinString(ext, " "); + extensions_ = JoinString(ext, " "); } bool VirtualGLApi::MakeCurrent(GLContext* virtual_context, GLSurface* surface) { diff --git a/ui/gl/gl_implementation.cc b/ui/gl/gl_implementation.cc index 96921bc..4fae0ec 100644 --- a/ui/gl/gl_implementation.cc +++ b/ui/gl/gl_implementation.cc @@ -173,7 +173,7 @@ std::string FilterGLExtensionList( std::remove_if(extension_vec.begin(), extension_vec.end(), is_disabled), extension_vec.end()); - return base::JoinString(extension_vec, " "); + return JoinString(extension_vec, " "); } DisableNullDrawGLBindings::DisableNullDrawGLBindings() { diff --git a/ui/message_center/cocoa/notification_controller.mm b/ui/message_center/cocoa/notification_controller.mm index 1b4e96a..f9266a2 100644 --- a/ui/message_center/cocoa/notification_controller.mm +++ b/ui/message_center/cocoa/notification_controller.mm @@ -883,8 +883,7 @@ } *actualLines = wrapped.size(); - return lines == 1 ? wrapped[0] - : base::JoinString(wrapped, base::ASCIIToUTF16("\n")); + return lines == 1 ? wrapped[0] : JoinString(wrapped, '\n'); } - (base::string16)wrapText:(const base::string16&)text diff --git a/ui/message_center/views/bounded_label.cc b/ui/message_center/views/bounded_label.cc index f9f6ffb..5bf6f15 100644 --- a/ui/message_center/views/bounded_label.cc +++ b/ui/message_center/views/bounded_label.cc @@ -113,10 +113,10 @@ gfx::Size InnerBoundedLabel::GetSizeForWidthAndLines(int width, int lines) { std::max(width - insets.width(), 0); int text_height = std::numeric_limits<int>::max(); std::vector<base::string16> wrapped = GetWrappedText(text_width, lines); - gfx::Canvas::SizeStringInt( - base::JoinString(wrapped, base::ASCIIToUTF16("\n")), - font_list(), &text_width, &text_height, owner_->GetLineHeight(), - GetTextFlags()); + gfx::Canvas::SizeStringInt(JoinString(wrapped, '\n'), font_list(), + &text_width, &text_height, + owner_->GetLineHeight(), + GetTextFlags()); size.set_width(text_width + insets.width()); size.set_height(text_height + insets.height()); SetCachedSize(key, size); @@ -177,8 +177,7 @@ void InnerBoundedLabel::OnPaint(gfx::Canvas* canvas) { gfx::Rect bounds(width(), height); bounds.Inset(owner_->GetInsets()); if (bounds.width() != wrapped_text_width_ || lines != wrapped_text_lines_) { - wrapped_text_ = base::JoinString(GetWrappedText(bounds.width(), lines), - base::ASCIIToUTF16("\n")); + wrapped_text_ = JoinString(GetWrappedText(bounds.width(), lines), '\n'); wrapped_text_width_ = bounds.width(); wrapped_text_lines_ = lines; } @@ -344,8 +343,7 @@ void BoundedLabel::OnNativeThemeChanged(const ui::NativeTheme* theme) { } base::string16 BoundedLabel::GetWrappedTextForTest(int width, int lines) { - return base::JoinString(label_->GetWrappedText(width, lines), - base::ASCIIToUTF16("\n")); + return JoinString(label_->GetWrappedText(width, lines), '\n'); } } // namespace message_center diff --git a/ui/message_center/views/notification_view.cc b/ui/message_center/views/notification_view.cc index e9294f8..5f314b5 100644 --- a/ui/message_center/views/notification_view.cc +++ b/ui/message_center/views/notification_view.cc @@ -334,8 +334,7 @@ void NotificationView::SetAccessibleName(const Notification& notification) { accessible_lines.push_back(items[i].title + base::ASCIIToUTF16(" ") + items[i].message); } - set_accessible_name( - base::JoinString(accessible_lines, base::ASCIIToUTF16("\n"))); + set_accessible_name(JoinString(accessible_lines, '\n')); } NotificationView::NotificationView(MessageCenterController* controller, diff --git a/ui/views/controls/table/table_view.cc b/ui/views/controls/table/table_view.cc index 6c37e52..8104a96 100644 --- a/ui/views/controls/table/table_view.cc +++ b/ui/views/controls/table/table_view.cc @@ -448,7 +448,7 @@ void TableView::GetAccessibleState(ui::AXViewState* state) { name_parts.push_back(value); } } - state->name = base::JoinString(name_parts, base::ASCIIToUTF16(", ")); + state->name = JoinString(name_parts, base::ASCIIToUTF16(", ")); } } |