Allow passing V8 objects in EventEmitter
This commit is contained in:
parent
485bd7bbd3
commit
d8447524cb
2 changed files with 35 additions and 15 deletions
|
@ -5,6 +5,8 @@
|
|||
#ifndef ATOM_BROWSER_API_EVENT_EMITTER_H_
|
||||
#define ATOM_BROWSER_API_EVENT_EMITTER_H_
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "native_mate/wrappable.h"
|
||||
|
||||
namespace base {
|
||||
|
@ -23,6 +25,9 @@ namespace mate {
|
|||
|
||||
// Provide helperers to emit event in JavaScript.
|
||||
class EventEmitter : public Wrappable {
|
||||
public:
|
||||
typedef std::vector<v8::Handle<v8::Value>> Arguments;
|
||||
|
||||
protected:
|
||||
EventEmitter();
|
||||
|
||||
|
@ -36,6 +41,13 @@ class EventEmitter : public Wrappable {
|
|||
bool Emit(const base::StringPiece& name, const base::ListValue& args,
|
||||
content::WebContents* sender, IPC::Message* message);
|
||||
|
||||
// Lower level implementations.
|
||||
bool Emit(v8::Isolate* isolate,
|
||||
const base::StringPiece& name,
|
||||
Arguments args,
|
||||
content::WebContents* sender = nullptr,
|
||||
IPC::Message* message = nullptr);
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(EventEmitter);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue