Chromium Code Reviews| Index: third_party/WebKit/Source/core/events/MessageEvent.h |
| diff --git a/third_party/WebKit/Source/core/events/MessageEvent.h b/third_party/WebKit/Source/core/events/MessageEvent.h |
| index 734785f2746a1f6156dc390986b960e4a674c53a..b3759a43b6004d1470595e91d682b7161ffea6b4 100644 |
| --- a/third_party/WebKit/Source/core/events/MessageEvent.h |
| +++ b/third_party/WebKit/Source/core/events/MessageEvent.h |
| @@ -31,6 +31,7 @@ |
| #include <memory> |
| #include "bindings/core/v8/SerializedScriptValue.h" |
| +#include "bindings/core/v8/TraceWrapperV8Reference.h" |
| #include "core/CoreExport.h" |
| #include "core/dom/DOMArrayBuffer.h" |
| #include "core/dom/MessagePort.h" |
| @@ -129,17 +130,14 @@ class CORE_EXPORT MessageEvent final : public Event { |
| const AtomicString& InterfaceName() const override; |
| enum DataType { |
| - kDataTypeScriptValue, |
| + kDataTypeV8Reference, |
| kDataTypeSerializedScriptValue, |
| kDataTypeString, |
| kDataTypeBlob, |
| kDataTypeArrayBuffer |
| }; |
| DataType GetDataType() const { return data_type_; } |
| - ScriptValue DataAsScriptValue() const { |
| - DCHECK_EQ(data_type_, kDataTypeScriptValue); |
| - return data_as_script_value_; |
| - } |
| + ScriptValue DataAsScriptValue(ScriptState*) const; |
| SerializedScriptValue* DataAsSerializedScriptValue() const { |
| DCHECK_EQ(data_type_, kDataTypeSerializedScriptValue); |
| return data_as_serialized_script_value_.Get(); |
| @@ -166,6 +164,8 @@ class CORE_EXPORT MessageEvent final : public Event { |
| DECLARE_VIRTUAL_TRACE(); |
| + DECLARE_VIRTUAL_TRACE_WRAPPERS(); |
| + |
| WARN_UNUSED_RESULT v8::Local<v8::Object> AssociateWithWrapper( |
| v8::Isolate*, |
| const WrapperTypeInfo*, |
| @@ -201,7 +201,7 @@ class CORE_EXPORT MessageEvent final : public Event { |
| const String& suborigin); |
| DataType data_type_; |
| - ScriptValue data_as_script_value_; |
| + TraceWrapperV8Reference<v8::Value> data_as_v8_value_reference_; |
|
haraken
2017/05/02 08:10:14
In a follow-up CL, I'd prefer introducing:
Worl
bashi
2017/05/02 08:46:22
Agreed that we should have such class or mechanism
|
| RefPtr<SerializedScriptValue> data_as_serialized_script_value_; |
| String data_as_string_; |
| Member<Blob> data_as_blob_; |