#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"
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) {
#include <vector>
#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"
scoped_ptr<V8ValueConverter> converter(new V8ValueConverter);
// Create the event object.
- v8::Handle<v8::Object> event = api::Event::CreateV8Object();
- api::Event::Unwrap<api::Event>(event)->SetSenderAndMessage(sender, message);
+ mate::Handle<mate::Event> event = mate::Event::Create(node_isolate);
+ event->SetSenderAndMessage(sender, message);
// process.emit(channel, 'sync-message', event, process_id, routing_id);
std::vector<v8::Handle<v8::Value>> arguments;
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));
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')