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

Unified Diff: third_party/libaddressinput/chromium/json.cc

Issue 140823005: [rac] Download country code data in a single HTTP request. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/libaddressinput/chromium/json.cc
diff --git a/third_party/libaddressinput/chromium/json.cc b/third_party/libaddressinput/chromium/json.cc
index 4a0fcd5b6e1dfe950925a6dfdafa84b656ebc5aa..10b8856ab1020dd81e56cb09bf28ae62778d72aa 100644
--- a/third_party/libaddressinput/chromium/json.cc
+++ b/third_party/libaddressinput/chromium/json.cc
@@ -38,7 +38,25 @@ class ChromeJson : public Json {
return dict_->GetStringWithoutPathExpansion(key, value);
}
+ virtual bool GetJsonValueForKey(const std::string& key, Json** value)
+ const OVERRIDE {
+ base::DictionaryValue* sub_dict = NULL; // Owned by dict_.
+
+ if (!dict_->GetDictionaryWithoutPathExpansion(key, &sub_dict) || !sub_dict)
+ return false;
+
+ if (value) {
+ *value = new ChromeJson(
+ scoped_ptr<base::DictionaryValue>(sub_dict->DeepCopy()));
+ }
+
+ return true;
+ }
+
private:
+ explicit ChromeJson(scoped_ptr<base::DictionaryValue> dict)
+ : dict_(dict.Pass()) {}
+
scoped_ptr<base::DictionaryValue> dict_;
DISALLOW_COPY_AND_ASSIGN(ChromeJson);

Powered by Google App Engine
This is Rietveld 408576698