small tune of IPC interface.
This commit is contained in:
parent
d28f51fb9c
commit
8f0b2b6363
8 changed files with 25 additions and 21 deletions
|
@ -51,8 +51,8 @@ void AtomRendererBindings::BindToFrame(WebFrame* frame) {
|
|||
AtomBindings::BindTo(GetProcessObject(context));
|
||||
}
|
||||
|
||||
void AtomRendererBindings::OnRendererMessage(const std::string& channel,
|
||||
const base::ListValue& args) {
|
||||
void AtomRendererBindings::OnBrowserMessage(const std::string& channel,
|
||||
const base::ListValue& args) {
|
||||
if (!render_view_->GetWebView())
|
||||
return;
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@ class AtomRendererBindings : public AtomBindings {
|
|||
void BindToFrame(WebKit::WebFrame* frame);
|
||||
|
||||
// Dispatch messages from browser.
|
||||
void OnRendererMessage(const std::string& channel,
|
||||
const base::ListValue& args);
|
||||
void OnBrowserMessage(const std::string& channel,
|
||||
const base::ListValue& args);
|
||||
|
||||
private:
|
||||
content::RenderView* render_view_;
|
||||
|
|
|
@ -4,12 +4,12 @@ send = process.atom_binding('ipc').send
|
|||
class Ipc extends EventEmitter
|
||||
constructor: ->
|
||||
process.on 'ATOM_INTERNAL_MESSAGE', (args...) =>
|
||||
@emit('message', args...)
|
||||
@emit(args...)
|
||||
|
||||
send: (args...) ->
|
||||
@sendChannel('ATOM_INTERNAL_MESSAGE', args...)
|
||||
@sendChannel('message', args...)
|
||||
|
||||
sendChannel: (args...) ->
|
||||
send(args...)
|
||||
send('ATOM_INTERNAL_MESSAGE', args...)
|
||||
|
||||
module.exports = new Ipc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue