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_BUILD_SETTINGS_H_ | 5 #ifndef TOOLS_GN_BUILD_SETTINGS_H_ |
6 #define TOOLS_GN_BUILD_SETTINGS_H_ | 6 #define TOOLS_GN_BUILD_SETTINGS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
| 9 #include <set> |
9 | 10 |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
11 #include "base/callback.h" | 12 #include "base/callback.h" |
12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
14 #include "tools/gn/args.h" | 15 #include "tools/gn/args.h" |
15 #include "tools/gn/scope.h" | 16 #include "tools/gn/scope.h" |
16 #include "tools/gn/source_dir.h" | 17 #include "tools/gn/source_dir.h" |
17 #include "tools/gn/source_file.h" | 18 #include "tools/gn/source_file.h" |
18 | 19 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 item_defined_callback_ = cb; | 79 item_defined_callback_ = cb; |
79 } | 80 } |
80 | 81 |
81 // Defines a callback that will be used to override the behavior of the | 82 // Defines a callback that will be used to override the behavior of the |
82 // print function. This is used in tests to collect print output. If the | 83 // print function. This is used in tests to collect print output. If the |
83 // callback is is_null() (the default) the output will be printed to the | 84 // callback is is_null() (the default) the output will be printed to the |
84 // console. | 85 // console. |
85 const PrintCallback& print_callback() const { return print_callback_; } | 86 const PrintCallback& print_callback() const { return print_callback_; } |
86 void set_print_callback(const PrintCallback& cb) { print_callback_ = cb; } | 87 void set_print_callback(const PrintCallback& cb) { print_callback_ = cb; } |
87 | 88 |
| 89 // A list of files that can call exec_script(). If the returned pointer is |
| 90 // null, exec_script may be called from anywhere. |
| 91 const std::set<SourceFile>* exec_script_whitelist() const { |
| 92 return exec_script_whitelist_.get(); |
| 93 } |
| 94 void set_exec_script_whitelist(scoped_ptr<std::set<SourceFile>> list) { |
| 95 exec_script_whitelist_ = list.Pass(); |
| 96 } |
| 97 |
88 private: | 98 private: |
89 base::FilePath root_path_; | 99 base::FilePath root_path_; |
90 std::string root_path_utf8_; | 100 std::string root_path_utf8_; |
91 base::FilePath secondary_source_path_; | 101 base::FilePath secondary_source_path_; |
92 base::FilePath python_path_; | 102 base::FilePath python_path_; |
93 | 103 |
94 SourceFile build_config_file_; | 104 SourceFile build_config_file_; |
95 SourceDir build_dir_; | 105 SourceDir build_dir_; |
96 Args build_args_; | 106 Args build_args_; |
97 | 107 |
98 ItemDefinedCallback item_defined_callback_; | 108 ItemDefinedCallback item_defined_callback_; |
99 PrintCallback print_callback_; | 109 PrintCallback print_callback_; |
100 | 110 |
| 111 scoped_ptr<std::set<SourceFile>> exec_script_whitelist_; |
| 112 |
101 BuildSettings& operator=(const BuildSettings& other); // Disallow. | 113 BuildSettings& operator=(const BuildSettings& other); // Disallow. |
102 }; | 114 }; |
103 | 115 |
104 #endif // TOOLS_GN_BUILD_SETTINGS_H_ | 116 #endif // TOOLS_GN_BUILD_SETTINGS_H_ |
OLD | NEW |