OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 info.GetIsolate(), info[transferablesArgIndex], | 272 info.GetIsolate(), info[transferablesArgIndex], |
273 transferablesArgIndex, transferables, exceptionState)) { | 273 transferablesArgIndex, transferables, exceptionState)) { |
274 return; | 274 return; |
275 } | 275 } |
276 } | 276 } |
277 // TODO(foolip): targetOrigin should be a USVString in IDL and treated as | 277 // TODO(foolip): targetOrigin should be a USVString in IDL and treated as |
278 // such here, without TreatNullAndUndefinedAsNullString. | 278 // such here, without TreatNullAndUndefinedAsNullString. |
279 TOSTRING_VOID(V8StringResource<TreatNullAndUndefinedAsNullString>, | 279 TOSTRING_VOID(V8StringResource<TreatNullAndUndefinedAsNullString>, |
280 targetOrigin, info[targetOriginArgIndex]); | 280 targetOrigin, info[targetOriginArgIndex]); |
281 | 281 |
| 282 SerializedScriptValue::SerializeOptions options; |
| 283 options.transferables = &transferables; |
282 RefPtr<SerializedScriptValue> message = SerializedScriptValue::serialize( | 284 RefPtr<SerializedScriptValue> message = SerializedScriptValue::serialize( |
283 info.GetIsolate(), info[0], &transferables, nullptr, exceptionState); | 285 info.GetIsolate(), info[0], options, exceptionState); |
284 if (exceptionState.hadException()) | 286 if (exceptionState.hadException()) |
285 return; | 287 return; |
286 | 288 |
287 message->unregisterMemoryAllocatedWithCurrentScriptContext(); | 289 message->unregisterMemoryAllocatedWithCurrentScriptContext(); |
288 window->postMessage(message.get(), transferables.messagePorts, targetOrigin, | 290 window->postMessage(message.get(), transferables.messagePorts, targetOrigin, |
289 source, exceptionState); | 291 source, exceptionState); |
290 } | 292 } |
291 | 293 |
292 void V8Window::openMethodCustom( | 294 void V8Window::openMethodCustom( |
293 const v8::FunctionCallbackInfo<v8::Value>& info) { | 295 const v8::FunctionCallbackInfo<v8::Value>& info) { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 if (items->hasExactlyOneItem()) { | 403 if (items->hasExactlyOneItem()) { |
402 v8SetReturnValueFast(info, items->item(0), window); | 404 v8SetReturnValueFast(info, items->item(0), window); |
403 return; | 405 return; |
404 } | 406 } |
405 v8SetReturnValueFast(info, items, window); | 407 v8SetReturnValueFast(info, items, window); |
406 return; | 408 return; |
407 } | 409 } |
408 } | 410 } |
409 | 411 |
410 } // namespace blink | 412 } // namespace blink |
OLD | NEW |