1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "values.h"
6 
7 // All of these should be renamed to |GetList().emplace_back()|.
F()8 void F() {
9   base::ListValue value;
10   value.GetList().emplace_back(false);
11   value.GetList().emplace_back(0);
12   value.GetList().emplace_back(0.0);
13   value.GetList().emplace_back("");
14 }
15 
16 // All of these should be renamed to GetList() + their std::vector equivalent.
G()17 void G() {
18   base::ListValue value;
19   value.GetList().clear();
20   value.GetList().size();
21   value.GetList().empty();
22   value.GetList().reserve(0);
23 }
24 
25 // None of these should be renamed, as these methods require different handling.
H()26 void H() {
27   base::ListValue value;
28   value.Append(std::unique_ptr<base::Value>(new base::Value()));
29   value.AppendStrings({"foo", "bar"});
30   value.AppendIfNotPresent(std::unique_ptr<base::Value>(new base::Value()));
31 }
32