Chromium Code Reviews| Index: Source/bindings/v8/custom/V8MessageEventCustom.cpp |
| diff --git a/Source/bindings/v8/custom/V8MessageEventCustom.cpp b/Source/bindings/v8/custom/V8MessageEventCustom.cpp |
| index 906ee9bae55de50670ae76e256caf6a34208e839..1922a7e8c648e1e8b7dda6181d3e292417cb9ad1 100644 |
| --- a/Source/bindings/v8/custom/V8MessageEventCustom.cpp |
| +++ b/Source/bindings/v8/custom/V8MessageEventCustom.cpp |
| @@ -32,6 +32,7 @@ |
| #include "V8MessageEvent.h" |
| #include "bindings/v8/SerializedScriptValue.h" |
| +#include "bindings/v8/V8HiddenPropertyName.h" |
| #include "core/dom/MessageEvent.h" |
| #include "V8ArrayBuffer.h" |
| @@ -49,11 +50,9 @@ void V8MessageEvent::dataAttrGetterCustom(v8::Local<v8::String> name, const v8:: |
| v8::Handle<v8::Value> result; |
| switch (event->dataType()) { |
| case MessageEvent::DataTypeScriptValue: { |
| - ScriptValue scriptValue = event->dataAsScriptValue(); |
| - if (scriptValue.hasNoValue()) |
| + result = info.Holder()->GetHiddenValue(V8HiddenPropertyName::data()); |
| + if (result.IsEmpty()) |
| result = v8Null(info.GetIsolate()); |
| - else |
| - result = scriptValue.v8Value(); |
| break; |
| } |
| @@ -93,7 +92,7 @@ void V8MessageEvent::initMessageEventMethodCustom(const v8::FunctionCallbackInfo |
| String typeArg = toWebCoreString(args[0]); |
| bool canBubbleArg = args[1]->BooleanValue(); |
| bool cancelableArg = args[2]->BooleanValue(); |
| - ScriptValue dataArg = ScriptValue(args[3]); |
| + v8::Handle<v8::Value> dataArg = args[3]; |
| String originArg = toWebCoreString(args[4]); |
| String lastEventIdArg = toWebCoreString(args[5]); |
|
haraken
2013/06/27 04:50:27
Would you use V8TRYCATCH_* for these assignments?
jww
2013/06/27 17:44:42
Done.
|
| @@ -111,7 +110,8 @@ void V8MessageEvent::initMessageEventMethodCustom(const v8::FunctionCallbackInfo |
| if (!getMessagePortArray(args[7], *portArray, args.GetIsolate())) |
| return; |
| } |
| - event->initMessageEvent(typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, portArray.release()); |
| + args.Holder()->SetHiddenValue(V8HiddenPropertyName::data(), dataArg); |
| + event->initMessageEvent(typeArg, canBubbleArg, cancelableArg, originArg, lastEventIdArg, sourceArg, portArray.release()); |
| } |
| void V8MessageEvent::webkitInitMessageEventMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args) |