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" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "tools/gn/builder_record.h" | 12 #include "tools/gn/builder_record.h" |
13 #include "tools/gn/label.h" | 13 #include "tools/gn/label.h" |
14 #include "tools/gn/label_ptr.h" | 14 #include "tools/gn/label_ptr.h" |
15 | 15 |
16 class Config; | 16 class Config; |
17 class Err; | 17 class Err; |
18 class Loader; | 18 class Loader; |
19 class ParseNode; | 19 class ParseNode; |
20 | 20 |
21 class Builder : public base::RefCountedThreadSafe<Builder> { | 21 class Builder : public base::RefCountedThreadSafe<Builder> { |
22 public: | 22 public: |
23 typedef base::Callback<void(const Item*)> ResolvedCallback; | 23 typedef base::Callback<void(const BuilderRecord*)> ResolvedCallback; |
24 | 24 |
25 Builder(Loader* loader); | 25 Builder(Loader* loader); |
26 | 26 |
27 // The resolved callback is called whenever a target has been resolved. This | 27 // The resolved callback is called whenever a target has been resolved. This |
28 // will be executed only on the main thread. | 28 // will be executed only on the main thread. |
29 void set_resolved_callback(const ResolvedCallback& cb) { | 29 void set_resolved_callback(const ResolvedCallback& cb) { |
30 resolved_callback_ = cb; | 30 resolved_callback_ = cb; |
31 } | 31 } |
32 | 32 |
33 Loader* loader() const { return loader_; } | 33 Loader* loader() const { return loader_; } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // Owning pointers. | 126 // Owning pointers. |
127 typedef base::hash_map<Label, BuilderRecord*> RecordMap; | 127 typedef base::hash_map<Label, BuilderRecord*> RecordMap; |
128 RecordMap records_; | 128 RecordMap records_; |
129 | 129 |
130 ResolvedCallback resolved_callback_; | 130 ResolvedCallback resolved_callback_; |
131 | 131 |
132 DISALLOW_COPY_AND_ASSIGN(Builder); | 132 DISALLOW_COPY_AND_ASSIGN(Builder); |
133 }; | 133 }; |
134 | 134 |
135 #endif // TOOLS_GN_BUILDER_H_ | 135 #endif // TOOLS_GN_BUILDER_H_ |
OLD | NEW |