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

Unified Diff: base/json/string_escape.h

Issue 18648003: Let JsonDoubleQuote accept StringPiece (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/json/string_escape.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/string_escape.h
diff --git a/base/json/string_escape.h b/base/json/string_escape.h
index 5efc350dea85f864506deaca5c2c40065e95426c..0f16f59d4fd8bc3d427b751385272b08f175b212 100644
--- a/base/json/string_escape.h
+++ b/base/json/string_escape.h
@@ -10,7 +10,7 @@
#include <string>
#include "base/base_export.h"
-#include "base/strings/string16.h"
+#include "base/strings/string_piece.h"
namespace base {
@@ -19,19 +19,19 @@ namespace base {
// If |put_in_quotes| is true, the result will be surrounded in double quotes.
// The outputted literal, when interpreted by the browser, should result in a
// javascript string that is identical and the same length as the input |str|.
-BASE_EXPORT void JsonDoubleQuote(const std::string& str,
+BASE_EXPORT void JsonDoubleQuote(const StringPiece& str,
bool put_in_quotes,
std::string* dst);
// Same as above, but always returns the result double quoted.
-BASE_EXPORT std::string GetDoubleQuotedJson(const std::string& str);
+BASE_EXPORT std::string GetDoubleQuotedJson(const StringPiece& str);
-BASE_EXPORT void JsonDoubleQuote(const string16& str,
+BASE_EXPORT void JsonDoubleQuote(const StringPiece16& str,
bool put_in_quotes,
std::string* dst);
// Same as above, but always returns the result double quoted.
-BASE_EXPORT std::string GetDoubleQuotedJson(const string16& str);
+BASE_EXPORT std::string GetDoubleQuotedJson(const StringPiece16& str);
} // namespace base
« no previous file with comments | « no previous file | base/json/string_escape.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698