Add our own built-in native module system.
This commit is contained in:
parent
3c96007131
commit
0f6ece2d27
12 changed files with 217 additions and 5 deletions
|
@ -47,9 +47,13 @@ void NodeBindings::Initialize() {
|
|||
v8::Handle<v8::String> type =
|
||||
is_browser_ ? v8::String::New("browser") : v8::String::New("renderer");
|
||||
process->Set(v8::String::New("__atom_type"), type);
|
||||
|
||||
node::Load(process);
|
||||
}
|
||||
}
|
||||
|
||||
void NodeBindings::Load() {
|
||||
v8::HandleScope scope;
|
||||
v8::Context::Scope context_scope(node::g_context);
|
||||
node::Load(node::process);
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
|
|
@ -15,9 +15,12 @@ class NodeBindings {
|
|||
|
||||
virtual ~NodeBindings();
|
||||
|
||||
// Setup everything including V8, libuv and node.js main script.
|
||||
// Setup V8, libuv and the process object.
|
||||
virtual void Initialize();
|
||||
|
||||
// Load node.js main script.
|
||||
virtual void Load();
|
||||
|
||||
// Prepare for message loop integration.
|
||||
virtual void PrepareMessageLoop() = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue