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/setup.h" | 5 #include "tools/gn/setup.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <sstream> | 9 #include <sstream> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
16 #include "base/process/launch.h" | 16 #include "base/process/launch.h" |
| 17 #include "base/single_thread_task_runner.h" |
17 #include "base/strings/string_split.h" | 18 #include "base/strings/string_split.h" |
18 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
19 #include "base/strings/sys_string_conversions.h" | 20 #include "base/strings/sys_string_conversions.h" |
20 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
21 #include "build/build_config.h" | 22 #include "build/build_config.h" |
22 #include "tools/gn/commands.h" | 23 #include "tools/gn/commands.h" |
23 #include "tools/gn/filesystem_utils.h" | 24 #include "tools/gn/filesystem_utils.h" |
24 #include "tools/gn/input_file.h" | 25 #include "tools/gn/input_file.h" |
25 #include "tools/gn/parse_tree.h" | 26 #include "tools/gn/parse_tree.h" |
26 #include "tools/gn/parser.h" | 27 #include "tools/gn/parser.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 return base::FilePath(); // Got to the top. | 136 return base::FilePath(); // Got to the top. |
136 | 137 |
137 return FindDotFile(up_one_dir); | 138 return FindDotFile(up_one_dir); |
138 } | 139 } |
139 | 140 |
140 // Called on any thread. Post the item to the builder on the main thread. | 141 // Called on any thread. Post the item to the builder on the main thread. |
141 void ItemDefinedCallback(base::MessageLoop* main_loop, | 142 void ItemDefinedCallback(base::MessageLoop* main_loop, |
142 scoped_refptr<Builder> builder, | 143 scoped_refptr<Builder> builder, |
143 std::unique_ptr<Item> item) { | 144 std::unique_ptr<Item> item) { |
144 DCHECK(item); | 145 DCHECK(item); |
145 main_loop->PostTask(FROM_HERE, base::Bind(&Builder::ItemDefined, builder, | 146 main_loop->task_runner()->PostTask( |
146 base::Passed(&item))); | 147 FROM_HERE, |
| 148 base::Bind(&Builder::ItemDefined, builder, base::Passed(&item))); |
147 } | 149 } |
148 | 150 |
149 void DecrementWorkCount() { | 151 void DecrementWorkCount() { |
150 g_scheduler->DecrementWorkCount(); | 152 g_scheduler->DecrementWorkCount(); |
151 } | 153 } |
152 | 154 |
153 #if defined(OS_WIN) | 155 #if defined(OS_WIN) |
154 | 156 |
155 // Given the path to a batch file that runs Python, extracts the name of the | 157 // Given the path to a batch file that runs Python, extracts the name of the |
156 // executable actually implementing Python. Generally people write a batch file | 158 // executable actually implementing Python. Generally people write a batch file |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 if (err.has_error()) { | 733 if (err.has_error()) { |
732 err.PrintToStdout(); | 734 err.PrintToStdout(); |
733 return false; | 735 return false; |
734 } | 736 } |
735 } | 737 } |
736 build_settings_.set_exec_script_whitelist(std::move(whitelist)); | 738 build_settings_.set_exec_script_whitelist(std::move(whitelist)); |
737 } | 739 } |
738 | 740 |
739 return true; | 741 return true; |
740 } | 742 } |
OLD | NEW |