Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: extensions/common/error_utils.h

Issue 2604033002: [Extensions] Use base::StringPiece in ErrorUtils (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | extensions/common/error_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef EXTENSIONS_COMMON_ERROR_UTILS_H_ 5 #ifndef EXTENSIONS_COMMON_ERROR_UTILS_H_
6 #define EXTENSIONS_COMMON_ERROR_UTILS_H_ 6 #define EXTENSIONS_COMMON_ERROR_UTILS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 #include "base/strings/string_piece.h"
11 12
12 namespace extensions { 13 namespace extensions {
13 14
14 class ErrorUtils { 15 class ErrorUtils {
15 public: 16 public:
16 // Creates an error messages from a pattern. 17 // Creates an error messages from a pattern.
17 static std::string FormatErrorMessage(const std::string& format, 18 static std::string FormatErrorMessage(base::StringPiece format,
18 const std::string& s1); 19 base::StringPiece s1);
19 20
20 static std::string FormatErrorMessage(const std::string& format, 21 static std::string FormatErrorMessage(base::StringPiece format,
21 const std::string& s1, 22 base::StringPiece s1,
22 const std::string& s2); 23 base::StringPiece s2);
23 24
24 static std::string FormatErrorMessage(const std::string& format, 25 static std::string FormatErrorMessage(base::StringPiece format,
25 const std::string& s1, 26 base::StringPiece s1,
26 const std::string& s2, 27 base::StringPiece s2,
27 const std::string& s3); 28 base::StringPiece s3);
28 29
29 static base::string16 FormatErrorMessageUTF16(const std::string& format, 30 static base::string16 FormatErrorMessageUTF16(base::StringPiece format,
30 const std::string& s1); 31 base::StringPiece s1);
31 32
32 static base::string16 FormatErrorMessageUTF16(const std::string& format, 33 static base::string16 FormatErrorMessageUTF16(base::StringPiece format,
33 const std::string& s1, 34 base::StringPiece s1,
34 const std::string& s2); 35 base::StringPiece s2);
35 36
36 static base::string16 FormatErrorMessageUTF16(const std::string& format, 37 static base::string16 FormatErrorMessageUTF16(base::StringPiece format,
37 const std::string& s1, 38 base::StringPiece s1,
38 const std::string& s2, 39 base::StringPiece s2,
39 const std::string& s3); 40 base::StringPiece s3);
40 }; 41 };
41 42
42 } // namespace extensions 43 } // namespace extensions
43 44
44 #endif // EXTENSIONS_COMMON_ERROR_UTILS_H_ 45 #endif // EXTENSIONS_COMMON_ERROR_UTILS_H_
OLDNEW
« no previous file with comments | « no previous file | extensions/common/error_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698