Pass synchronous messages by JSON string.
We are going to use IPC_MESSAGE_HANDLER_DELAY_REPLY to handle synchronous messages but DictionaryValue is not copyable, so we pass the JSON string instead.
This commit is contained in:
parent
07b5039c64
commit
ef5a4b5fe0
10 changed files with 44 additions and 20 deletions
|
@ -39,6 +39,13 @@ v8::Handle<v8::Object> Event::CreateV8Object() {
|
|||
return scope.Close(v8_event);
|
||||
}
|
||||
|
||||
// static
|
||||
std::string Event::GetReturnValue(v8::Handle<v8::Object> event) {
|
||||
v8::HandleScope scope;
|
||||
v8::Local<v8::Value> json = event->Get(v8::String::New("returnValue"));
|
||||
return *v8::String::Utf8Value(json);
|
||||
}
|
||||
|
||||
v8::Handle<v8::Value> Event::New(const v8::Arguments &args) {
|
||||
Event* event = new Event;
|
||||
event->Wrap(args.This());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue