OLD | NEW |
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 "tools/gn/header_checker.h" | 5 #include "tools/gn/header_checker.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 if (errors_.empty()) | 147 if (errors_.empty()) |
148 return true; | 148 return true; |
149 *errors = errors_; | 149 *errors = errors_; |
150 return false; | 150 return false; |
151 } | 151 } |
152 | 152 |
153 void HeaderChecker::RunCheckOverFiles(const FileMap& files, bool force_check) { | 153 void HeaderChecker::RunCheckOverFiles(const FileMap& files, bool force_check) { |
154 if (files.empty()) | 154 if (files.empty()) |
155 return; | 155 return; |
156 | 156 |
157 scoped_refptr<base::SequencedWorkerPool> pool( | 157 scoped_refptr<base::SequencedWorkerPool> pool(new base::SequencedWorkerPool( |
158 new base::SequencedWorkerPool(16, "HeaderChecker")); | 158 16, "HeaderChecker", base::TaskPriority::USER_VISIBLE)); |
159 for (const auto& file : files) { | 159 for (const auto& file : files) { |
160 // Only check C-like source files (RC files also have includes). | 160 // Only check C-like source files (RC files also have includes). |
161 SourceFileType type = GetSourceFileType(file.first); | 161 SourceFileType type = GetSourceFileType(file.first); |
162 if (type != SOURCE_CPP && type != SOURCE_H && type != SOURCE_C && | 162 if (type != SOURCE_CPP && type != SOURCE_H && type != SOURCE_C && |
163 type != SOURCE_M && type != SOURCE_MM && type != SOURCE_RC) | 163 type != SOURCE_M && type != SOURCE_MM && type != SOURCE_RC) |
164 continue; | 164 continue; |
165 | 165 |
166 // If any target marks it as generated, don't check it. We have to check | 166 // If any target marks it as generated, don't check it. We have to check |
167 // file_map_, which includes all known files; files only includes those | 167 // file_map_, which includes all known files; files only includes those |
168 // being checked. | 168 // being checked. |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 if (targets_with_other_toolchains.size() + | 574 if (targets_with_other_toolchains.size() + |
575 targets_with_matching_toolchains.size() > 1) | 575 targets_with_matching_toolchains.size() > 1) |
576 msg += "at least one of "; | 576 msg += "at least one of "; |
577 msg += "which should somehow be reachable."; | 577 msg += "which should somehow be reachable."; |
578 | 578 |
579 // Danger: must call CreatePersistentRange to put in Err. | 579 // Danger: must call CreatePersistentRange to put in Err. |
580 return Err(CreatePersistentRange(source_file, range), | 580 return Err(CreatePersistentRange(source_file, range), |
581 "Include not allowed.", msg); | 581 "Include not allowed.", msg); |
582 } | 582 } |
583 | 583 |
OLD | NEW |