| OLD | NEW |
| 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 "tools/json_schema_compiler/test/test_util.h" | 5 #include "tools/json_schema_compiler/test/test_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 return list; | 34 return list; |
| 35 } | 35 } |
| 36 std::unique_ptr<base::ListValue> List(base::Value* a, | 36 std::unique_ptr<base::ListValue> List(base::Value* a, |
| 37 base::Value* b, | 37 base::Value* b, |
| 38 base::Value* c) { | 38 base::Value* c) { |
| 39 std::unique_ptr<base::ListValue> list = List(a, b); | 39 std::unique_ptr<base::ListValue> list = List(a, b); |
| 40 list->Append(base::WrapUnique(c)); | 40 list->Append(base::WrapUnique(c)); |
| 41 return list; | 41 return list; |
| 42 } | 42 } |
| 43 | 43 |
| 44 std::unique_ptr<base::DictionaryValue> Dictionary(const std::string& ak, | 44 std::unique_ptr<base::DictionaryValue> Dictionary( |
| 45 base::Value* av) { | 45 const std::string& ak, |
| 46 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 46 std::unique_ptr<base::Value> av) { |
| 47 dict->SetWithoutPathExpansion(ak, av); | 47 auto dict = base::MakeUnique<base::DictionaryValue>(); |
| 48 dict->SetWithoutPathExpansion(ak, std::move(av)); |
| 48 return dict; | 49 return dict; |
| 49 } | 50 } |
| 50 std::unique_ptr<base::DictionaryValue> Dictionary(const std::string& ak, | 51 std::unique_ptr<base::DictionaryValue> Dictionary( |
| 51 base::Value* av, | 52 const std::string& ak, |
| 52 const std::string& bk, | 53 std::unique_ptr<base::Value> av, |
| 53 base::Value* bv) { | 54 const std::string& bk, |
| 54 std::unique_ptr<base::DictionaryValue> dict = Dictionary(ak, av); | 55 std::unique_ptr<base::Value> bv) { |
| 55 dict->SetWithoutPathExpansion(bk, bv); | 56 std::unique_ptr<base::DictionaryValue> dict = Dictionary(ak, std::move(av)); |
| 57 dict->SetWithoutPathExpansion(bk, std::move(bv)); |
| 56 return dict; | 58 return dict; |
| 57 } | 59 } |
| 58 std::unique_ptr<base::DictionaryValue> Dictionary(const std::string& ak, | 60 std::unique_ptr<base::DictionaryValue> Dictionary( |
| 59 base::Value* av, | 61 const std::string& ak, |
| 60 const std::string& bk, | 62 std::unique_ptr<base::Value> av, |
| 61 base::Value* bv, | 63 const std::string& bk, |
| 62 const std::string& ck, | 64 std::unique_ptr<base::Value> bv, |
| 63 base::Value* cv) { | 65 const std::string& ck, |
| 64 std::unique_ptr<base::DictionaryValue> dict = Dictionary(ak, av, bk, bv); | 66 std::unique_ptr<base::Value> cv) { |
| 65 dict->SetWithoutPathExpansion(ck, cv); | 67 std::unique_ptr<base::DictionaryValue> dict = |
| 68 Dictionary(ak, std::move(av), bk, std::move(bv)); |
| 69 dict->SetWithoutPathExpansion(ck, std::move(cv)); |
| 66 return dict; | 70 return dict; |
| 67 } | 71 } |
| 68 | 72 |
| 69 } // namespace test_util | 73 } // namespace test_util |
| 70 } // namespace json_schema_compiler | 74 } // namespace json_schema_compiler |
| OLD | NEW |