Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: tools/gn/build_settings.h

Issue 988563002: Add an whitelist for calling GN's exec_script. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/gn/function_exec_script.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/build_settings.h
diff --git a/tools/gn/build_settings.h b/tools/gn/build_settings.h
index 33e454ba48e827a18098c6d6f8c3c23804456b7a..785d239cc32821e28cf0f82c19b0c6a935402ec4 100644
--- a/tools/gn/build_settings.h
+++ b/tools/gn/build_settings.h
@@ -6,6 +6,7 @@
#define TOOLS_GN_BUILD_SETTINGS_H_
#include <map>
+#include <set>
#include "base/basictypes.h"
#include "base/callback.h"
@@ -85,6 +86,15 @@ class BuildSettings {
const PrintCallback& print_callback() const { return print_callback_; }
void set_print_callback(const PrintCallback& cb) { print_callback_ = cb; }
+ // A list of files that can call exec_script(). If the returned pointer is
+ // null, exec_script may be called from anywhere.
+ const std::set<SourceFile>* exec_script_whitelist() const {
+ return exec_script_whitelist_.get();
+ }
+ void set_exec_script_whitelist(scoped_ptr<std::set<SourceFile>> list) {
+ exec_script_whitelist_ = list.Pass();
+ }
+
private:
base::FilePath root_path_;
std::string root_path_utf8_;
@@ -98,6 +108,8 @@ class BuildSettings {
ItemDefinedCallback item_defined_callback_;
PrintCallback print_callback_;
+ scoped_ptr<std::set<SourceFile>> exec_script_whitelist_;
+
BuildSettings& operator=(const BuildSettings& other); // Disallow.
};
« no previous file with comments | « no previous file | tools/gn/function_exec_script.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698