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

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

Issue 819223002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years, 12 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/android/forwarder2/host_forwarder_main.cc ('k') | tools/gn/command_desc.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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/strings/stringprintf.h" 6 #include "base/strings/stringprintf.h"
7 #include "tools/gn/commands.h" 7 #include "tools/gn/commands.h"
8 #include "tools/gn/header_checker.h" 8 #include "tools/gn/header_checker.h"
9 #include "tools/gn/setup.h" 9 #include "tools/gn/setup.h"
10 #include "tools/gn/standard_out.h" 10 #include "tools/gn/standard_out.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if (setup->check_patterns()) { 85 if (setup->check_patterns()) {
86 FilterTargetsByPatterns(all_targets, *setup->check_patterns(), 86 FilterTargetsByPatterns(all_targets, *setup->check_patterns(),
87 &targets_to_check); 87 &targets_to_check);
88 filtered_by_build_config = targets_to_check.size() != all_targets.size(); 88 filtered_by_build_config = targets_to_check.size() != all_targets.size();
89 } else { 89 } else {
90 // No global filter, check everything. 90 // No global filter, check everything.
91 targets_to_check = all_targets; 91 targets_to_check = all_targets;
92 } 92 }
93 } 93 }
94 94
95 const CommandLine* cmdline = CommandLine::ForCurrentProcess(); 95 const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
96 bool force = cmdline->HasSwitch("force"); 96 bool force = cmdline->HasSwitch("force");
97 97
98 if (!CheckPublicHeaders(&setup->build_settings(), all_targets, 98 if (!CheckPublicHeaders(&setup->build_settings(), all_targets,
99 targets_to_check, force)) 99 targets_to_check, force))
100 return 1; 100 return 1;
101 101
102 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kQuiet)) { 102 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kQuiet)) {
103 if (filtered_by_build_config) { 103 if (filtered_by_build_config) {
104 // Tell the user about the implicit filtering since this is obscure. 104 // Tell the user about the implicit filtering since this is obscure.
105 OutputString(base::StringPrintf( 105 OutputString(base::StringPrintf(
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 for (const auto& pattern : filter) { 139 for (const auto& pattern : filter) {
140 if (pattern.Matches(target->label())) { 140 if (pattern.Matches(target->label())) {
141 output->push_back(target); 141 output->push_back(target);
142 break; 142 break;
143 } 143 }
144 } 144 }
145 } 145 }
146 } 146 }
147 147
148 } // namespace commands 148 } // namespace commands
OLDNEW
« no previous file with comments | « tools/android/forwarder2/host_forwarder_main.cc ('k') | tools/gn/command_desc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698