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

Side by Side Diff: third_party/libaddressinput/chromium/json.cc

Issue 1549373004: Fix an unneeded std::move in //third_party/libaddressinput. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "third_party/libaddressinput/src/cpp/src/util/json.h" 5 #include "third_party/libaddressinput/src/cpp/src/util/json.h"
6 6
7 #include <map> 7 #include <map>
8 #include <utility>
9 8
10 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
11 #include "base/logging.h" 10 #include "base/logging.h"
12 #include "base/macros.h" 11 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
14 #include "base/stl_util.h" 13 #include "base/stl_util.h"
15 #include "base/values.h" 14 #include "base/values.h"
16 15
17 namespace i18n { 16 namespace i18n {
18 namespace addressinput { 17 namespace addressinput {
(...skipping 10 matching lines...) Expand all
29 // |json| is converted to a |c_str()| here because rapidjson and other parts 28 // |json| is converted to a |c_str()| here because rapidjson and other parts
30 // of the standalone library use char* rather than std::string. 29 // of the standalone library use char* rather than std::string.
31 ::scoped_ptr<const base::Value> parsed(base::JSONReader::Read(json.c_str())); 30 ::scoped_ptr<const base::Value> parsed(base::JSONReader::Read(json.c_str()));
32 *parser_error = !parsed || !parsed->IsType(base::Value::TYPE_DICTIONARY); 31 *parser_error = !parsed || !parsed->IsType(base::Value::TYPE_DICTIONARY);
33 32
34 if (*parser_error) 33 if (*parser_error)
35 result.reset(new base::DictionaryValue); 34 result.reset(new base::DictionaryValue);
36 else 35 else
37 result.reset(static_cast<const base::DictionaryValue*>(parsed.release())); 36 result.reset(static_cast<const base::DictionaryValue*>(parsed.release()));
38 37
39 return std::move(result); 38 return result;
40 } 39 }
41 40
42 } // namespace 41 } // namespace
43 42
44 // Implementation of JSON parser for libaddressinput using JSON parser in 43 // Implementation of JSON parser for libaddressinput using JSON parser in
45 // Chrome. 44 // Chrome.
46 class Json::JsonImpl { 45 class Json::JsonImpl {
47 public: 46 public:
48 explicit JsonImpl(const std::string& json) 47 explicit JsonImpl(const std::string& json)
49 : owned_(Parse(json, &parser_error_)), 48 : owned_(Parse(json, &parser_error_)),
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 100
102 bool Json::GetStringValueForKey(const std::string& key, 101 bool Json::GetStringValueForKey(const std::string& key,
103 std::string* value) const { 102 std::string* value) const {
104 return impl_->GetStringValueForKey(key, value); 103 return impl_->GetStringValueForKey(key, value);
105 } 104 }
106 105
107 Json::Json(JsonImpl* impl) : impl_(impl) {} 106 Json::Json(JsonImpl* impl) : impl_(impl) {}
108 107
109 } // namespace addressinput 108 } // namespace addressinput
110 } // namespace i18n 109 } // namespace i18n
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698