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 #include <set> |
| 10 #include <utility> |
10 | 11 |
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/macros.h" | 14 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
15 #include "tools/gn/args.h" | 16 #include "tools/gn/args.h" |
16 #include "tools/gn/scope.h" | 17 #include "tools/gn/scope.h" |
17 #include "tools/gn/source_dir.h" | 18 #include "tools/gn/source_dir.h" |
18 #include "tools/gn/source_file.h" | 19 #include "tools/gn/source_file.h" |
19 | 20 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
88 // A list of files that can call exec_script(). If the returned pointer is | 89 // A list of files that can call exec_script(). If the returned pointer is |
89 // null, exec_script may be called from anywhere. | 90 // null, exec_script may be called from anywhere. |
90 const std::set<SourceFile>* exec_script_whitelist() const { | 91 const std::set<SourceFile>* exec_script_whitelist() const { |
91 return exec_script_whitelist_.get(); | 92 return exec_script_whitelist_.get(); |
92 } | 93 } |
93 void set_exec_script_whitelist(scoped_ptr<std::set<SourceFile>> list) { | 94 void set_exec_script_whitelist(scoped_ptr<std::set<SourceFile>> list) { |
94 exec_script_whitelist_ = list.Pass(); | 95 exec_script_whitelist_ = std::move(list); |
95 } | 96 } |
96 | 97 |
97 // When set (the default), code should perform normal validation of inputs | 98 // When set (the default), code should perform normal validation of inputs |
98 // and structures, like undefined or possibly incorrectly used things. For | 99 // and structures, like undefined or possibly incorrectly used things. For |
99 // some interrogation commands, we don't care about this and actually want | 100 // some interrogation commands, we don't care about this and actually want |
100 // to allow the user to check the structure of the build to solve their | 101 // to allow the user to check the structure of the build to solve their |
101 // problem, and these checks are undesirable. | 102 // problem, and these checks are undesirable. |
102 bool check_for_bad_items() const { | 103 bool check_for_bad_items() const { |
103 return check_for_bad_items_; | 104 return check_for_bad_items_; |
104 } | 105 } |
(...skipping 15 matching lines...) Expand all Loading... |
120 PrintCallback print_callback_; | 121 PrintCallback print_callback_; |
121 | 122 |
122 scoped_ptr<std::set<SourceFile>> exec_script_whitelist_; | 123 scoped_ptr<std::set<SourceFile>> exec_script_whitelist_; |
123 | 124 |
124 bool check_for_bad_items_; | 125 bool check_for_bad_items_; |
125 | 126 |
126 BuildSettings& operator=(const BuildSettings& other); // Disallow. | 127 BuildSettings& operator=(const BuildSettings& other); // Disallow. |
127 }; | 128 }; |
128 | 129 |
129 #endif // TOOLS_GN_BUILD_SETTINGS_H_ | 130 #endif // TOOLS_GN_BUILD_SETTINGS_H_ |
OLD | NEW |