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

Side by Side Diff: tools/clang/value_cleanup/tests/list-value-append-original.cc

Issue 2666093002: Remove base::FundamentalValue (Closed)
Patch Set: Rebase Created 3 years, 9 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 | « tools/clang/value_cleanup/ListValueRewriter.cpp ('k') | tools/ipc_fuzzer/fuzzer/fuzzer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <memory> 5 #include <memory>
6 6
7 #include "values.h" 7 #include "values.h"
8 8
9 #define true true 9 #define true true
10 10
11 base::ListValue* ReturnsRawPtr() { 11 base::ListValue* ReturnsRawPtr() {
12 return nullptr; 12 return nullptr;
13 } 13 }
14 14
15 std::unique_ptr<base::Value> ReturnsUniquePtr() { 15 std::unique_ptr<base::Value> ReturnsUniquePtr() {
16 return nullptr; 16 return nullptr;
17 } 17 }
18 18
19 // The joy of raw pointers. 19 // The joy of raw pointers.
20 void DoesItTakeOwnership(base::Value*) {} 20 void DoesItTakeOwnership(base::Value*) {}
21 21
22 struct Thing { 22 struct Thing {
23 std::unique_ptr<base::Value> ToValue() { return nullptr; } 23 std::unique_ptr<base::Value> ToValue() { return nullptr; }
24 }; 24 };
25 25
26 void F() { 26 void F() {
27 base::ListValue list; 27 base::ListValue list;
28 list.Append(new base::FundamentalValue(1 == 0)); 28 list.Append(new base::Value(1 == 0));
29 list.Append(new base::FundamentalValue(true)); 29 list.Append(new base::Value(true));
30 list.Append(new base::FundamentalValue(static_cast<unsigned char>(1.0))); 30 list.Append(new base::Value(static_cast<unsigned char>(1.0)));
31 list.Append(new base::FundamentalValue(double{3})); 31 list.Append(new base::Value(double{3}));
32 list.Append(new base::StringValue("abc")); 32 list.Append(new base::StringValue("abc"));
33 33
34 list.Append(ReturnsUniquePtr().release()); 34 list.Append(ReturnsUniquePtr().release());
35 Thing thing; 35 Thing thing;
36 list.Append(thing.ToValue().release()); 36 list.Append(thing.ToValue().release());
37 std::unique_ptr<base::Value> unique_ptr_var; 37 std::unique_ptr<base::Value> unique_ptr_var;
38 list.Append(unique_ptr_var.release()); 38 list.Append(unique_ptr_var.release());
39 } 39 }
40 40
41 void G(base::Value* input) { 41 void G(base::Value* input) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 // Make sure C++98 style initialization is correctly handled. 101 // Make sure C++98 style initialization is correctly handled.
102 base::ListValue* cxx98_list(new base::ListValue); 102 base::ListValue* cxx98_list(new base::ListValue);
103 list.Append(cxx98_list); 103 list.Append(cxx98_list);
104 104
105 // C++11 style syntax currently causes the tool to bail out: this is banned in 105 // C++11 style syntax currently causes the tool to bail out: this is banned in
106 // Chromium style anyway. 106 // Chromium style anyway.
107 base::ListValue* cxx11_list{new base::ListValue}; 107 base::ListValue* cxx11_list{new base::ListValue};
108 list.Append(cxx11_list); 108 list.Append(cxx11_list);
109 } 109 }
OLDNEW
« no previous file with comments | « tools/clang/value_cleanup/ListValueRewriter.cpp ('k') | tools/ipc_fuzzer/fuzzer/fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698