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

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

Issue 110533002: [rac] Temporarily copy libaddressinput to Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Avoid redefinition of basictypes.h 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 | « third_party/libaddressinput/chromium/util/json.h ('k') | third_party/libaddressinput/libaddressinput.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libaddressinput/chromium/util/json.cc
diff --git a/third_party/libaddressinput/chromium/util/json.cc b/third_party/libaddressinput/chromium/util/json.cc
deleted file mode 100644
index 604e1bda13f6e7ff729e39dcdfb059bcb0397072..0000000000000000000000000000000000000000
--- a/third_party/libaddressinput/chromium/util/json.cc
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "util/json.h"
-
-#include "base/json/json_reader.h"
-#include "base/logging.h"
-
-namespace i18n {
-namespace addressinput {
-
-Json::Json() {}
-Json::~Json() {}
-
-bool Json::ParseObject(const std::string& json) {
- dict_.reset();
-
- // |json| is converted to a |c_str()| here because rapidjson and other parts
- // of the standalone library use char* rather than std::string.
- scoped_ptr<base::Value> parsed(base::JSONReader::Read(json.c_str()));
- if (parsed && parsed->IsType(base::Value::TYPE_DICTIONARY))
- dict_.reset(static_cast<base::DictionaryValue*>(parsed.release()));
-
- return !!dict_;
-}
-
-bool Json::HasStringValueForKey(const std::string& key) const {
- base::Value* val = NULL;
- dict_->GetWithoutPathExpansion(key, &val);
- return val && val->IsType(base::Value::TYPE_STRING);
-}
-
-std::string Json::GetStringValueForKey(const std::string& key) const {
- std::string result;
- dict_->GetStringWithoutPathExpansion(key, &result);
- return result;
-}
-
-} // namespace addressinput
-} // namespace i18n
« no previous file with comments | « third_party/libaddressinput/chromium/util/json.h ('k') | third_party/libaddressinput/libaddressinput.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698