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