chore: rename node bindings atom => electron (#22176)

This commit is contained in:
Jeremy Apthorp 2020-02-14 03:25:39 -08:00 committed by GitHub
parent b5e7df1cbf
commit 602913cb4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 104 additions and 102 deletions

View file

@ -1,8 +1,8 @@
'use strict'; 'use strict';
(function () { (function () {
const asar = process._linkedBinding('atom_common_asar') const asar = process._linkedBinding('electron_common_asar')
const v8Util = process._linkedBinding('atom_common_v8_util') const v8Util = process._linkedBinding('electron_common_v8_util')
const { Buffer } = require('buffer') const { Buffer } = require('buffer')
const Module = require('module') const Module = require('module')
const path = require('path') const path = require('path')

View file

@ -1,10 +1,10 @@
export function electronBindingSetup (binding: typeof process['_linkedBinding'], processType: typeof process['type']): typeof process['electronBinding'] { export function electronBindingSetup (binding: typeof process['_linkedBinding'], processType: typeof process['type']): typeof process['electronBinding'] {
return function electronBinding (name: string) { return function electronBinding (name: string) {
try { try {
return binding(`atom_${processType}_${name}`) return binding(`electron_${processType}_${name}`)
} catch (error) { } catch (error) {
if (/No such module/.test(error.message)) { if (/No such module/.test(error.message)) {
return binding(`atom_common_${name}`) return binding(`electron_common_${name}`)
} else { } else {
throw error throw error
} }

View file

@ -7,7 +7,7 @@ const v8Util = process.electronBinding('v8_util')
const IsolatedWorldIDs = { const IsolatedWorldIDs = {
/** /**
* Start of extension isolated world IDs, as defined in * Start of extension isolated world IDs, as defined in
* atom_render_frame_observer.h * electron_render_frame_observer.h
*/ */
ISOLATED_WORLD_EXTENSIONS: 1 << 20 ISOLATED_WORLD_EXTENSIONS: 1 << 20
} }

View file

@ -19,7 +19,7 @@ index 0cad5209c4ff4e68d7c400af1d2b4c234210ddb4..918bc8c0c4e78bad5a3372e8a5522da0
return NativeModule.map.has(id); return NativeModule.map.has(id);
}; };
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
index 2aa2a3b46c5fc12d22e0e74e304d2d55ca02c3b5..e7bd18855fb98a822833b4366bfb595dccfc1b6f 100644 index 2aa2a3b46c5fc12d22e0e74e304d2d55ca02c3b5..c86b5851ca9332ca440443e5feab2e65c7ac30b9 100644
--- a/lib/internal/bootstrap/pre_execution.js --- a/lib/internal/bootstrap/pre_execution.js
+++ b/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js
@@ -61,6 +61,7 @@ function prepareMainThreadExecution(expandArgv1 = false) { @@ -61,6 +61,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
@ -35,7 +35,7 @@ index 2aa2a3b46c5fc12d22e0e74e304d2d55ca02c3b5..e7bd18855fb98a822833b4366bfb595d
} }
+function setupAsarSupport() { +function setupAsarSupport() {
+ process._linkedBinding('atom_common_asar').initAsarSupport(require); + process._linkedBinding('electron_common_asar').initAsarSupport(require);
+} +}
+ +
module.exports = { module.exports = {

View file

@ -1544,4 +1544,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_app, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_app, Initialize)

View file

@ -161,4 +161,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_auto_updater, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_auto_updater, Initialize)

View file

@ -172,4 +172,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_browser_view, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_browser_view, Initialize)

View file

@ -535,4 +535,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_window, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_window, Initialize)

View file

@ -162,4 +162,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_content_tracing, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_content_tracing, Initialize)

View file

@ -209,4 +209,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_debugger, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_debugger, Initialize)

View file

@ -218,4 +218,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_desktop_capturer, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_desktop_capturer, Initialize)

View file

@ -104,4 +104,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_dialog, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_dialog, Initialize)

View file

@ -252,4 +252,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_download_item, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_download_item, Initialize)

View file

@ -25,4 +25,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_event, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_event, Initialize)

View file

@ -159,4 +159,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_global_shortcut, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_global_shortcut, Initialize)

View file

@ -166,4 +166,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_in_app_purchase, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_in_app_purchase, Initialize)

View file

@ -287,4 +287,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_menu, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_menu, Initialize)

View file

@ -161,4 +161,4 @@ bool Converter<ui::NativeTheme::ThemeSource>::FromV8(
} // namespace gin } // namespace gin
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_common_native_theme, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_native_theme, Initialize)

View file

@ -80,4 +80,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_net, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_net, Initialize)

View file

@ -294,4 +294,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_common_notification, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_notification, Initialize)

View file

@ -151,4 +151,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_power_monitor, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_power_monitor, Initialize)

View file

@ -146,4 +146,5 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_power_save_blocker, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_power_save_blocker,
Initialize)

View file

@ -325,4 +325,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_protocol, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_protocol, Initialize)

View file

@ -193,4 +193,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_common_screen, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_screen, Initialize)

View file

@ -1007,4 +1007,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_session, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_session, Initialize)

View file

@ -150,4 +150,5 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_system_preferences, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_system_preferences,
Initialize)

View file

@ -1263,4 +1263,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_top_level_window, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_top_level_window, Initialize)

View file

@ -320,4 +320,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_tray, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_tray, Initialize)

View file

@ -86,4 +86,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_view, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_view, Initialize)

View file

@ -2774,4 +2774,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_web_contents, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_web_contents, Initialize)

View file

@ -127,4 +127,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_web_contents_view, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_web_contents_view, Initialize)

View file

@ -52,4 +52,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_web_view_manager, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_web_view_manager, Initialize)

View file

@ -84,4 +84,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_box_layout, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_box_layout, Initialize)

View file

@ -56,4 +56,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_button, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_button, Initialize)

View file

@ -76,4 +76,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_label_button, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_label_button, Initialize)

View file

@ -60,4 +60,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_layout_manager, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_layout_manager, Initialize)

View file

@ -54,4 +54,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_md_text_button, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_md_text_button, Initialize)

View file

@ -56,4 +56,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_resize_area, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_resize_area, Initialize)

View file

@ -63,4 +63,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_text_field, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_text_field, Initialize)

View file

@ -152,4 +152,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_common_asar, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_asar, Initialize)

View file

@ -242,4 +242,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_common_clipboard, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_clipboard, Initialize)

View file

@ -57,4 +57,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_common_command_line, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_command_line, Initialize)

View file

@ -64,4 +64,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_common_crash_reporter, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_crash_reporter, Initialize)

View file

@ -592,4 +592,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_common_native_image, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_native_image, Initialize)

View file

@ -167,4 +167,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_common_shell, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_shell, Initialize)

View file

@ -139,4 +139,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_common_v8_util, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_v8_util, Initialize)

View file

@ -83,4 +83,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_common_features, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_features, Initialize)

View file

@ -33,55 +33,55 @@
#include "shell/common/node_includes.h" #include "shell/common/node_includes.h"
#define ELECTRON_BUILTIN_MODULES(V) \ #define ELECTRON_BUILTIN_MODULES(V) \
V(atom_browser_app) \ V(electron_browser_app) \
V(atom_browser_auto_updater) \ V(electron_browser_auto_updater) \
V(atom_browser_browser_view) \ V(electron_browser_browser_view) \
V(atom_browser_content_tracing) \ V(electron_browser_content_tracing) \
V(atom_browser_debugger) \ V(electron_browser_debugger) \
V(atom_browser_dialog) \ V(electron_browser_dialog) \
V(atom_browser_download_item) \ V(electron_browser_download_item) \
V(atom_browser_event) \ V(electron_browser_event) \
V(atom_browser_global_shortcut) \ V(electron_browser_global_shortcut) \
V(atom_browser_in_app_purchase) \ V(electron_browser_in_app_purchase) \
V(atom_browser_menu) \ V(electron_browser_menu) \
V(atom_browser_net) \ V(electron_browser_net) \
V(atom_browser_power_monitor) \ V(electron_browser_power_monitor) \
V(atom_browser_power_save_blocker) \ V(electron_browser_power_save_blocker) \
V(atom_browser_protocol) \ V(electron_browser_protocol) \
V(atom_browser_session) \ V(electron_browser_session) \
V(atom_browser_system_preferences) \ V(electron_browser_system_preferences) \
V(atom_browser_top_level_window) \ V(electron_browser_top_level_window) \
V(atom_browser_tray) \ V(electron_browser_tray) \
V(atom_browser_web_contents) \ V(electron_browser_web_contents) \
V(atom_browser_web_contents_view) \ V(electron_browser_web_contents_view) \
V(atom_browser_view) \ V(electron_browser_view) \
V(atom_browser_web_view_manager) \ V(electron_browser_web_view_manager) \
V(atom_browser_window) \ V(electron_browser_window) \
V(atom_common_asar) \ V(electron_common_asar) \
V(atom_common_clipboard) \ V(electron_common_clipboard) \
V(atom_common_command_line) \ V(electron_common_command_line) \
V(atom_common_crash_reporter) \ V(electron_common_crash_reporter) \
V(atom_common_features) \ V(electron_common_features) \
V(atom_common_native_image) \ V(electron_common_native_image) \
V(atom_common_native_theme) \ V(electron_common_native_theme) \
V(atom_common_notification) \ V(electron_common_notification) \
V(atom_common_screen) \ V(electron_common_screen) \
V(atom_common_shell) \ V(electron_common_shell) \
V(atom_common_v8_util) \ V(electron_common_v8_util) \
V(atom_renderer_context_bridge) \ V(electron_renderer_context_bridge) \
V(atom_renderer_ipc) \ V(electron_renderer_ipc) \
V(atom_renderer_web_frame) V(electron_renderer_web_frame)
#define ELECTRON_VIEW_MODULES(V) \ #define ELECTRON_VIEW_MODULES(V) \
V(atom_browser_box_layout) \ V(electron_browser_box_layout) \
V(atom_browser_button) \ V(electron_browser_button) \
V(atom_browser_label_button) \ V(electron_browser_label_button) \
V(atom_browser_layout_manager) \ V(electron_browser_layout_manager) \
V(atom_browser_md_text_button) \ V(electron_browser_md_text_button) \
V(atom_browser_resize_area) \ V(electron_browser_resize_area) \
V(atom_browser_text_field) V(electron_browser_text_field)
#define ELECTRON_DESKTOP_CAPTURER_MODULE(V) V(atom_browser_desktop_capturer) #define ELECTRON_DESKTOP_CAPTURER_MODULE(V) V(electron_browser_desktop_capturer)
// This is used to load built-in modules. Instead of using // This is used to load built-in modules. Instead of using
// __attribute__((constructor)), we call the _register_<modname> // __attribute__((constructor)), we call the _register_<modname>

View file

@ -513,4 +513,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_renderer_context_bridge, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_renderer_context_bridge, Initialize)

View file

@ -149,4 +149,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_renderer_ipc, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_renderer_ipc, Initialize)

View file

@ -595,4 +595,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace } // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_renderer_web_frame, Initialize) NODE_LINKED_MODULE_CONTEXT_AWARE(electron_renderer_web_frame, Initialize)

View file

@ -66,7 +66,7 @@ void ElectronRenderFrameObserver::DidInstallConditionalFeatures(
auto* command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
bool use_context_isolation = renderer_client_->isolated_world(); bool use_context_isolation = renderer_client_->isolated_world();
// This logic matches the EXPLAINED logic in atom_renderer_client.cc // This logic matches the EXPLAINED logic in electron_renderer_client.cc
// to avoid explaining it twice go check that implementation in // to avoid explaining it twice go check that implementation in
// DidCreateScriptContext(); // DidCreateScriptContext();
bool is_main_world = IsMainWorld(world_id); bool is_main_world = IsMainWorld(world_id);