OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/scheduler.h" | 5 #include "tools/gn/scheduler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "tools/gn/standard_out.h" | 10 #include "tools/gn/standard_out.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 std::vector<base::FilePath> Scheduler::GetGenDependencies() const { | 106 std::vector<base::FilePath> Scheduler::GetGenDependencies() const { |
107 base::AutoLock lock(lock_); | 107 base::AutoLock lock(lock_); |
108 return gen_dependencies_; | 108 return gen_dependencies_; |
109 } | 109 } |
110 | 110 |
111 void Scheduler::AddWrittenFile(const SourceFile& file) { | 111 void Scheduler::AddWrittenFile(const SourceFile& file) { |
112 base::AutoLock lock(lock_); | 112 base::AutoLock lock(lock_); |
113 written_files_.push_back(file); | 113 written_files_.push_back(file); |
114 } | 114 } |
115 | 115 |
| 116 std::vector<SourceFile> Scheduler::GetWrittenFiles() const { |
| 117 base::AutoLock lock(lock_); |
| 118 return written_files_; |
| 119 } |
| 120 |
116 void Scheduler::AddUnknownGeneratedInput(const Target* target, | 121 void Scheduler::AddUnknownGeneratedInput(const Target* target, |
117 const SourceFile& file) { | 122 const SourceFile& file) { |
118 base::AutoLock lock(lock_); | 123 base::AutoLock lock(lock_); |
119 unknown_generated_inputs_.insert(std::make_pair(file, target)); | 124 unknown_generated_inputs_.insert(std::make_pair(file, target)); |
120 } | 125 } |
121 | 126 |
122 std::multimap<SourceFile, const Target*> | 127 std::multimap<SourceFile, const Target*> |
123 Scheduler::GetUnknownGeneratedInputs() const { | 128 Scheduler::GetUnknownGeneratedInputs() const { |
124 base::AutoLock lock(lock_); | 129 base::AutoLock lock(lock_); |
125 | 130 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 void Scheduler::DoWork(const base::Closure& closure) { | 176 void Scheduler::DoWork(const base::Closure& closure) { |
172 closure.Run(); | 177 closure.Run(); |
173 DecrementWorkCount(); | 178 DecrementWorkCount(); |
174 } | 179 } |
175 | 180 |
176 void Scheduler::OnComplete() { | 181 void Scheduler::OnComplete() { |
177 // Should be called on the main thread. | 182 // Should be called on the main thread. |
178 DCHECK(base::MessageLoop::current() == main_loop()); | 183 DCHECK(base::MessageLoop::current() == main_loop()); |
179 runner_.Quit(); | 184 runner_.Quit(); |
180 } | 185 } |
OLD | NEW |