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

Unified Diff: tools/gn/scheduler.cc

Issue 1804303004: 🚙 GN: Add write_runtime_deps variable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: function -> variable Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
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_);
« no previous file with comments | « tools/gn/scheduler.h ('k') | tools/gn/target.h » ('j') | tools/gn/variables.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698