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

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

Issue 1869503004: Convert //tools to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, change iwyu fixes for converted directories to include <memory> Created 4 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 | « tools/gn/builder_unittest.cc ('k') | tools/gn/eclipse_writer.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <sstream> 7 #include <sstream>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 file.SetContents(input); 975 file.SetContents(input);
976 Err err; 976 Err err;
977 // Tokenize. 977 // Tokenize.
978 std::vector<Token> tokens = Tokenizer::Tokenize(&file, &err); 978 std::vector<Token> tokens = Tokenizer::Tokenize(&file, &err);
979 if (err.has_error()) { 979 if (err.has_error()) {
980 err.PrintToStdout(); 980 err.PrintToStdout();
981 return false; 981 return false;
982 } 982 }
983 983
984 // Parse. 984 // Parse.
985 scoped_ptr<ParseNode> parse_node = Parser::Parse(tokens, &err); 985 std::unique_ptr<ParseNode> parse_node = Parser::Parse(tokens, &err);
986 if (err.has_error()) { 986 if (err.has_error()) {
987 err.PrintToStdout(); 987 err.PrintToStdout();
988 return false; 988 return false;
989 } 989 }
990 990
991 DoFormat(parse_node.get(), dump_tree, output); 991 DoFormat(parse_node.get(), dump_tree, output);
992 return true; 992 return true;
993 } 993 }
994 994
995 int RunFormat(const std::vector<std::string>& args) { 995 int RunFormat(const std::vector<std::string>& args) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 } 1068 }
1069 } else { 1069 } else {
1070 printf("%s", output_string.c_str()); 1070 printf("%s", output_string.c_str());
1071 } 1071 }
1072 } 1072 }
1073 1073
1074 return 0; 1074 return 0;
1075 } 1075 }
1076 1076
1077 } // namespace commands 1077 } // namespace commands
OLDNEW
« no previous file with comments | « tools/gn/builder_unittest.cc ('k') | tools/gn/eclipse_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698