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 | |
121 void Scheduler::AddUnknownGeneratedInput(const Target* target, | 116 void Scheduler::AddUnknownGeneratedInput(const Target* target, |
122 const SourceFile& file) { | 117 const SourceFile& file) { |
123 base::AutoLock lock(lock_); | 118 base::AutoLock lock(lock_); |
124 unknown_generated_inputs_.insert(std::make_pair(file, target)); | 119 unknown_generated_inputs_.insert(std::make_pair(file, target)); |
125 } | 120 } |
126 | 121 |
127 std::multimap<SourceFile, const Target*> | 122 std::multimap<SourceFile, const Target*> |
128 Scheduler::GetUnknownGeneratedInputs() const { | 123 Scheduler::GetUnknownGeneratedInputs() const { |
129 base::AutoLock lock(lock_); | 124 base::AutoLock lock(lock_); |
130 | 125 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 void Scheduler::DoWork(const base::Closure& closure) { | 171 void Scheduler::DoWork(const base::Closure& closure) { |
177 closure.Run(); | 172 closure.Run(); |
178 DecrementWorkCount(); | 173 DecrementWorkCount(); |
179 } | 174 } |
180 | 175 |
181 void Scheduler::OnComplete() { | 176 void Scheduler::OnComplete() { |
182 // Should be called on the main thread. | 177 // Should be called on the main thread. |
183 DCHECK(base::MessageLoop::current() == main_loop()); | 178 DCHECK(base::MessageLoop::current() == main_loop()); |
184 runner_.Quit(); | 179 runner_.Quit(); |
185 } | 180 } |
OLD | NEW |