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

Side by Side Diff: tools/gn/import_manager.h

Issue 1957483004: GN: Don't import a file more than once. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/gn/import_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_IMPORT_MANAGER_H_ 5 #ifndef TOOLS_GN_IMPORT_MANAGER_H_
6 #define TOOLS_GN_IMPORT_MANAGER_H_ 6 #define TOOLS_GN_IMPORT_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 13 matching lines...) Expand all
24 ~ImportManager(); 24 ~ImportManager();
25 25
26 // Does an import of the given file into the given scope. On error, sets the 26 // Does an import of the given file into the given scope. On error, sets the
27 // error and returns false. 27 // error and returns false.
28 bool DoImport(const SourceFile& file, 28 bool DoImport(const SourceFile& file,
29 const ParseNode* node_for_err, 29 const ParseNode* node_for_err,
30 Scope* scope, 30 Scope* scope,
31 Err* err); 31 Err* err);
32 32
33 private: 33 private:
34 base::Lock lock_; 34 struct ImportInfo;
35
36 // Protects access to imports_. Do not hold when actually executing imports.
37 base::Lock imports_lock_;
35 38
36 // Owning pointers to the scopes. 39 // Owning pointers to the scopes.
37 typedef std::map<SourceFile, std::unique_ptr<const Scope>> ImportMap; 40 typedef std::map<SourceFile, std::unique_ptr<ImportInfo>> ImportMap;
38 ImportMap imports_; 41 ImportMap imports_;
39 42
40 DISALLOW_COPY_AND_ASSIGN(ImportManager); 43 DISALLOW_COPY_AND_ASSIGN(ImportManager);
41 }; 44 };
42 45
43 #endif // TOOLS_GN_IMPORT_MANAGER_H_ 46 #endif // TOOLS_GN_IMPORT_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | tools/gn/import_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698