| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
| 6 | 6 |
| 7 #include "V8TestObject.h" | 7 #include "V8TestObject.h" |
| 8 | 8 |
| 9 #include "bindings/core/v8/BindingSecurity.h" | 9 #include "bindings/core/v8/BindingSecurity.h" |
| 10 #include "bindings/core/v8/Dictionary.h" | 10 #include "bindings/core/v8/Dictionary.h" |
| 11 #include "bindings/core/v8/ExceptionState.h" | 11 #include "bindings/core/v8/ExceptionState.h" |
| 12 #include "bindings/core/v8/PrivateScriptRunner.h" | 12 #include "bindings/core/v8/PrivateScriptRunner.h" |
| 13 #include "bindings/core/v8/ScriptCallStack.h" | 13 #include "bindings/core/v8/ScriptCallStack.h" |
| 14 #include "bindings/core/v8/ScriptPromise.h" | 14 #include "bindings/core/v8/ScriptPromise.h" |
| 15 #include "bindings/core/v8/ScriptState.h" | 15 #include "bindings/core/v8/ScriptState.h" |
| 16 #include "bindings/core/v8/ScriptValue.h" | 16 #include "bindings/core/v8/ScriptValue.h" |
| 17 #include "bindings/core/v8/SerializedScriptValue.h" | 17 #include "bindings/core/v8/SerializedScriptValue.h" |
| 18 #include "bindings/core/v8/SerializedScriptValueFactory.h" | 18 #include "bindings/core/v8/SerializedScriptValueFactory.h" |
| 19 #include "bindings/core/v8/TransferableMessagePort.h" | 19 #include "bindings/core/v8/Transferables.h" |
| 20 #include "bindings/core/v8/UnionTypesCore.h" | 20 #include "bindings/core/v8/UnionTypesCore.h" |
| 21 #include "bindings/core/v8/V8AbstractEventListener.h" | 21 #include "bindings/core/v8/V8AbstractEventListener.h" |
| 22 #include "bindings/core/v8/V8ArrayBuffer.h" | 22 #include "bindings/core/v8/V8ArrayBuffer.h" |
| 23 #include "bindings/core/v8/V8ArrayBufferView.h" | 23 #include "bindings/core/v8/V8ArrayBufferView.h" |
| 24 #include "bindings/core/v8/V8Attr.h" | 24 #include "bindings/core/v8/V8Attr.h" |
| 25 #include "bindings/core/v8/V8DOMActivityLogger.h" | 25 #include "bindings/core/v8/V8DOMActivityLogger.h" |
| 26 #include "bindings/core/v8/V8DOMConfiguration.h" | 26 #include "bindings/core/v8/V8DOMConfiguration.h" |
| 27 #include "bindings/core/v8/V8Document.h" | 27 #include "bindings/core/v8/V8Document.h" |
| 28 #include "bindings/core/v8/V8DocumentFragment.h" | 28 #include "bindings/core/v8/V8DocumentFragment.h" |
| 29 #include "bindings/core/v8/V8DocumentType.h" | 29 #include "bindings/core/v8/V8DocumentType.h" |
| (...skipping 10117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10147 } | 10147 } |
| 10148 | 10148 |
| 10149 void postMessageImpl(const char* interfaceName, TestObject* instance, const v8::
FunctionCallbackInfo<v8::Value>& info) | 10149 void postMessageImpl(const char* interfaceName, TestObject* instance, const v8::
FunctionCallbackInfo<v8::Value>& info) |
| 10150 { | 10150 { |
| 10151 ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage
", interfaceName, info.Holder(), info.GetIsolate()); | 10151 ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage
", interfaceName, info.Holder(), info.GetIsolate()); |
| 10152 if (UNLIKELY(info.Length() < 1)) { | 10152 if (UNLIKELY(info.Length() < 1)) { |
| 10153 setMinimumArityTypeError(exceptionState, 1, info.Length()); | 10153 setMinimumArityTypeError(exceptionState, 1, info.Length()); |
| 10154 exceptionState.throwIfNeeded(); | 10154 exceptionState.throwIfNeeded(); |
| 10155 return; | 10155 return; |
| 10156 } | 10156 } |
| 10157 TransferableArray* transferables = new TransferableArray; | 10157 Transferables transferables; |
| 10158 if (info.Length() > 1) { | 10158 if (info.Length() > 1) { |
| 10159 const int transferablesArgIndex = 1; | 10159 const int transferablesArgIndex = 1; |
| 10160 if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info
[transferablesArgIndex], transferablesArgIndex, *transferables, exceptionState))
{ | 10160 if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info
[transferablesArgIndex], transferablesArgIndex, transferables, exceptionState))
{ |
| 10161 exceptionState.throwIfNeeded(); | 10161 exceptionState.throwIfNeeded(); |
| 10162 return; | 10162 return; |
| 10163 } | 10163 } |
| 10164 } | 10164 } |
| 10165 RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instan
ce().create(info.GetIsolate(), info[0], transferables, exceptionState); | 10165 RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instan
ce().create(info.GetIsolate(), info[0], &transferables, exceptionState); |
| 10166 if (exceptionState.throwIfNeeded()) | 10166 if (exceptionState.throwIfNeeded()) |
| 10167 return; | 10167 return; |
| 10168 // FIXME: Only pass context/exceptionState if instance really requires it. | 10168 // FIXME: Only pass context/exceptionState if instance really requires it. |
| 10169 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); | 10169 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); |
| 10170 MessagePortArray* ports; | 10170 instance->postMessage(context, message.release(), transferables.messagePorts
, exceptionState); |
| 10171 if (auto* messagePorts = TransferableMessagePort::get(*transferables)) | |
| 10172 ports = &(messagePorts->getArray()); | |
| 10173 else | |
| 10174 ports = new MessagePortArray; | |
| 10175 instance->postMessage(context, message.release(), ports, exceptionState); | |
| 10176 exceptionState.throwIfNeeded(); | 10171 exceptionState.throwIfNeeded(); |
| 10177 } | 10172 } |
| 10178 | 10173 |
| 10179 static void postMessageMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | 10174 static void postMessageMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 10180 { | 10175 { |
| 10181 postMessageImpl("TestObject", V8TestObject::toImpl(info.Holder()), info); | 10176 postMessageImpl("TestObject", V8TestObject::toImpl(info.Holder()), info); |
| 10182 } | 10177 } |
| 10183 | 10178 |
| 10184 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethod(const v8
::FunctionCallbackInfo<v8::Value>& info) | 10179 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethod(const v8
::FunctionCallbackInfo<v8::Value>& info) |
| 10185 { | 10180 { |
| (...skipping 2383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12569 ScriptState::Scope scope(scriptState); | 12564 ScriptState::Scope scope(scriptState); |
| 12570 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 12565 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 12571 if (holder.IsEmpty()) | 12566 if (holder.IsEmpty()) |
| 12572 return false; | 12567 return false; |
| 12573 | 12568 |
| 12574 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate
Script", "TestObject", scriptState->context()->Global(), scriptState->isolate())
; | 12569 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate
Script", "TestObject", scriptState->context()->Global(), scriptState->isolate())
; |
| 12575 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState->
isolate(), cppValue)); | 12570 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState->
isolate(), cppValue)); |
| 12576 } | 12571 } |
| 12577 | 12572 |
| 12578 } // namespace blink | 12573 } // namespace blink |
| OLD | NEW |