| 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 20 matching lines...) Expand all Loading... |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "bindings/core/v8/V8Window.h" | 32 #include "bindings/core/v8/V8Window.h" |
| 33 | 33 |
| 34 #include "bindings/core/v8/BindingSecurity.h" | 34 #include "bindings/core/v8/BindingSecurity.h" |
| 35 #include "bindings/core/v8/ExceptionMessages.h" | 35 #include "bindings/core/v8/ExceptionMessages.h" |
| 36 #include "bindings/core/v8/ExceptionState.h" | 36 #include "bindings/core/v8/ExceptionState.h" |
| 37 #include "bindings/core/v8/ScheduledAction.h" | 37 #include "bindings/core/v8/ScheduledAction.h" |
| 38 #include "bindings/core/v8/ScriptController.h" | 38 #include "bindings/core/v8/ScriptController.h" |
| 39 #include "bindings/core/v8/ScriptSourceCode.h" | 39 #include "bindings/core/v8/ScriptSourceCode.h" |
| 40 #include "bindings/core/v8/SerializedScriptValue.h" | 40 #include "bindings/core/v8/SerializedScriptValue.h" |
| 41 #include "bindings/core/v8/SerializedScriptValueFactory.h" |
| 41 #include "bindings/core/v8/V8Binding.h" | 42 #include "bindings/core/v8/V8Binding.h" |
| 42 #include "bindings/core/v8/V8EventListener.h" | 43 #include "bindings/core/v8/V8EventListener.h" |
| 43 #include "bindings/core/v8/V8EventListenerList.h" | 44 #include "bindings/core/v8/V8EventListenerList.h" |
| 44 #include "bindings/core/v8/V8GCForContextDispose.h" | 45 #include "bindings/core/v8/V8GCForContextDispose.h" |
| 45 #include "bindings/core/v8/V8HTMLCollection.h" | 46 #include "bindings/core/v8/V8HTMLCollection.h" |
| 46 #include "bindings/core/v8/V8HiddenValue.h" | 47 #include "bindings/core/v8/V8HiddenValue.h" |
| 47 #include "bindings/core/v8/V8Node.h" | 48 #include "bindings/core/v8/V8Node.h" |
| 48 #include "core/dom/DOMArrayBuffer.h" | 49 #include "core/dom/DOMArrayBuffer.h" |
| 49 #include "core/dom/ExceptionCode.h" | 50 #include "core/dom/ExceptionCode.h" |
| 50 #include "core/dom/MessagePort.h" | 51 #include "core/dom/MessagePort.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 targetOriginArgIndex = 2; | 275 targetOriginArgIndex = 2; |
| 275 transferablesArgIndex = 1; | 276 transferablesArgIndex = 1; |
| 276 } | 277 } |
| 277 if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info
[transferablesArgIndex], transferablesArgIndex, portArray, arrayBufferArray, exc
eptionState)) { | 278 if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info
[transferablesArgIndex], transferablesArgIndex, portArray, arrayBufferArray, exc
eptionState)) { |
| 278 exceptionState.throwIfNeeded(); | 279 exceptionState.throwIfNeeded(); |
| 279 return; | 280 return; |
| 280 } | 281 } |
| 281 } | 282 } |
| 282 TOSTRING_VOID(V8StringResource<TreatNullAndUndefinedAsNullString>, targetOri
gin, info[targetOriginArgIndex]); | 283 TOSTRING_VOID(V8StringResource<TreatNullAndUndefinedAsNullString>, targetOri
gin, info[targetOriginArgIndex]); |
| 283 | 284 |
| 284 RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(info[0
], &portArray, &arrayBufferArray, exceptionState, info.GetIsolate()); | 285 RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instan
ce().create(info[0], &portArray, &arrayBufferArray, exceptionState, info.GetIsol
ate()); |
| 285 if (exceptionState.throwIfNeeded()) | 286 if (exceptionState.throwIfNeeded()) |
| 286 return; | 287 return; |
| 287 | 288 |
| 288 window->postMessage(message.release(), &portArray, targetOrigin, source, exc
eptionState); | 289 window->postMessage(message.release(), &portArray, targetOrigin, source, exc
eptionState); |
| 289 exceptionState.throwIfNeeded(); | 290 exceptionState.throwIfNeeded(); |
| 290 } | 291 } |
| 291 | 292 |
| 292 // FIXME(fqian): returning string is cheating, and we should | 293 // FIXME(fqian): returning string is cheating, and we should |
| 293 // fix this by calling toString function on the receiver. | 294 // fix this by calling toString function on the receiver. |
| 294 // However, V8 implements toString in JavaScript, which requires | 295 // However, V8 implements toString in JavaScript, which requires |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::curren
t(isolate)); | 551 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::curren
t(isolate)); |
| 551 if (context.IsEmpty()) | 552 if (context.IsEmpty()) |
| 552 return v8Undefined(); | 553 return v8Undefined(); |
| 553 | 554 |
| 554 v8::Handle<v8::Object> global = context->Global(); | 555 v8::Handle<v8::Object> global = context->Global(); |
| 555 ASSERT(!global.IsEmpty()); | 556 ASSERT(!global.IsEmpty()); |
| 556 return global; | 557 return global; |
| 557 } | 558 } |
| 558 | 559 |
| 559 } // namespace blink | 560 } // namespace blink |
| OLD | NEW |