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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 Event::trace(visitor); | 213 Event::trace(visitor); |
214 } | 214 } |
215 | 215 |
216 v8::Local<v8::Object> MessageEvent::associateWithWrapper(v8::Isolate* isolate, c
onst WrapperTypeInfo* wrapperType, v8::Local<v8::Object> wrapper) | 216 v8::Local<v8::Object> MessageEvent::associateWithWrapper(v8::Isolate* isolate, c
onst WrapperTypeInfo* wrapperType, v8::Local<v8::Object> wrapper) |
217 { | 217 { |
218 wrapper = Event::associateWithWrapper(isolate, wrapperType, wrapper); | 218 wrapper = Event::associateWithWrapper(isolate, wrapperType, wrapper); |
219 | 219 |
220 // Ensures a wrapper is created for the data to return now so that V8 knows
how | 220 // Ensures a wrapper is created for the data to return now so that V8 knows
how |
221 // much memory is used via the wrapper. To keep the wrapper alive, it's set
to | 221 // much memory is used via the wrapper. To keep the wrapper alive, it's set
to |
222 // the wrapper of the MessageEvent as a hidden value. | 222 // the wrapper of the MessageEvent as a hidden value. |
223 switch (dataType()) { | 223 switch (getDataType()) { |
224 case MessageEvent::DataTypeScriptValue: | 224 case MessageEvent::DataTypeScriptValue: |
225 case MessageEvent::DataTypeSerializedScriptValue: | 225 case MessageEvent::DataTypeSerializedScriptValue: |
226 break; | 226 break; |
227 case MessageEvent::DataTypeString: | 227 case MessageEvent::DataTypeString: |
228 V8HiddenValue::setHiddenValue(ScriptState::current(isolate), wrapper, V8
HiddenValue::stringData(isolate), v8String(isolate, dataAsString())); | 228 V8HiddenValue::setHiddenValue(ScriptState::current(isolate), wrapper, V8
HiddenValue::stringData(isolate), v8String(isolate, dataAsString())); |
229 break; | 229 break; |
230 case MessageEvent::DataTypeBlob: | 230 case MessageEvent::DataTypeBlob: |
231 break; | 231 break; |
232 case MessageEvent::DataTypeArrayBuffer: | 232 case MessageEvent::DataTypeArrayBuffer: |
233 V8HiddenValue::setHiddenValue(ScriptState::current(isolate), wrapper, V8
HiddenValue::arrayBufferData(isolate), toV8(dataAsArrayBuffer(), wrapper, isolat
e)); | 233 V8HiddenValue::setHiddenValue(ScriptState::current(isolate), wrapper, V8
HiddenValue::arrayBufferData(isolate), toV8(dataAsArrayBuffer(), wrapper, isolat
e)); |
234 break; | 234 break; |
235 } | 235 } |
236 | 236 |
237 return wrapper; | 237 return wrapper; |
238 } | 238 } |
239 | 239 |
240 } // namespace blink | 240 } // namespace blink |
OLD | NEW |