Separate the creation function of NodeBindings for renderer and browser.

On Windows the message loop integration would need two different
implementations.
This commit is contained in:
Cheng Zhao 2013-07-04 19:47:48 +08:00
parent d82f2dd835
commit 8bdf06131b
4 changed files with 11 additions and 5 deletions

View file

@ -15,7 +15,8 @@ namespace atom {
class NodeBindings {
public:
static NodeBindings* Create(bool is_browser);
static NodeBindings* CreateInBrowser();
static NodeBindings* CreateInRenderer();
virtual ~NodeBindings();

View file

@ -123,8 +123,13 @@ void NodeBindingsMac::OnWatcherQueueChanged(uv_loop_t* loop) {
}
// static
NodeBindings* NodeBindings::Create(bool is_browser) {
return new NodeBindingsMac(is_browser);
NodeBindings* NodeBindings::CreateInBrowser() {
return new NodeBindingsMac(true);
}
// static
NodeBindings* NodeBindings::CreateInRenderer() {
return new NodeBindingsMac(false);
}
} // namespace atom