small tune of IPC interface.

This commit is contained in:
Cheng Zhao 2013-04-23 20:57:14 +08:00
parent d28f51fb9c
commit 8f0b2b6363
8 changed files with 25 additions and 21 deletions

View file

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

View file

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

View file

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