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

Unified Diff: tools/gn/input_file_manager.cc

Issue 223783005: Add support for reading .gypi files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « tools/gn/input_file_manager.h ('k') | tools/gn/parse_tree_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « tools/gn/input_file_manager.h ('k') | tools/gn/parse_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698