| Index: extensions/common/error_utils.cc
|
| diff --git a/extensions/common/error_utils.cc b/extensions/common/error_utils.cc
|
| index 14ca2a96c2f8aca36f5885c7e27845bbf4aa8aca..f8f04b7c617e27d0bb6d6f637e4c0851c3a79310 100644
|
| --- a/extensions/common/error_utils.cc
|
| +++ b/extensions/common/error_utils.cc
|
| @@ -9,48 +9,48 @@
|
|
|
| namespace extensions {
|
|
|
| -std::string ErrorUtils::FormatErrorMessage(const std::string& format,
|
| - const std::string& s1) {
|
| - std::string ret_val = format;
|
| +std::string ErrorUtils::FormatErrorMessage(base::StringPiece format,
|
| + base::StringPiece s1) {
|
| + std::string ret_val = format.as_string();
|
| base::ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1);
|
| return ret_val;
|
| }
|
|
|
| -std::string ErrorUtils::FormatErrorMessage(const std::string& format,
|
| - const std::string& s1,
|
| - const std::string& s2) {
|
| - std::string ret_val = format;
|
| +std::string ErrorUtils::FormatErrorMessage(base::StringPiece format,
|
| + base::StringPiece s1,
|
| + base::StringPiece s2) {
|
| + std::string ret_val = format.as_string();
|
| base::ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1);
|
| base::ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s2);
|
| return ret_val;
|
| }
|
|
|
| -std::string ErrorUtils::FormatErrorMessage(const std::string& format,
|
| - const std::string& s1,
|
| - const std::string& s2,
|
| - const std::string& s3) {
|
| - std::string ret_val = format;
|
| +std::string ErrorUtils::FormatErrorMessage(base::StringPiece format,
|
| + base::StringPiece s1,
|
| + base::StringPiece s2,
|
| + base::StringPiece s3) {
|
| + std::string ret_val = format.as_string();
|
| base::ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1);
|
| base::ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s2);
|
| base::ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s3);
|
| return ret_val;
|
| }
|
|
|
| -base::string16 ErrorUtils::FormatErrorMessageUTF16(const std::string& format,
|
| - const std::string& s1) {
|
| +base::string16 ErrorUtils::FormatErrorMessageUTF16(base::StringPiece format,
|
| + base::StringPiece s1) {
|
| return base::UTF8ToUTF16(FormatErrorMessage(format, s1));
|
| }
|
|
|
| -base::string16 ErrorUtils::FormatErrorMessageUTF16(const std::string& format,
|
| - const std::string& s1,
|
| - const std::string& s2) {
|
| +base::string16 ErrorUtils::FormatErrorMessageUTF16(base::StringPiece format,
|
| + base::StringPiece s1,
|
| + base::StringPiece s2) {
|
| return base::UTF8ToUTF16(FormatErrorMessage(format, s1, s2));
|
| }
|
|
|
| -base::string16 ErrorUtils::FormatErrorMessageUTF16(const std::string& format,
|
| - const std::string& s1,
|
| - const std::string& s2,
|
| - const std::string& s3) {
|
| +base::string16 ErrorUtils::FormatErrorMessageUTF16(base::StringPiece format,
|
| + base::StringPiece s1,
|
| + base::StringPiece s2,
|
| + base::StringPiece s3) {
|
| return base::UTF8ToUTF16(FormatErrorMessage(format, s1, s2, s3));
|
| }
|
|
|
|
|