Chromium Code Reviews| Index: tools/gn/scheduler.cc |
| diff --git a/tools/gn/scheduler.cc b/tools/gn/scheduler.cc |
| index dfc877d190bc1522f6f035432c8f6469fd4e2af0..cef2b9bddc54b9b7ab0ab24bb6a051df74ca8305 100644 |
| --- a/tools/gn/scheduler.cc |
| +++ b/tools/gn/scheduler.cc |
| @@ -12,6 +12,7 @@ |
| #include "build/build_config.h" |
| #include "tools/gn/standard_out.h" |
| #include "tools/gn/switches.h" |
| +#include "tools/gn/target.h" |
| #if defined(OS_WIN) |
| #include <windows.h> |
| @@ -153,6 +154,28 @@ void Scheduler::AddUnknownGeneratedInput(const Target* target, |
| unknown_generated_inputs_.insert(std::make_pair(file, target)); |
| } |
| +void Scheduler::AddWriteRuntimeDepsTarget(const Target* target) { |
| + base::AutoLock lock(lock_); |
| + write_runtime_deps_targets_.push_back(target); |
| +} |
| + |
| +std::vector<const Target*> Scheduler::GetWriteRuntimeDepsTargets() |
| + const { |
|
brettw
2016/03/28 23:06:35
const can be on previous line.
agrieve
2016/03/29 16:14:01
Done.
|
| + base::AutoLock lock(lock_); |
| + return write_runtime_deps_targets_; |
| +} |
| + |
| +bool Scheduler::IsFileGeneratedByWriteRuntimeDeps( |
| + const OutputFile& file) const { |
| + // Number of targets should be quite small, so brute-force search is fine. |
| + for (const Target* target : write_runtime_deps_targets_) { |
|
brettw
2016/03/28 23:06:35
This will crash because it accesses the list not p
agrieve
2016/03/29 16:14:01
Added the lock.
This function is called only when
|
| + if (file == target->write_runtime_deps_output()) { |
| + return true; |
| + } |
| + } |
| + return false; |
| +} |
| + |
| std::multimap<SourceFile, const Target*> |
| Scheduler::GetUnknownGeneratedInputs() const { |
| base::AutoLock lock(lock_); |