Don't separate node bindings into renderer and browser part.
Since we are going to use embeding thread to implement message integration on all platforms, we do not need to separate renderer and browser anymore.
This commit is contained in:
parent
bc62d8c2c5
commit
008b8d404d
11 changed files with 64 additions and 123 deletions
10
atom.gyp
10
atom.gyp
|
@ -105,8 +105,6 @@
|
||||||
'browser/native_window_win.cc',
|
'browser/native_window_win.cc',
|
||||||
'browser/native_window_win.h',
|
'browser/native_window_win.h',
|
||||||
'browser/native_window_observer.h',
|
'browser/native_window_observer.h',
|
||||||
'browser/node_bindings_browser_win.cc',
|
|
||||||
'browser/node_bindings_browser_win.h',
|
|
||||||
'browser/nsalert_synchronous_sheet.h',
|
'browser/nsalert_synchronous_sheet.h',
|
||||||
'browser/nsalert_synchronous_sheet.mm',
|
'browser/nsalert_synchronous_sheet.mm',
|
||||||
'browser/window_list.cc',
|
'browser/window_list.cc',
|
||||||
|
@ -132,6 +130,8 @@
|
||||||
'common/node_bindings.h',
|
'common/node_bindings.h',
|
||||||
'common/node_bindings_mac.cc',
|
'common/node_bindings_mac.cc',
|
||||||
'common/node_bindings_mac.h',
|
'common/node_bindings_mac.h',
|
||||||
|
'common/node_bindings_win.cc',
|
||||||
|
'common/node_bindings_win.h',
|
||||||
'common/options_switches.cc',
|
'common/options_switches.cc',
|
||||||
'common/options_switches.h',
|
'common/options_switches.h',
|
||||||
'common/platform_util.h',
|
'common/platform_util.h',
|
||||||
|
@ -147,8 +147,6 @@
|
||||||
'renderer/atom_render_view_observer.h',
|
'renderer/atom_render_view_observer.h',
|
||||||
'renderer/atom_renderer_client.cc',
|
'renderer/atom_renderer_client.cc',
|
||||||
'renderer/atom_renderer_client.h',
|
'renderer/atom_renderer_client.h',
|
||||||
'renderer/node_bindings_renderer_win.cc',
|
|
||||||
'renderer/node_bindings_renderer_win.h',
|
|
||||||
],
|
],
|
||||||
'framework_sources': [
|
'framework_sources': [
|
||||||
'app/atom_library_main.cc',
|
'app/atom_library_main.cc',
|
||||||
|
@ -179,6 +177,10 @@
|
||||||
'mac_framework_dirs': [
|
'mac_framework_dirs': [
|
||||||
'<(atom_source_root)/frameworks',
|
'<(atom_source_root)/frameworks',
|
||||||
],
|
],
|
||||||
|
'includes': [
|
||||||
|
# Rules for excluding e.g. foo_win.cc from the build on non-Windows.
|
||||||
|
'filename_rules.gypi',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
'targets': [
|
'targets': [
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,7 +20,7 @@ AtomBrowserMainParts* AtomBrowserMainParts::self_ = NULL;
|
||||||
AtomBrowserMainParts::AtomBrowserMainParts()
|
AtomBrowserMainParts::AtomBrowserMainParts()
|
||||||
: atom_bindings_(new AtomBrowserBindings),
|
: atom_bindings_(new AtomBrowserBindings),
|
||||||
browser_(new Browser),
|
browser_(new Browser),
|
||||||
node_bindings_(NodeBindings::CreateInBrowser()) {
|
node_bindings_(NodeBindings::Create(true)) {
|
||||||
DCHECK(!self_) << "Cannot have two AtomBrowserMainParts";
|
DCHECK(!self_) << "Cannot have two AtomBrowserMainParts";
|
||||||
self_ = this;
|
self_ = this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#include "browser/node_bindings_browser_win.h"
|
|
||||||
|
|
||||||
namespace atom {
|
|
||||||
|
|
||||||
NodeBindingsBrowserWin::NodeBindingsBrowserWin()
|
|
||||||
: NodeBindings(true) {
|
|
||||||
}
|
|
||||||
|
|
||||||
NodeBindingsBrowserWin::~NodeBindingsBrowserWin() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void NodeBindingsBrowserWin::PrepareMessageLoop() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void NodeBindingsBrowserWin::RunMessageLoop() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// static
|
|
||||||
NodeBindings* NodeBindings::CreateInBrowser() {
|
|
||||||
return new NodeBindingsBrowserWin();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace atom
|
|
|
@ -1,27 +0,0 @@
|
||||||
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef ATOM_BROWSER_NODE_BINDINGS_BROWSER_WIN_H_
|
|
||||||
#define ATOM_BROWSER_NODE_BINDINGS_BROWSER_WIN_H_
|
|
||||||
|
|
||||||
#include "base/compiler_specific.h"
|
|
||||||
#include "common/node_bindings.h"
|
|
||||||
|
|
||||||
namespace atom {
|
|
||||||
|
|
||||||
class NodeBindingsBrowserWin : public NodeBindings {
|
|
||||||
public:
|
|
||||||
NodeBindingsBrowserWin();
|
|
||||||
virtual ~NodeBindingsBrowserWin();
|
|
||||||
|
|
||||||
virtual void PrepareMessageLoop() OVERRIDE;
|
|
||||||
virtual void RunMessageLoop() OVERRIDE;
|
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(NodeBindingsBrowserWin);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace atom
|
|
||||||
|
|
||||||
#endif // ATOM_BROWSER_NODE_BINDINGS_BROWSER_WIN_H_
|
|
|
@ -20,8 +20,7 @@ namespace atom {
|
||||||
|
|
||||||
class NodeBindings {
|
class NodeBindings {
|
||||||
public:
|
public:
|
||||||
static NodeBindings* CreateInBrowser();
|
static NodeBindings* Create(bool is_browser);
|
||||||
static NodeBindings* CreateInRenderer();
|
|
||||||
|
|
||||||
virtual ~NodeBindings();
|
virtual ~NodeBindings();
|
||||||
|
|
||||||
|
|
|
@ -45,13 +45,8 @@ void NodeBindingsMac::PollEvents() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
NodeBindings* NodeBindings::CreateInBrowser() {
|
NodeBindings* NodeBindings::Create(bool is_browser) {
|
||||||
return new NodeBindingsMac(true);
|
return new NodeBindingsMac(is_browser);
|
||||||
}
|
|
||||||
|
|
||||||
// static
|
|
||||||
NodeBindings* NodeBindings::CreateInRenderer() {
|
|
||||||
return new NodeBindingsMac(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
27
common/node_bindings_win.cc
Normal file
27
common/node_bindings_win.cc
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
#include "common/node_bindings_win.h"
|
||||||
|
|
||||||
|
#include "vendor/node/src/node.h"
|
||||||
|
#include "vendor/node/src/node_internals.h"
|
||||||
|
|
||||||
|
namespace atom {
|
||||||
|
|
||||||
|
NodeBindingsWin::NodeBindingsWin(bool is_browser)
|
||||||
|
: NodeBindings(is_browser) {
|
||||||
|
}
|
||||||
|
|
||||||
|
NodeBindingsWin::~NodeBindingsWin() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void NodeBindingsWin::PollEvents() {
|
||||||
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
NodeBindings* NodeBindings::Create(bool is_browser) {
|
||||||
|
return new NodeBindingsWin(is_browser);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace atom
|
26
common/node_bindings_win.h
Normal file
26
common/node_bindings_win.h
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
#ifndef ATOM_COMMON_NODE_BINDINGS_WIN_
|
||||||
|
#define ATOM_COMMON_NODE_BINDINGS_WIN_
|
||||||
|
|
||||||
|
#include "base/compiler_specific.h"
|
||||||
|
#include "common/node_bindings.h"
|
||||||
|
|
||||||
|
namespace atom {
|
||||||
|
|
||||||
|
class NodeBindingsWin : public NodeBindings {
|
||||||
|
public:
|
||||||
|
explicit NodeBindingsWin(bool is_browser);
|
||||||
|
virtual ~NodeBindingsWin();
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual void PollEvents() OVERRIDE;
|
||||||
|
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(NodeBindingsWin);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace atom
|
||||||
|
|
||||||
|
#endif // ATOM_COMMON_NODE_BINDINGS_WIN_
|
|
@ -23,7 +23,7 @@ v8::Handle<v8::Context> GetNodeContext() {
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
AtomRendererClient::AtomRendererClient()
|
AtomRendererClient::AtomRendererClient()
|
||||||
: node_bindings_(NodeBindings::CreateInRenderer()) {
|
: node_bindings_(NodeBindings::Create(false)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
AtomRendererClient::~AtomRendererClient() {
|
AtomRendererClient::~AtomRendererClient() {
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#include "renderer/node_bindings_renderer_win.h"
|
|
||||||
|
|
||||||
namespace atom {
|
|
||||||
|
|
||||||
NodeBindingsRendererWin::NodeBindingsRendererWin()
|
|
||||||
: NodeBindings(false) {
|
|
||||||
}
|
|
||||||
|
|
||||||
NodeBindingsRendererWin::~NodeBindingsRendererWin() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void NodeBindingsRendererWin::PrepareMessageLoop() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void NodeBindingsRendererWin::RunMessageLoop() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// static
|
|
||||||
NodeBindings* NodeBindings::CreateInRenderer() {
|
|
||||||
return new NodeBindingsRendererWin();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace atom
|
|
|
@ -1,27 +0,0 @@
|
||||||
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef ATOM_RENDERER_NODE_BINDINGS_RENDERER_WIN_H_
|
|
||||||
#define ATOM_RENDERER_NODE_BINDINGS_RENDERER_WIN_H_
|
|
||||||
|
|
||||||
#include "base/compiler_specific.h"
|
|
||||||
#include "common/node_bindings.h"
|
|
||||||
|
|
||||||
namespace atom {
|
|
||||||
|
|
||||||
class NodeBindingsRendererWin : public NodeBindings {
|
|
||||||
public:
|
|
||||||
NodeBindingsRendererWin();
|
|
||||||
virtual ~NodeBindingsRendererWin();
|
|
||||||
|
|
||||||
virtual void PrepareMessageLoop() OVERRIDE;
|
|
||||||
virtual void RunMessageLoop() OVERRIDE;
|
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(NodeBindingsRendererWin);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace atom
|
|
||||||
|
|
||||||
#endif // ATOM_RENDERER_NODE_BINDINGS_RENDERER_WIN_H_
|
|
Loading…
Reference in a new issue