Add our own built-in native module system.

This commit is contained in:
Cheng Zhao 2013-04-14 15:36:48 +08:00
parent 3c96007131
commit 0f6ece2d27
12 changed files with 217 additions and 5 deletions

View file

@ -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

View file

@ -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;