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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 RefPtr<SerializedScriptValue> message = SerializedScriptValue::serialize( | 282 RefPtr<SerializedScriptValue> message = SerializedScriptValue::serialize( |
283 info.GetIsolate(), info[0], &transferables, nullptr, exceptionState); | 283 info.GetIsolate(), info[0], &transferables, nullptr, exceptionState); |
284 if (exceptionState.hadException()) | 284 if (exceptionState.hadException()) |
285 return; | 285 return; |
286 | 286 |
| 287 message->prepareForTransferringContext(); |
287 window->postMessage(message.get(), transferables.messagePorts, targetOrigin, | 288 window->postMessage(message.get(), transferables.messagePorts, targetOrigin, |
288 source, exceptionState); | 289 source, exceptionState); |
289 message->unregisterMemoryAllocatedByCurrentScriptContext(); | 290 message->finalizeTransferringContext(); |
290 } | 291 } |
291 | 292 |
292 void V8Window::openMethodCustom( | 293 void V8Window::openMethodCustom( |
293 const v8::FunctionCallbackInfo<v8::Value>& info) { | 294 const v8::FunctionCallbackInfo<v8::Value>& info) { |
294 DOMWindow* impl = V8Window::toImpl(info.Holder()); | 295 DOMWindow* impl = V8Window::toImpl(info.Holder()); |
295 ExceptionState exceptionState( | 296 ExceptionState exceptionState( |
296 info.GetIsolate(), ExceptionState::ExecutionContext, "Window", "open"); | 297 info.GetIsolate(), ExceptionState::ExecutionContext, "Window", "open"); |
297 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), | 298 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), |
298 impl, exceptionState)) { | 299 impl, exceptionState)) { |
299 return; | 300 return; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 if (items->hasExactlyOneItem()) { | 394 if (items->hasExactlyOneItem()) { |
394 v8SetReturnValueFast(info, items->item(0), window); | 395 v8SetReturnValueFast(info, items->item(0), window); |
395 return; | 396 return; |
396 } | 397 } |
397 v8SetReturnValueFast(info, items, window); | 398 v8SetReturnValueFast(info, items, window); |
398 return; | 399 return; |
399 } | 400 } |
400 } | 401 } |
401 | 402 |
402 } // namespace blink | 403 } // namespace blink |
OLD | NEW |