| 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 #ifndef TOOLS_GN_INPUT_FILE_MANAGER_H_ | 5 #ifndef TOOLS_GN_INPUT_FILE_MANAGER_H_ |
| 6 #define TOOLS_GN_INPUT_FILE_MANAGER_H_ | 6 #define TOOLS_GN_INPUT_FILE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // code is responsible for populating these values and maintaining | 72 // code is responsible for populating these values and maintaining |
| 73 // threadsafety. This class' only job is to hold onto the memory and delete | 73 // threadsafety. This class' only job is to hold onto the memory and delete |
| 74 // it when the program exits. | 74 // it when the program exits. |
| 75 // | 75 // |
| 76 // This solves the problem that sometimes we need to execute something | 76 // This solves the problem that sometimes we need to execute something |
| 77 // dynamic and save the result, but the values all have references to the | 77 // dynamic and save the result, but the values all have references to the |
| 78 // nodes and file that created it. Either we need to reset the origin of | 78 // nodes and file that created it. Either we need to reset the origin of |
| 79 // the values and lose context for error reporting, or somehow keep the | 79 // the values and lose context for error reporting, or somehow keep the |
| 80 // associated parse nodes, tokens, and file data in memory. This function | 80 // associated parse nodes, tokens, and file data in memory. This function |
| 81 // allows the latter. | 81 // allows the latter. |
| 82 void AddDynamicInput(const SourceFile& name, | 82 void AddDynamicInput(InputFile** file, |
| 83 InputFile** file, | |
| 84 std::vector<Token>** tokens, | 83 std::vector<Token>** tokens, |
| 85 scoped_ptr<ParseNode>** parse_root); | 84 scoped_ptr<ParseNode>** parse_root); |
| 86 | 85 |
| 87 // Does not count dynamic input. | 86 // Does not count dynamic input. |
| 88 int GetInputFileCount() const; | 87 int GetInputFileCount() const; |
| 89 | 88 |
| 90 // Fills the vector with all input files. | 89 // Fills the vector with all input files. |
| 91 void GetAllPhysicalInputFileNames(std::vector<base::FilePath>* result) const; | 90 void GetAllPhysicalInputFileNames(std::vector<base::FilePath>* result) const; |
| 92 | 91 |
| 93 private: | 92 private: |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // | 145 // |
| 147 // See AddDynamicInput(). | 146 // See AddDynamicInput(). |
| 148 // | 147 // |
| 149 // Owning pointers. | 148 // Owning pointers. |
| 150 std::vector<InputFileData*> dynamic_inputs_; | 149 std::vector<InputFileData*> dynamic_inputs_; |
| 151 | 150 |
| 152 DISALLOW_COPY_AND_ASSIGN(InputFileManager); | 151 DISALLOW_COPY_AND_ASSIGN(InputFileManager); |
| 153 }; | 152 }; |
| 154 | 153 |
| 155 #endif // TOOLS_GN_INPUT_FILE_MANAGER_H_ | 154 #endif // TOOLS_GN_INPUT_FILE_MANAGER_H_ |
| OLD | NEW |