From 08daf0542dc5743a82bf55e8684bf1625ad7d997 Mon Sep 17 00:00:00 2001 From: "tony@chromium.org" Date: Thu, 29 Oct 2009 19:48:54 +0000 Subject: Convert ReplaceStringPlaceholders(std::string...) to take a StringPiece as the format string instead. This allows us to save a string copy in the new tab page. Also clean up some code in the extensions process binding that was doing excess string conversions. BUG=26228 Review URL: http://codereview.chromium.org/347019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30491 0039d316-1c4b-4281-b951-d872f2087c98 --- app/l10n_util.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/l10n_util.cc') diff --git a/app/l10n_util.cc b/app/l10n_util.cc index 854d0a0..c04d3d5 100644 --- a/app/l10n_util.cc +++ b/app/l10n_util.cc @@ -525,6 +525,10 @@ static string16 GetStringF(int message_id, const string16& c, const string16& d, std::vector* offsets) { + // TODO(tc): We could save a string copy if we got the raw string as + // a StringPiece and were able to call ReplaceStringPlaceholders with + // a StringPiece format string and string16 substitution strings. In + // practice, the strings should be relatively short. ResourceBundle& rb = ResourceBundle::GetSharedInstance(); const string16& format_string = rb.GetLocalizedString(message_id); std::vector subst; -- cgit v1.1