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

Unified Diff: chrome/browser/spellchecker/spelling_service_client.cc

Issue 100823007: Stop doing unnecessary UTF-8 to UTF-16 conversions in JSONWriter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ChromeOS page encodings Created 7 years 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 | « chrome/browser/search/iframe_source.cc ('k') | chrome/browser/ui/webui/about_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/spellchecker/spelling_service_client.cc
diff --git a/chrome/browser/spellchecker/spelling_service_client.cc b/chrome/browser/spellchecker/spelling_service_client.cc
index e960d1dd41a324411425762c7ef5757368115219..248c2295c35bc205422e1045d47c1a45b6a23c8f 100644
--- a/chrome/browser/spellchecker/spelling_service_client.cc
+++ b/chrome/browser/spellchecker/spelling_service_client.cc
@@ -69,21 +69,20 @@ bool SpellingServiceClient::RequestTextCheck(
&country_code);
// Format the JSON request to be sent to the Spelling service.
- std::string encoded_text;
- base::JsonDoubleQuote(text, false, &encoded_text);
+ std::string encoded_text = base::GetQuotedJSONString(text);
static const char kSpellingRequest[] =
"{"
"\"method\":\"spelling.check\","
"\"apiVersion\":\"v%d\","
"\"params\":{"
- "\"text\":\"%s\","
+ "\"text\":%s,"
"\"language\":\"%s\","
"\"originCountry\":\"%s\","
"\"key\":%s"
"}"
"}";
- std::string api_key = base::GetDoubleQuotedJson(google_apis::GetAPIKey());
+ std::string api_key = base::GetQuotedJSONString(google_apis::GetAPIKey());
std::string request = base::StringPrintf(
kSpellingRequest,
type,
« no previous file with comments | « chrome/browser/search/iframe_source.cc ('k') | chrome/browser/ui/webui/about_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698