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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 visitor->trace(m_ports); | 230 visitor->trace(m_ports); |
231 Event::trace(visitor); | 231 Event::trace(visitor); |
232 } | 232 } |
233 | 233 |
234 v8::Local<v8::Object> MessageEvent::associateWithWrapper( | 234 v8::Local<v8::Object> MessageEvent::associateWithWrapper( |
235 v8::Isolate* isolate, | 235 v8::Isolate* isolate, |
236 const WrapperTypeInfo* wrapperType, | 236 const WrapperTypeInfo* wrapperType, |
237 v8::Local<v8::Object> wrapper) { | 237 v8::Local<v8::Object> wrapper) { |
238 wrapper = Event::associateWithWrapper(isolate, wrapperType, wrapper); | 238 wrapper = Event::associateWithWrapper(isolate, wrapperType, wrapper); |
239 | 239 |
240 // Ensures a wrapper is created for the data to return now so that V8 knows ho
w | 240 // Ensures a wrapper is created for the data to return now so that V8 knows |
241 // much memory is used via the wrapper. To keep the wrapper alive, it's set to | 241 // how much memory is used via the wrapper. To keep the wrapper alive, it's |
242 // the wrapper of the MessageEvent as a private value. | 242 // set to the wrapper of the MessageEvent as a private value. |
243 switch (getDataType()) { | 243 switch (getDataType()) { |
244 case MessageEvent::DataTypeScriptValue: | 244 case MessageEvent::DataTypeScriptValue: |
245 case MessageEvent::DataTypeSerializedScriptValue: | 245 case MessageEvent::DataTypeSerializedScriptValue: |
246 break; | 246 break; |
247 case MessageEvent::DataTypeString: | 247 case MessageEvent::DataTypeString: |
248 V8PrivateProperty::getMessageEventCachedData(isolate).set( | 248 V8PrivateProperty::getMessageEventCachedData(isolate).set( |
249 isolate->GetCurrentContext(), wrapper, | 249 isolate->GetCurrentContext(), wrapper, |
250 v8String(isolate, dataAsString())); | 250 v8String(isolate, dataAsString())); |
251 break; | 251 break; |
252 case MessageEvent::DataTypeBlob: | 252 case MessageEvent::DataTypeBlob: |
253 break; | 253 break; |
254 case MessageEvent::DataTypeArrayBuffer: | 254 case MessageEvent::DataTypeArrayBuffer: |
255 V8PrivateProperty::getMessageEventCachedData(isolate).set( | 255 V8PrivateProperty::getMessageEventCachedData(isolate).set( |
256 isolate->GetCurrentContext(), wrapper, | 256 isolate->GetCurrentContext(), wrapper, |
257 toV8(dataAsArrayBuffer(), wrapper, isolate)); | 257 toV8(dataAsArrayBuffer(), wrapper, isolate)); |
258 break; | 258 break; |
259 } | 259 } |
260 | 260 |
261 return wrapper; | 261 return wrapper; |
262 } | 262 } |
263 | 263 |
264 } // namespace blink | 264 } // namespace blink |
OLD | NEW |