Put View APIs under a build flag

This commit is contained in:
Cheng Zhao 2018-05-24 15:35:50 +09:00
parent 2c8dc9e0bd
commit 0f7c25fc63
6 changed files with 35 additions and 8 deletions

View file

@ -31,7 +31,6 @@
V(atom_browser_app) \
V(atom_browser_auto_updater) \
V(atom_browser_browser_view) \
V(atom_browser_box_layout) \
V(atom_browser_content_tracing) \
V(atom_browser_debugger) \
V(atom_browser_desktop_capturer) \
@ -39,7 +38,6 @@
V(atom_browser_download_item) \
V(atom_browser_global_shortcut) \
V(atom_browser_in_app_purchase) \
V(atom_browser_layout_manager) \
V(atom_browser_menu) \
V(atom_browser_net) \
V(atom_browser_power_monitor) \
@ -67,6 +65,10 @@
V(atom_renderer_ipc) \
V(atom_renderer_web_frame)
#define ELECTRON_VIEW_MODULES(V) \
V(atom_browser_box_layout) \
V(atom_browser_layout_manager)
// This is used to load built-in modules. Instead of using
// __attribute__((constructor)), we call the _register_<modname>
// function for each built-in modules explicitly. This is only
@ -74,6 +76,9 @@
// implementation when calling the NODE_BUILTIN_MODULE_CONTEXT_AWARE.
#define V(modname) void _register_##modname();
ELECTRON_BUILTIN_MODULES(V)
#if defined(ENABLE_VIEW_API)
ELECTRON_VIEW_MODULES(V)
#endif
#undef V
namespace {
@ -167,6 +172,9 @@ NodeBindings::~NodeBindings() {
void NodeBindings::RegisterBuiltinModules() {
#define V(modname) _register_##modname();
ELECTRON_BUILTIN_MODULES(V)
#if defined(ENABLE_VIEW_API)
ELECTRON_VIEW_MODULES(V)
#endif
#undef V
}