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

Unified Diff: components/dom_distiller/core/viewer.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 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 | « components/dom_distiller/core/page_features_unittest.cc ('k') | components/domain_reliability/context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/core/viewer.cc
diff --git a/components/dom_distiller/core/viewer.cc b/components/dom_distiller/core/viewer.cc
index e19f3785f71b92c2243e8c07be8ea3b0429ace9f..0244a4f51733d59f06ff0ef96f3752fcbeb0a465 100644
--- a/components/dom_distiller/core/viewer.cc
+++ b/components/dom_distiller/core/viewer.cc
@@ -159,9 +159,9 @@ const std::string GetShowFeedbackFormJs() {
std::string yes;
std::string no;
- base::JSONWriter::Write(&question_val, &question);
- base::JSONWriter::Write(&yes_val, &yes);
- base::JSONWriter::Write(&no_val, &no);
+ base::JSONWriter::Write(question_val, &question);
+ base::JSONWriter::Write(yes_val, &yes);
+ base::JSONWriter::Write(no_val, &no);
return "showFeedbackForm(" + question + ", " + yes + ", " + no + ");";
}
@@ -172,7 +172,7 @@ const std::string GetUnsafeIncrementalDistilledPageJs(
std::string output(page_proto->html());
EnsureNonEmptyContent(&output);
base::StringValue value(output);
- base::JSONWriter::Write(&value, &output);
+ base::JSONWriter::Write(value, &output);
std::string page_update("addToPage(");
page_update += output + ");";
return page_update + GetToggleLoadingIndicatorJs(
@@ -184,7 +184,7 @@ const std::string GetErrorPageJs() {
base::StringValue value(l10n_util::GetStringUTF8(
IDS_DOM_DISTILLER_VIEWER_FAILED_TO_FIND_ARTICLE_CONTENT));
std::string output;
- base::JSONWriter::Write(&value, &output);
+ base::JSONWriter::Write(value, &output);
std::string page_update("addToPage(");
page_update += output + ");";
return page_update;
@@ -226,8 +226,7 @@ const std::string GetUnsafeArticleContentJs(
std::string output(unsafe_output_stream.str());
EnsureNonEmptyContent(&output);
- base::StringValue value(output);
- base::JSONWriter::Write(&value, &output);
+ base::JSONWriter::Write(base::StringValue(output), &output);
std::string page_update("addToPage(");
page_update += output + ");";
return page_update + GetToggleLoadingIndicatorJs(true);
« no previous file with comments | « components/dom_distiller/core/page_features_unittest.cc ('k') | components/domain_reliability/context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698