| Index: Source/bindings/v8/custom/V8CustomEventCustom.cpp
|
| diff --git a/Source/bindings/v8/custom/V8CustomEventCustom.cpp b/Source/bindings/v8/custom/V8CustomEventCustom.cpp
|
| index d03eb673ddfdd238e5d9d7ed20aeedc7f7f1d504..0aafa1cea6c44d6642827164a1e682688f9cb3d1 100644
|
| --- a/Source/bindings/v8/custom/V8CustomEventCustom.cpp
|
| +++ b/Source/bindings/v8/custom/V8CustomEventCustom.cpp
|
| @@ -34,7 +34,7 @@
|
| #include "V8Event.h"
|
| #include "bindings/v8/Dictionary.h"
|
| #include "bindings/v8/ScriptState.h"
|
| -#include "bindings/v8/ScriptValue.h"
|
| +#include "bindings/v8/SerializedScriptValue.h"
|
| #include "bindings/v8/V8Binding.h"
|
| #include "bindings/v8/V8DOMWrapper.h"
|
| #include "bindings/v8/V8HiddenPropertyName.h"
|
| @@ -63,9 +63,14 @@ void V8CustomEvent::detailAttrGetterCustom(v8::Local<v8::String> name, const v8:
|
| return;
|
| }
|
|
|
| - SerializedScriptValue* serialized = event->serializedScriptValue();
|
| - if (serialized) {
|
| - result = serialized->deserialize();
|
| + if (!event->serializedScriptValue()) {
|
| + v8::Local<v8::Value> mainWorldDetail = getHiddenValueFromMainWorldWrapper(info.GetIsolate(), event, V8HiddenPropertyName::detail());
|
| + if (!mainWorldDetail.IsEmpty())
|
| + event->setSerializedDetail(SerializedScriptValue::createAndSwallowExceptions(mainWorldDetail, info.GetIsolate()));
|
| + }
|
| +
|
| + if (event->serializedScriptValue()) {
|
| + result = event->serializedScriptValue()->deserialize();
|
| v8SetReturnValue(info, cacheState(info.Holder(), result));
|
| return;
|
| }
|
| @@ -83,8 +88,13 @@ void V8CustomEvent::initCustomEventMethodCustom(const v8::FunctionCallbackInfo<v
|
| V8TRYCATCH_VOID(bool, cancelableArg, args[2]->BooleanValue());
|
| v8::Handle<v8::Value> detailsArg = args[3];
|
|
|
| - args.Holder()->SetHiddenValue(V8HiddenPropertyName::detail(), detailsArg);
|
| event->initEvent(typeArg, canBubbleArg, cancelableArg);
|
| +
|
| + if (!detailsArg.IsEmpty()) {
|
| + args.Holder()->SetHiddenValue(V8HiddenPropertyName::detail(), detailsArg);
|
| + if (isolatedWorldForIsolate(args.GetIsolate()))
|
| + event->setSerializedDetail(SerializedScriptValue::createAndSwallowExceptions(detailsArg, args.GetIsolate()));
|
| + }
|
| }
|
|
|
| } // namespace WebCore
|
|
|