summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-29 19:48:54 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-29 19:48:54 +0000
commit08daf0542dc5743a82bf55e8684bf1625ad7d997 (patch)
treeff4c2a2199746fff3c6d29e46d32e7e0e9e5ced9 /app
parentaece9ccd4c38dca6daad04c94d1cc96677e1fbac (diff)
downloadchromium_src-08daf0542dc5743a82bf55e8684bf1625ad7d997.zip
chromium_src-08daf0542dc5743a82bf55e8684bf1625ad7d997.tar.gz
chromium_src-08daf0542dc5743a82bf55e8684bf1625ad7d997.tar.bz2
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
Diffstat (limited to 'app')
-rw-r--r--app/l10n_util.cc4
1 files changed, 4 insertions, 0 deletions
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<size_t>* 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<string16> subst;