build: remove enable_run_as_node build flag (#38413)
* feat: remove enable_run_as_node flag * drop features.isRunAsNodeEnabled() * use IsEnvSet() helper in electron_main_linux.cc * cleanup [[maybe_unused]] --------- Co-authored-by: Milan Burda <miburda@microsoft.com>
This commit is contained in:
parent
806f00285c
commit
05d39d8313
18 changed files with 29 additions and 96 deletions
|
@ -3,7 +3,6 @@
|
|||
// 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"
|
||||
|
@ -22,10 +21,6 @@ bool IsPDFViewerEnabled() {
|
|||
return BUILDFLAG(ENABLE_PDF_VIEWER);
|
||||
}
|
||||
|
||||
bool IsRunAsNodeEnabled() {
|
||||
return electron::fuses::IsRunAsNodeEnabled() && BUILDFLAG(ENABLE_RUN_AS_NODE);
|
||||
}
|
||||
|
||||
bool IsFakeLocationProviderEnabled() {
|
||||
return BUILDFLAG(OVERRIDE_LOCATION_PROVIDER);
|
||||
}
|
||||
|
@ -58,7 +53,6 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
dict.SetMethod("isBuiltinSpellCheckerEnabled", &IsBuiltinSpellCheckerEnabled);
|
||||
dict.SetMethod("isOffscreenRenderingEnabled", &IsOffscreenRenderingEnabled);
|
||||
dict.SetMethod("isPDFViewerEnabled", &IsPDFViewerEnabled);
|
||||
dict.SetMethod("isRunAsNodeEnabled", &IsRunAsNodeEnabled);
|
||||
dict.SetMethod("isFakeLocationProviderEnabled",
|
||||
&IsFakeLocationProviderEnabled);
|
||||
dict.SetMethod("isViewApiEnabled", &IsViewApiEnabled);
|
||||
|
|
|
@ -97,14 +97,8 @@ void GetCrashKeys(std::map<std::string, std::string>* keys) {
|
|||
|
||||
namespace {
|
||||
bool IsRunningAsNode() {
|
||||
#if BUILDFLAG(ENABLE_RUN_AS_NODE)
|
||||
if (!electron::fuses::IsRunAsNodeEnabled())
|
||||
return false;
|
||||
|
||||
return base::Environment::Create()->HasVar(electron::kRunAsNode);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
return electron::fuses::IsRunAsNodeEnabled() &&
|
||||
base::Environment::Create()->HasVar(electron::kRunAsNode);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
|
|
@ -13,9 +13,7 @@ const char kDeviceVendorIdKey[] = "vendorId";
|
|||
const char kDeviceProductIdKey[] = "productId";
|
||||
const char kDeviceSerialNumberKey[] = "serialNumber";
|
||||
|
||||
#if BUILDFLAG(ENABLE_RUN_AS_NODE)
|
||||
const char kRunAsNode[] = "ELECTRON_RUN_AS_NODE";
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||
const char kPDFExtensionPluginName[] = "Chromium PDF Viewer";
|
||||
|
|
|
@ -20,9 +20,7 @@ extern const char kDeviceVendorIdKey[];
|
|||
extern const char kDeviceProductIdKey[];
|
||||
extern const char kDeviceSerialNumberKey[];
|
||||
|
||||
#if BUILDFLAG(ENABLE_RUN_AS_NODE)
|
||||
extern const char kRunAsNode[];
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||
extern const char kPDFExtensionPluginName[];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue