| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Henry Mason (hmason@mac.com) | 2 * Copyright (C) 2007 Henry Mason (hmason@mac.com) |
| 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 const AtomicString& interfaceName() const override; | 89 const AtomicString& interfaceName() const override; |
| 90 | 90 |
| 91 enum DataType { | 91 enum DataType { |
| 92 DataTypeScriptValue, | 92 DataTypeScriptValue, |
| 93 DataTypeSerializedScriptValue, | 93 DataTypeSerializedScriptValue, |
| 94 DataTypeString, | 94 DataTypeString, |
| 95 DataTypeBlob, | 95 DataTypeBlob, |
| 96 DataTypeArrayBuffer | 96 DataTypeArrayBuffer |
| 97 }; | 97 }; |
| 98 DataType getDataType() const { return m_dataType; } | 98 DataType getDataType() const { return m_dataType; } |
| 99 ScriptValue dataAsScriptValue() const { ASSERT(m_dataType == DataTypeScriptV
alue); return m_dataAsScriptValue; } | 99 ScriptValue dataAsScriptValue() const { DCHECK_EQ(m_dataType, DataTypeScript
Value); return m_dataAsScriptValue; } |
| 100 SerializedScriptValue* dataAsSerializedScriptValue() const { ASSERT(m_dataTy
pe == DataTypeSerializedScriptValue); return m_dataAsSerializedScriptValue.get()
; } | 100 SerializedScriptValue* dataAsSerializedScriptValue() const { DCHECK_EQ(m_dat
aType, DataTypeSerializedScriptValue); return m_dataAsSerializedScriptValue.get(
); } |
| 101 String dataAsString() const { ASSERT(m_dataType == DataTypeString); return m
_dataAsString; } | 101 String dataAsString() const { DCHECK_EQ(m_dataType, DataTypeString); return
m_dataAsString; } |
| 102 Blob* dataAsBlob() const { ASSERT(m_dataType == DataTypeBlob); return m_data
AsBlob.get(); } | 102 Blob* dataAsBlob() const { DCHECK_EQ(m_dataType, DataTypeBlob); return m_dat
aAsBlob.get(); } |
| 103 DOMArrayBuffer* dataAsArrayBuffer() const { ASSERT(m_dataType == DataTypeArr
ayBuffer); return m_dataAsArrayBuffer.get(); } | 103 DOMArrayBuffer* dataAsArrayBuffer() const { DCHECK_EQ(m_dataType, DataTypeAr
rayBuffer); return m_dataAsArrayBuffer.get(); } |
| 104 | 104 |
| 105 void setSerializedData(PassRefPtr<SerializedScriptValue> data) | 105 void setSerializedData(PassRefPtr<SerializedScriptValue> data) |
| 106 { | 106 { |
| 107 ASSERT(!m_dataAsSerializedScriptValue); | 107 DCHECK(!m_dataAsSerializedScriptValue); |
| 108 m_dataAsSerializedScriptValue = data; | 108 m_dataAsSerializedScriptValue = data; |
| 109 } | 109 } |
| 110 | 110 |
| 111 void entangleMessagePorts(ExecutionContext*); | 111 void entangleMessagePorts(ExecutionContext*); |
| 112 | 112 |
| 113 DECLARE_VIRTUAL_TRACE(); | 113 DECLARE_VIRTUAL_TRACE(); |
| 114 | 114 |
| 115 v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const WrapperTypeIn
fo*, v8::Local<v8::Object> wrapper) override WARN_UNUSED_RETURN; | 115 v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const WrapperTypeIn
fo*, v8::Local<v8::Object> wrapper) override WARN_UNUSED_RETURN; |
| 116 | 116 |
| 117 private: | 117 private: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 138 // the MessageChannels in a disentangled state. Only one of them can be | 138 // the MessageChannels in a disentangled state. Only one of them can be |
| 139 // non-empty at a time. entangleMessagePorts() moves between the states. | 139 // non-empty at a time. entangleMessagePorts() moves between the states. |
| 140 Member<MessagePortArray> m_ports; | 140 Member<MessagePortArray> m_ports; |
| 141 std::unique_ptr<MessagePortChannelArray> m_channels; | 141 std::unique_ptr<MessagePortChannelArray> m_channels; |
| 142 String m_suborigin; | 142 String m_suborigin; |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 } // namespace blink | 145 } // namespace blink |
| 146 | 146 |
| 147 #endif // MessageEvent_h | 147 #endif // MessageEvent_h |
| OLD | NEW |