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

Side by Side Diff: tools/gn/command_desc.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 years, 8 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 | « services/catalog/entry.cc ('k') | tools/gn/commands.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 21 matching lines...) Expand all
32 32
33 // Prints value with specified indentation level 33 // Prints value with specified indentation level
34 void PrintValue(const base::Value* value, int indentLevel) { 34 void PrintValue(const base::Value* value, int indentLevel) {
35 std::string indent(indentLevel * 2, ' '); 35 std::string indent(indentLevel * 2, ' ');
36 const base::ListValue* list_value = nullptr; 36 const base::ListValue* list_value = nullptr;
37 const base::DictionaryValue* dict_value = nullptr; 37 const base::DictionaryValue* dict_value = nullptr;
38 std::string string_value; 38 std::string string_value;
39 bool bool_value = false; 39 bool bool_value = false;
40 if (value->GetAsList(&list_value)) { 40 if (value->GetAsList(&list_value)) {
41 for (const auto& v : *list_value) { 41 for (const auto& v : *list_value) {
42 PrintValue(&v, indentLevel); 42 PrintValue(v.get(), indentLevel);
43 } 43 }
44 } else if (value->GetAsString(&string_value)) { 44 } else if (value->GetAsString(&string_value)) {
45 OutputString(indent); 45 OutputString(indent);
46 OutputString(string_value); 46 OutputString(string_value);
47 OutputString("\n"); 47 OutputString("\n");
48 } else if (value->GetAsBoolean(&bool_value)) { 48 } else if (value->GetAsBoolean(&bool_value)) {
49 OutputString(indent); 49 OutputString(indent);
50 OutputString(bool_value ? "true" : "false"); 50 OutputString(bool_value ? "true" : "false");
51 OutputString("\n"); 51 OutputString("\n");
52 } else if (value->GetAsDictionary(&dict_value)) { 52 } else if (value->GetAsDictionary(&dict_value)) {
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 500
501 if (!PrintConfig(config, what_to_print, !multiple_outputs)) 501 if (!PrintConfig(config, what_to_print, !multiple_outputs))
502 return 1; 502 return 1;
503 } 503 }
504 } 504 }
505 505
506 return 0; 506 return 0;
507 } 507 }
508 508
509 } // namespace commands 509 } // namespace commands
OLDNEW
« no previous file with comments | « services/catalog/entry.cc ('k') | tools/gn/commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698