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_SETUP_H_ | 5 #ifndef TOOLS_GN_SETUP_H_ |
6 #define TOOLS_GN_SETUP_H_ | 6 #define TOOLS_GN_SETUP_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 virtual ~CommonSetup(); | 32 virtual ~CommonSetup(); |
33 | 33 |
34 // Returns the scheduler. This is virtual since only the main setup has a | 34 // Returns the scheduler. This is virtual since only the main setup has a |
35 // scheduler and the derived ones just store pointers. | 35 // scheduler and the derived ones just store pointers. |
36 virtual Scheduler* GetScheduler() = 0; | 36 virtual Scheduler* GetScheduler() = 0; |
37 | 37 |
38 // When true (the default), Run() will check for unresolved dependencies and | 38 // When true (the default), Run() will check for unresolved dependencies and |
39 // cycles upon completion. When false, such errors will be ignored. | 39 // cycles upon completion. When false, such errors will be ignored. |
40 void set_check_for_bad_items(bool s) { check_for_bad_items_ = s; } | 40 void set_check_for_bad_items(bool s) { check_for_bad_items_ = s; } |
41 | 41 |
| 42 // When true (the default), RunPostMessageLoop will check for overrides that |
| 43 // were specified but not used. When false, such errors will be ignored. |
| 44 void set_check_for_unused_overrides(bool s) { |
| 45 check_for_unused_overrides_ = s; |
| 46 } |
| 47 |
42 BuildSettings& build_settings() { return build_settings_; } | 48 BuildSettings& build_settings() { return build_settings_; } |
43 Builder* builder() { return builder_.get(); } | 49 Builder* builder() { return builder_.get(); } |
44 LoaderImpl* loader() { return loader_.get(); } | 50 LoaderImpl* loader() { return loader_.get(); } |
45 | 51 |
46 protected: | 52 protected: |
47 CommonSetup(); | 53 CommonSetup(); |
48 CommonSetup(const CommonSetup& other); | 54 CommonSetup(const CommonSetup& other); |
49 | 55 |
50 // Performs the two sets of operations to run the generation before and after | 56 // Performs the two sets of operations to run the generation before and after |
51 // the message loop is run. | 57 // the message loop is run. |
52 void RunPreMessageLoop(); | 58 void RunPreMessageLoop(); |
53 bool RunPostMessageLoop(); | 59 bool RunPostMessageLoop(); |
54 | 60 |
55 BuildSettings build_settings_; | 61 BuildSettings build_settings_; |
56 scoped_refptr<LoaderImpl> loader_; | 62 scoped_refptr<LoaderImpl> loader_; |
57 scoped_refptr<Builder> builder_; | 63 scoped_refptr<Builder> builder_; |
58 | 64 |
59 bool check_for_bad_items_; | 65 bool check_for_bad_items_; |
| 66 bool check_for_unused_overrides_; |
60 | 67 |
61 private: | 68 private: |
62 CommonSetup& operator=(const CommonSetup& other); // Disallow. | 69 CommonSetup& operator=(const CommonSetup& other); // Disallow. |
63 }; | 70 }; |
64 | 71 |
65 // Helper class to setup the build settings and environment for the various | 72 // Helper class to setup the build settings and environment for the various |
66 // commands to run. | 73 // commands to run. |
67 class Setup : public CommonSetup { | 74 class Setup : public CommonSetup { |
68 public: | 75 public: |
69 Setup(); | 76 Setup(); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 void RunPreMessageLoop(); | 152 void RunPreMessageLoop(); |
146 bool RunPostMessageLoop(); | 153 bool RunPostMessageLoop(); |
147 | 154 |
148 virtual Scheduler* GetScheduler() OVERRIDE; | 155 virtual Scheduler* GetScheduler() OVERRIDE; |
149 | 156 |
150 private: | 157 private: |
151 Scheduler* scheduler_; | 158 Scheduler* scheduler_; |
152 }; | 159 }; |
153 | 160 |
154 #endif // TOOLS_GN_SETUP_H_ | 161 #endif // TOOLS_GN_SETUP_H_ |
OLD | NEW |