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_BUILDER_H_ | 5 #ifndef TOOLS_GN_BUILDER_H_ |
6 #define TOOLS_GN_BUILDER_H_ | 6 #define TOOLS_GN_BUILDER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 // If there are any undefined references, returns false and sets the error. | 51 // If there are any undefined references, returns false and sets the error. |
52 bool CheckForBadItems(Err* err) const; | 52 bool CheckForBadItems(Err* err) const; |
53 | 53 |
54 private: | 54 private: |
55 friend class base::RefCountedThreadSafe<Builder>; | 55 friend class base::RefCountedThreadSafe<Builder>; |
56 | 56 |
57 virtual ~Builder(); | 57 virtual ~Builder(); |
58 | 58 |
59 bool TargetDefined(BuilderRecord* record, Err* err); | 59 bool TargetDefined(BuilderRecord* record, Err* err); |
| 60 bool ToolchainDefined(BuilderRecord* record, Err* err); |
60 | 61 |
61 // Returns the record associated with the given label. This function checks | 62 // Returns the record associated with the given label. This function checks |
62 // that if we already have references for it, the type matches. If no record | 63 // that if we already have references for it, the type matches. If no record |
63 // exists yet, a new one will be created. | 64 // exists yet, a new one will be created. |
64 // | 65 // |
65 // If any of the conditions fail, the return value will be null and the error | 66 // If any of the conditions fail, the return value will be null and the error |
66 // will be set. request_from is used as the source of the error. | 67 // will be set. request_from is used as the source of the error. |
67 BuilderRecord* GetOrCreateRecordOfType(const Label& label, | 68 BuilderRecord* GetOrCreateRecordOfType(const Label& label, |
68 const ParseNode* request_from, | 69 const ParseNode* request_from, |
69 BuilderRecord::ItemType type, | 70 BuilderRecord::ItemType type, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // Owning pointers. | 127 // Owning pointers. |
127 typedef base::hash_map<Label, BuilderRecord*> RecordMap; | 128 typedef base::hash_map<Label, BuilderRecord*> RecordMap; |
128 RecordMap records_; | 129 RecordMap records_; |
129 | 130 |
130 ResolvedCallback resolved_callback_; | 131 ResolvedCallback resolved_callback_; |
131 | 132 |
132 DISALLOW_COPY_AND_ASSIGN(Builder); | 133 DISALLOW_COPY_AND_ASSIGN(Builder); |
133 }; | 134 }; |
134 | 135 |
135 #endif // TOOLS_GN_BUILDER_H_ | 136 #endif // TOOLS_GN_BUILDER_H_ |
OLD | NEW |