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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 DEFINE_TRACE(MessageEvent) | 180 DEFINE_TRACE(MessageEvent) |
181 { | 181 { |
182 visitor->trace(m_dataAsBlob); | 182 visitor->trace(m_dataAsBlob); |
183 visitor->trace(m_source); | 183 visitor->trace(m_source); |
184 #if ENABLE(OILPAN) | 184 #if ENABLE(OILPAN) |
185 visitor->trace(m_ports); | 185 visitor->trace(m_ports); |
186 #endif | 186 #endif |
187 Event::trace(visitor); | 187 Event::trace(visitor); |
188 } | 188 } |
189 | 189 |
190 v8::Handle<v8::Object> MessageEvent::associateWithWrapper(v8::Isolate* isolate,
const WrapperTypeInfo* wrapperType, v8::Handle<v8::Object> wrapper) | 190 v8::Local<v8::Object> MessageEvent::associateWithWrapper(v8::Isolate* isolate, c
onst WrapperTypeInfo* wrapperType, v8::Local<v8::Object> wrapper) |
191 { | 191 { |
192 Event::associateWithWrapper(isolate, wrapperType, wrapper); | 192 Event::associateWithWrapper(isolate, wrapperType, wrapper); |
193 | 193 |
194 // Ensures a wrapper is created for the data to return now so that V8 knows
how | 194 // Ensures a wrapper is created for the data to return now so that V8 knows
how |
195 // much memory is used via the wrapper. To keep the wrapper alive, it's set
to | 195 // much memory is used via the wrapper. To keep the wrapper alive, it's set
to |
196 // the wrapper of the MessageEvent as a hidden value. | 196 // the wrapper of the MessageEvent as a hidden value. |
197 switch (dataType()) { | 197 switch (dataType()) { |
198 case MessageEvent::DataTypeScriptValue: | 198 case MessageEvent::DataTypeScriptValue: |
199 case MessageEvent::DataTypeSerializedScriptValue: | 199 case MessageEvent::DataTypeSerializedScriptValue: |
200 break; | 200 break; |
201 case MessageEvent::DataTypeString: | 201 case MessageEvent::DataTypeString: |
202 V8HiddenValue::setHiddenValue(isolate, wrapper, V8HiddenValue::stringDat
a(isolate), v8String(isolate, dataAsString())); | 202 V8HiddenValue::setHiddenValue(isolate, wrapper, V8HiddenValue::stringDat
a(isolate), v8String(isolate, dataAsString())); |
203 break; | 203 break; |
204 case MessageEvent::DataTypeBlob: | 204 case MessageEvent::DataTypeBlob: |
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 |