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

Side by Side Diff: services/catalog/public/tools/catalog.cc.tmpl

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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 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 // This is a generated file. Please see the "catalog_cpp_source" template in 5 // This is a generated file. Please see the "catalog_cpp_source" template in
6 // src/services/catalog/public/tools/catalog.gni for more details. 6 // src/services/catalog/public/tools/catalog.gni for more details.
7 7
8 #include "{{path}}.h" 8 #include "{{path}}.h"
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 17 matching lines...) Expand all
28 }) 28 })
29 {%- elif source|is_list -%} 29 {%- elif source|is_list -%}
30 GenerateValue([]() { 30 GenerateValue([]() {
31 auto list = base::MakeUnique<base::ListValue>(); 31 auto list = base::MakeUnique<base::ListValue>();
32 {%- for value in source %} 32 {%- for value in source %}
33 list->Append({{generate_value(value)|indent(2)}}); 33 list->Append({{generate_value(value)|indent(2)}});
34 {%- endfor %} 34 {%- endfor %}
35 return list; 35 return list;
36 }) 36 })
37 {%- elif source|is_number -%} 37 {%- elif source|is_number -%}
38 base::MakeUnique<base::FundamentalValue>({{source}}) 38 base::MakeUnique<base::Value>({{source}})
39 {%- elif source|is_bool -%} 39 {%- elif source|is_bool -%}
40 base::MakeUnique<base::FundamentalValue>({{source|lower}}) 40 base::MakeUnique<base::Value>({{source|lower}})
41 {%- elif source|is_string or source|is_unicode -%} 41 {%- elif source|is_string or source|is_unicode -%}
42 base::MakeUnique<base::StringValue>("{{source|make_ascii}}") 42 base::MakeUnique<base::StringValue>("{{source|make_ascii}}")
43 {%- else %} 43 {%- else %}
44 {{raise("Unknown value type: %s" % source, source)}} 44 {{raise("Unknown value type: %s" % source, source)}}
45 {%- endif %} 45 {%- endif %}
46 {%- endmacro -%} 46 {%- endmacro -%}
47 47
48 {% for namespace in namespaces %} 48 {% for namespace in namespaces %}
49 namespace {{namespace}} { 49 namespace {{namespace}} {
50 {%- endfor %} 50 {%- endfor %}
51 51
52 std::unique_ptr<base::Value> {{function_name}}() { 52 std::unique_ptr<base::Value> {{function_name}}() {
53 return {{generate_value(catalog)|indent(2)}}; 53 return {{generate_value(catalog)|indent(2)}};
54 } 54 }
55 55
56 {%- for namespace in namespaces|reverse %} 56 {%- for namespace in namespaces|reverse %}
57 } // namespace {{namespace}} 57 } // namespace {{namespace}}
58 {%- endfor %} 58 {%- endfor %}
OLDNEW
« no previous file with comments | « net/log/net_log_unittest.cc ('k') | services/preferences/public/cpp/tests/pref_client_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698