diff --git a/atom/browser/api/atom_api_browser_ipc.cc b/atom/browser/api/atom_api_browser_ipc.cc index b2fb31cead..da0da3fab3 100644 --- a/atom/browser/api/atom_api_browser_ipc.cc +++ b/atom/browser/api/atom_api_browser_ipc.cc @@ -6,6 +6,7 @@ #include "atom/common/native_mate_converters/string16_converter.h" #include "atom/common/native_mate_converters/value_converter.h" #include "content/public/browser/render_view_host.h" +#include "native_mate/dictionary.h" #include "atom/common/node_includes.h" @@ -14,7 +15,7 @@ using content::RenderViewHost; namespace { bool Send(const string16& channel, int process_id, int routing_id, - const base:ListValue& arguments) { + const base::ListValue& arguments) { RenderViewHost* render_view_host(RenderViewHost::FromID( process_id, routing_id)); if (!render_view_host) { diff --git a/atom/browser/api/atom_browser_bindings.cc b/atom/browser/api/atom_browser_bindings.cc index 1d25fa19fe..2a69a595c2 100644 --- a/atom/browser/api/atom_browser_bindings.cc +++ b/atom/browser/api/atom_browser_bindings.cc @@ -7,7 +7,7 @@ #include #include "base/logging.h" -#include "atom/browser/api/atom_api_event.h" +#include "atom/browser/api/event.h" #include "atom/common/v8/native_type_conversions.h" #include "content/public/browser/browser_thread.h" @@ -65,8 +65,8 @@ void AtomBrowserBindings::OnRendererMessageSync( scoped_ptr converter(new V8ValueConverter); // Create the event object. - v8::Handle event = api::Event::CreateV8Object(); - api::Event::Unwrap(event)->SetSenderAndMessage(sender, message); + mate::Handle event = mate::Event::Create(node_isolate); + event->SetSenderAndMessage(sender, message); // process.emit(channel, 'sync-message', event, process_id, routing_id); std::vector> arguments; @@ -75,7 +75,7 @@ void AtomBrowserBindings::OnRendererMessageSync( const base::Value* value; if (args.Get(0, &value)) arguments.push_back(converter->ToV8Value(value, global_env->context())); - arguments.push_back(event); + arguments.push_back(event.ToV8()); arguments.push_back(v8::Integer::New(process_id)); arguments.push_back(v8::Integer::New(routing_id)); diff --git a/spec/api-ipc-spec.coffee b/spec/api-ipc-spec.coffee index 890b7ab6fc..1116d1bce2 100644 --- a/spec/api-ipc-spec.coffee +++ b/spec/api-ipc-spec.coffee @@ -61,12 +61,10 @@ describe 'ipc module', -> msg = ipc.sendChannelSync 'echo', 'test' assert.equal msg, 'test' - it 'does not crash when reply is not sent and both browser and event are destroyed', (done) -> + it 'does not crash when reply is not sent and browser is destroyed', (done) -> w = new BrowserWindow(show: false) remote.require('ipc').once 'send-sync-message', (event) -> event.returnValue = null - w.destroy() - event.destroy() done() w.loadUrl 'file://' + path.join(fixtures, 'api', 'send-sync-message.html')