Index: tools/gn/input_file_manager.cc |
diff --git a/tools/gn/input_file_manager.cc b/tools/gn/input_file_manager.cc |
index 0c4bf280c408a2722e6145d821d2e57da42de6d8..ddd79596341cafee67e9bae961427c26d88f5377 100644 |
--- a/tools/gn/input_file_manager.cc |
+++ b/tools/gn/input_file_manager.cc |
@@ -38,6 +38,7 @@ InputFileManager::~InputFileManager() { |
// Should be single-threaded by now. |
STLDeleteContainerPairSecondPointers(input_files_.begin(), |
input_files_.end()); |
+ STLDeleteContainerPointers(dynamic_inputs_.begin(), dynamic_inputs_.end()); |
} |
bool InputFileManager::AsyncLoadFile(const LocationRange& origin, |
@@ -166,6 +167,19 @@ const ParseNode* InputFileManager::SyncLoadFile( |
return data->parsed_root.get(); |
} |
+void InputFileManager::AddDynamicInput(InputFile** file, |
+ std::vector<Token>** tokens, |
+ scoped_ptr<ParseNode>** parse_root) { |
+ InputFileData* data = new InputFileData(SourceFile()); |
+ { |
+ base::AutoLock lock(lock_); |
+ dynamic_inputs_.push_back(data); |
+ } |
+ *file = &data->file; |
+ *tokens = &data->tokens; |
+ *parse_root = &data->parsed_root; |
+} |
+ |
int InputFileManager::GetInputFileCount() const { |
base::AutoLock lock(lock_); |
return static_cast<int>(input_files_.size()); |