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, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
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 12 matching lines...) Expand all Loading... |
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 * | 25 * |
26 */ | 26 */ |
27 | 27 |
28 #include "config.h" | 28 #include "config.h" |
29 #include "core/events/MessageEvent.h" | 29 #include "core/events/MessageEvent.h" |
30 | 30 |
31 #include "bindings/core/v8/ExceptionMessages.h" | 31 #include "bindings/core/v8/ExceptionMessages.h" |
32 #include "bindings/core/v8/ExceptionState.h" | 32 #include "bindings/core/v8/ExceptionState.h" |
33 #include "bindings/core/v8/custom/V8ArrayBufferCustom.h" | 33 #include "bindings/core/v8/V8ArrayBuffer.h" |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 static inline bool isValidSource(EventTarget* source) | 37 static inline bool isValidSource(EventTarget* source) |
38 { | 38 { |
39 return !source || source->toDOMWindow() || source->toMessagePort(); | 39 return !source || source->toDOMWindow() || source->toMessagePort(); |
40 } | 40 } |
41 | 41 |
42 MessageEventInit::MessageEventInit() | 42 MessageEventInit::MessageEventInit() |
43 { | 43 { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 107 } |
108 | 108 |
109 MessageEvent::MessageEvent(Blob* data, const String& origin) | 109 MessageEvent::MessageEvent(Blob* data, const String& origin) |
110 : Event(EventTypeNames::message, false, false) | 110 : Event(EventTypeNames::message, false, false) |
111 , m_dataType(DataTypeBlob) | 111 , m_dataType(DataTypeBlob) |
112 , m_dataAsBlob(data) | 112 , m_dataAsBlob(data) |
113 , m_origin(origin) | 113 , m_origin(origin) |
114 { | 114 { |
115 } | 115 } |
116 | 116 |
117 MessageEvent::MessageEvent(PassRefPtr<ArrayBuffer> data, const String& origin) | 117 MessageEvent::MessageEvent(PassRefPtr<DOMArrayBuffer> data, const String& origin
) |
118 : Event(EventTypeNames::message, false, false) | 118 : Event(EventTypeNames::message, false, false) |
119 , m_dataType(DataTypeArrayBuffer) | 119 , m_dataType(DataTypeArrayBuffer) |
120 , m_dataAsArrayBuffer(data) | 120 , m_dataAsArrayBuffer(data) |
121 , m_origin(origin) | 121 , m_origin(origin) |
122 { | 122 { |
123 } | 123 } |
124 | 124 |
125 MessageEvent::~MessageEvent() | 125 MessageEvent::~MessageEvent() |
126 { | 126 { |
127 } | 127 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 break; | 205 break; |
206 case MessageEvent::DataTypeArrayBuffer: | 206 case MessageEvent::DataTypeArrayBuffer: |
207 V8HiddenValue::setHiddenValue(isolate, wrapper, V8HiddenValue::arrayBuff
erData(isolate), toV8(dataAsArrayBuffer(), wrapper, isolate)); | 207 V8HiddenValue::setHiddenValue(isolate, wrapper, V8HiddenValue::arrayBuff
erData(isolate), toV8(dataAsArrayBuffer(), wrapper, isolate)); |
208 break; | 208 break; |
209 } | 209 } |
210 | 210 |
211 return wrapper; | 211 return wrapper; |
212 } | 212 } |
213 | 213 |
214 } // namespace blink | 214 } // namespace blink |
OLD | NEW |