mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Move native function declarations to js file
This allows multiple native handlers to load it as an extension without duplicating all the expected native function calls names internally.
This commit is contained in:
@@ -67,6 +67,14 @@ NativeHandler::NativeHandler() :
|
||||
object->SetValue(functionName, function, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
}
|
||||
|
||||
string nativePath = io_utils_real_app_path(
|
||||
"/../src/stdlib/native-handler.js");
|
||||
if (!nativePath.empty()) {
|
||||
string extensionCode;
|
||||
if (io_utils_read(nativePath, &extensionCode) > 0)
|
||||
CefRegisterExtension("v8/native-handler", extensionCode, this);
|
||||
}
|
||||
|
||||
notifyFd = inotify_init();
|
||||
if (notifyFd != -1)
|
||||
g_thread_create_full(NotifyWatchersCallback, this, 0, true, false,
|
||||
|
||||
Reference in New Issue
Block a user