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

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

Issue 21114002: Add initial prototype for the GN meta-buildsystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add owners and readme Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « tools/gn/gn_main.cc ('k') | 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef TOOLS_GN_IMPORT_MANAGER_H_
6 #define TOOLS_GN_IMPORT_MANAGER_H_
7
8 #include <map>
9
10 #include "base/synchronization/lock.h"
11
12 class Err;
13 class ParseNode;
14 class Scope;
15 class SourceFile;
16
17 // Provides a cache of the results of importing scopes so the results can
18 // be re-used rather than running the imported files multiple times.
19 class ImportManager {
20 public:
21 ImportManager();
22 ~ImportManager();
23
24 // Does an import of the given file into the given scope. On error, sets the
25 // error and returns false.
26 bool DoImport(const SourceFile& file,
27 const ParseNode* node_for_err,
28 Scope* scope,
29 Err* err);
30
31 private:
32 base::Lock lock_;
33
34 // Owning pointers to the scopes.
35 typedef std::map<SourceFile, const Scope*> ImportMap;
36 ImportMap imports_;
37
38 DISALLOW_COPY_AND_ASSIGN(ImportManager);
39 };
40
41 #endif // TOOLS_GN_IMPORT_MANAGER_H_
OLDNEW
« no previous file with comments | « tools/gn/gn_main.cc ('k') | tools/gn/import_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698