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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // Loads and parses the given file synchronously, returning the root block | 59 // Loads and parses the given file synchronously, returning the root block |
60 // corresponding to the parsed result. On error, return NULL and the given | 60 // corresponding to the parsed result. On error, return NULL and the given |
61 // Err is set. | 61 // Err is set. |
62 const ParseNode* SyncLoadFile(const LocationRange& origin, | 62 const ParseNode* SyncLoadFile(const LocationRange& origin, |
63 const BuildSettings* build_settings, | 63 const BuildSettings* build_settings, |
64 const SourceFile& file_name, | 64 const SourceFile& file_name, |
65 Err* err); | 65 Err* err); |
66 | 66 |
67 int GetInputFileCount() const; | 67 int GetInputFileCount() const; |
68 | 68 |
69 void GetAllInputFileNames(std::vector<SourceFile>* result) const; | 69 // Fills the vector with all input files. |
| 70 void GetAllPhysicalInputFileNames(std::vector<base::FilePath>* result) const; |
70 | 71 |
71 private: | 72 private: |
72 friend class base::RefCountedThreadSafe<InputFileManager>; | 73 friend class base::RefCountedThreadSafe<InputFileManager>; |
73 | 74 |
74 struct InputFileData { | 75 struct InputFileData { |
75 InputFileData(const SourceFile& file_name); | 76 InputFileData(const SourceFile& file_name); |
76 ~InputFileData(); | 77 ~InputFileData(); |
77 | 78 |
78 // Don't touch this outside the lock until it's marked loaded. | 79 // Don't touch this outside the lock until it's marked loaded. |
79 InputFile file; | 80 InputFile file; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 mutable base::Lock lock_; | 115 mutable base::Lock lock_; |
115 | 116 |
116 // Maps repo-relative filenames to the corresponding owned pointer. | 117 // Maps repo-relative filenames to the corresponding owned pointer. |
117 typedef base::hash_map<SourceFile, InputFileData*> InputFileMap; | 118 typedef base::hash_map<SourceFile, InputFileData*> InputFileMap; |
118 InputFileMap input_files_; | 119 InputFileMap input_files_; |
119 | 120 |
120 DISALLOW_COPY_AND_ASSIGN(InputFileManager); | 121 DISALLOW_COPY_AND_ASSIGN(InputFileManager); |
121 }; | 122 }; |
122 | 123 |
123 #endif // TOOLS_GN_INPUT_FILE_MANAGER_H_ | 124 #endif // TOOLS_GN_INPUT_FILE_MANAGER_H_ |
OLD | NEW |