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

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

Issue 2252293003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 | « no previous file | tools/gn/desc_builder.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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 return 1; 452 return 1;
453 453
454 std::string what_to_print; 454 std::string what_to_print;
455 if (args.size() == 3) 455 if (args.size() == 3)
456 what_to_print = args[2]; 456 what_to_print = args[2];
457 457
458 bool json = cmdline->GetSwitchValueASCII("format") == "json"; 458 bool json = cmdline->GetSwitchValueASCII("format") == "json";
459 459
460 if (json) { 460 if (json) {
461 // Convert all targets/configs to JSON, serialize and print them 461 // Convert all targets/configs to JSON, serialize and print them
462 auto res = base::WrapUnique(new base::DictionaryValue()); 462 auto res = base::MakeUnique<base::DictionaryValue>();
463 if (!target_matches.empty()) { 463 if (!target_matches.empty()) {
464 for (const auto* target : target_matches) { 464 for (const auto* target : target_matches) {
465 res->Set(target->label().GetUserVisibleName( 465 res->Set(target->label().GetUserVisibleName(
466 target->settings()->default_toolchain_label()), 466 target->settings()->default_toolchain_label()),
467 DescBuilder::DescriptionForTarget( 467 DescBuilder::DescriptionForTarget(
468 target, what_to_print, cmdline->HasSwitch(kAll), 468 target, what_to_print, cmdline->HasSwitch(kAll),
469 cmdline->HasSwitch(kTree), cmdline->HasSwitch(kBlame))); 469 cmdline->HasSwitch(kTree), cmdline->HasSwitch(kBlame)));
470 } 470 }
471 } else if (!config_matches.empty()) { 471 } else if (!config_matches.empty()) {
472 for (const auto* config : config_matches) { 472 for (const auto* config : config_matches) {
(...skipping 27 matching lines...) Expand all
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 | « no previous file | tools/gn/desc_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698