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

Unified Diff: base/json/json_parser.cc

Issue 2516363005: Inline StringValue into base::Value (Closed)
Patch Set: Reimplement old base::Value::GetAsString behavior in json_parser. Created 4 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 | « no previous file | base/values.h » ('j') | base/values.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_parser.cc
diff --git a/base/json/json_parser.cc b/base/json/json_parser.cc
index cd427da9ea2537fa86c103452d72505731ab6129..f7b4179f2e320b88585ce2d69894f093b1c45411 100644
--- a/base/json/json_parser.cc
+++ b/base/json/json_parser.cc
@@ -151,6 +151,12 @@ class JSONStringValue : public Value {
*out_value = UTF8ToUTF16(string_piece_);
return true;
}
+ // base::Value::GetAsString contains a proper implementation now, so the old
+ // behavior is copied here.
+ // TODO(jdoerrie): Clean this up when StringValue will be removed.
vabr (Chromium) 2016/12/07 10:17:27 nit: It is a good practice to also mention the bug
jdoerrie 2016/12/08 09:59:34 Done.
+ bool GetAsString(const StringValue** out_value) const override {
+ return false;
+ }
Value* DeepCopy() const override { return new StringValue(string_piece_); }
bool Equals(const Value* other) const override {
std::string other_string;
« no previous file with comments | « no previous file | base/values.h » ('j') | base/values.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698