feat: Electron Fuses, package time feature toggles (#24241)

* feat: add new 'fuses' feature for package-time build-flag style feature control

* feat: put ENABLE_RUN_AS_NODE behind a fuse as well

* chore: address PR feedback

* build: move FUSE_EXPORT to headers

* build: use hex codes for kFuseWire char[]

* docs: add fuse wire documentation

* chore: update fuses.json info

* Apply suggestions from code review

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

* chore: add link to fuse schema

* Update shell/app/electron_library_main.mm

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
This commit is contained in:
Samuel Attard 2020-10-27 10:49:25 -07:00 committed by GitHub
parent 422190e1ff
commit dbf2931f0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 195 additions and 5 deletions

View file

@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "electron/buildflags/buildflags.h"
#include "electron/fuses.h"
#include "printing/buildflags/buildflags.h"
#include "shell/common/gin_helper/dictionary.h"
#include "shell/common/node_includes.h"
@ -30,7 +31,7 @@ bool IsPDFViewerEnabled() {
}
bool IsRunAsNodeEnabled() {
return BUILDFLAG(ENABLE_RUN_AS_NODE);
return electron::fuses::IsRunAsNodeEnabled() && BUILDFLAG(ENABLE_RUN_AS_NODE);
}
bool IsFakeLocationProviderEnabled() {