Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: Source/bindings/tests/results/V8TestInterface.cpp

Issue 457483002: Blink-in-JS: Support partial interfaces in private scripts Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "config.h" 7 #include "config.h"
8 #if ENABLE(CONDITION) 8 #if ENABLE(CONDITION)
9 #include "V8TestInterface.h" 9 #include "V8TestInterface.h"
10 10
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/ScriptValue.h" 13 #include "bindings/core/v8/ScriptValue.h"
13 #include "bindings/core/v8/V8AbstractEventListener.h" 14 #include "bindings/core/v8/V8AbstractEventListener.h"
14 #include "bindings/core/v8/V8DOMConfiguration.h" 15 #include "bindings/core/v8/V8DOMConfiguration.h"
15 #include "bindings/core/v8/V8EventListenerList.h" 16 #include "bindings/core/v8/V8EventListenerList.h"
16 #include "bindings/core/v8/V8HiddenValue.h" 17 #include "bindings/core/v8/V8HiddenValue.h"
17 #include "bindings/core/v8/V8ObjectConstructor.h" 18 #include "bindings/core/v8/V8ObjectConstructor.h"
18 #include "bindings/tests/idls/TestImplements2.h" 19 #include "bindings/tests/idls/TestImplements2.h"
19 #include "bindings/tests/idls/TestImplements3Implementation.h" 20 #include "bindings/tests/idls/TestImplements3Implementation.h"
20 #include "bindings/tests/idls/TestPartialInterface.h" 21 #include "bindings/tests/idls/TestPartialInterface.h"
21 #include "bindings/tests/idls/TestPartialInterfaceImplementation.h" 22 #include "bindings/tests/idls/TestPartialInterfaceImplementation.h"
22 #include "bindings/tests/v8/V8Node.h" 23 #include "bindings/tests/v8/V8Node.h"
23 #include "bindings/tests/v8/V8TestInterface.h" 24 #include "bindings/tests/v8/V8TestInterface.h"
24 #include "bindings/tests/v8/V8TestInterfaceEmpty.h" 25 #include "bindings/tests/v8/V8TestInterfaceEmpty.h"
25 #include "core/dom/ContextFeatures.h" 26 #include "core/dom/ContextFeatures.h"
26 #include "core/dom/Document.h" 27 #include "core/dom/Document.h"
28 #include "core/frame/LocalFrame.h"
27 #include "platform/RuntimeEnabledFeatures.h" 29 #include "platform/RuntimeEnabledFeatures.h"
30 #include "platform/ScriptForbiddenScope.h"
28 #include "platform/TraceEvent.h" 31 #include "platform/TraceEvent.h"
29 #include "wtf/GetPtr.h" 32 #include "wtf/GetPtr.h"
30 #include "wtf/RefPtr.h" 33 #include "wtf/RefPtr.h"
31 34
32 namespace blink { 35 namespace blink {
33 36
34 static void initializeScriptWrappableForInterface(TestInterfaceImplementation* o bject) 37 static void initializeScriptWrappableForInterface(TestInterfaceImplementation* o bject)
35 { 38 {
36 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) 39 if (ScriptWrappable::wrapperCanBeStoredInObject(object))
37 ScriptWrappable::fromObject(object)->setTypeInfo(&V8TestInterface::wrapp erTypeInfo); 40 ScriptWrappable::fromObject(object)->setTypeInfo(&V8TestInterface::wrapp erTypeInfo);
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 712
710 #if ENABLE(PARTIAL_CONDITION) 713 #if ENABLE(PARTIAL_CONDITION)
711 static void partialPartialEnumTypeAttributeAttributeSetterCallback(v8::Local<v8: :String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& in fo) 714 static void partialPartialEnumTypeAttributeAttributeSetterCallback(v8::Local<v8: :String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& in fo)
712 { 715 {
713 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 716 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
714 TestInterfaceImplementationV8Internal::partialPartialEnumTypeAttributeAttrib uteSetter(v8Value, info); 717 TestInterfaceImplementationV8Internal::partialPartialEnumTypeAttributeAttrib uteSetter(v8Value, info);
715 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 718 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
716 } 719 }
717 #endif // ENABLE(PARTIAL_CONDITION) 720 #endif // ENABLE(PARTIAL_CONDITION)
718 721
722 #if ENABLE(PARTIAL_CONDITION)
723 static void stringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Va lue>& info)
724 {
725 v8::Handle<v8::Object> holder = info.Holder();
726 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
727 String result;
728 if (!V8TestInterface::stringAttributeAttributeGetterImplementedInPrivateScri pt(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, &result))
729 return;
730 v8SetReturnValueString(info, result, info.GetIsolate());
731 }
732 #endif // ENABLE(PARTIAL_CONDITION)
733
734 #if ENABLE(PARTIAL_CONDITION)
735 static void stringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
736 {
737 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
738 TestInterfaceImplementationV8Internal::stringAttributeAttributeGetter(info);
739 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
740 }
741 #endif // ENABLE(PARTIAL_CONDITION)
742
743 #if ENABLE(PARTIAL_CONDITION)
744 static void stringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v 8::PropertyCallbackInfo<void>& info)
745 {
746 v8::Handle<v8::Object> holder = info.Holder();
747 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
748 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value);
749 V8TestInterface::stringAttributeAttributeSetterImplementedInPrivateScript(to FrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, cppValue);
750 }
751 #endif // ENABLE(PARTIAL_CONDITION)
752
753 #if ENABLE(PARTIAL_CONDITION)
754 static void stringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Lo cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
755 {
756 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
757 TestInterfaceImplementationV8Internal::stringAttributeAttributeSetter(v8Valu e, info);
758 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
759 }
760 #endif // ENABLE(PARTIAL_CONDITION)
761
719 static void partial2LongAttributeAttributeGetter(const v8::PropertyCallbackInfo< v8::Value>& info) 762 static void partial2LongAttributeAttributeGetter(const v8::PropertyCallbackInfo< v8::Value>& info)
720 { 763 {
721 v8::Handle<v8::Object> holder = info.Holder(); 764 v8::Handle<v8::Object> holder = info.Holder();
722 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); 765 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
723 v8SetReturnValueInt(info, TestPartialInterfaceImplementation::partial2LongAt tribute(*impl)); 766 v8SetReturnValueInt(info, TestPartialInterfaceImplementation::partial2LongAt tribute(*impl));
724 } 767 }
725 768
726 static void partial2LongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 769 static void partial2LongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
727 { 770 {
728 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 771 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 1158
1116 #if ENABLE(PARTIAL_CONDITION) 1159 #if ENABLE(PARTIAL_CONDITION)
1117 static void partialVoidMethodPartialCallbackTypeArgMethodCallback(const v8::Func tionCallbackInfo<v8::Value>& info) 1160 static void partialVoidMethodPartialCallbackTypeArgMethodCallback(const v8::Func tionCallbackInfo<v8::Value>& info)
1118 { 1161 {
1119 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 1162 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
1120 TestInterfaceImplementationV8Internal::partialVoidMethodPartialCallbackTypeA rgMethod(info); 1163 TestInterfaceImplementationV8Internal::partialVoidMethodPartialCallbackTypeA rgMethod(info);
1121 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1164 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
1122 } 1165 }
1123 #endif // ENABLE(PARTIAL_CONDITION) 1166 #endif // ENABLE(PARTIAL_CONDITION)
1124 1167
1168 #if ENABLE(PARTIAL_CONDITION)
1169 static void shortMethodWithShortArgumentImplementedInPrivateScriptMethod(const v 8::FunctionCallbackInfo<v8::Value>& info)
1170 {
1171 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod WithShortArgumentImplementedInPrivateScript", "TestInterface", info.Holder(), in fo.GetIsolate());
1172 if (UNLIKELY(info.Length() < 1)) {
1173 throwMinimumArityTypeError(exceptionState, 1, info.Length());
1174 return;
1175 }
1176 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ;
1177 int value;
1178 {
1179 v8::TryCatch block;
1180 V8RethrowTryCatchScope rethrow(block);
1181 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(value, toInt16(info[0], exceptionS tate), exceptionState);
1182 }
1183 int result = 0;
1184 if (!V8TestInterface::shortMethodWithShortArgumentImplementedInPrivateScript MethodImplementedInPrivateScript(toFrameIfNotDetached(info.GetIsolate()->GetCurr entContext()), impl, value, &result))
1185 return;
1186 v8SetReturnValueInt(info, result);
1187 }
1188 #endif // ENABLE(PARTIAL_CONDITION)
1189
1190 #if ENABLE(PARTIAL_CONDITION)
1191 static void shortMethodWithShortArgumentImplementedInPrivateScriptMethodCallback (const v8::FunctionCallbackInfo<v8::Value>& info)
1192 {
1193 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
1194 TestInterfaceImplementationV8Internal::shortMethodWithShortArgumentImplement edInPrivateScriptMethod(info);
1195 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
1196 }
1197 #endif // ENABLE(PARTIAL_CONDITION)
1198
1125 static void partial2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 1199 static void partial2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
1126 { 1200 {
1127 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ; 1201 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ;
1128 TestPartialInterfaceImplementation::partial2VoidMethod(*impl); 1202 TestPartialInterfaceImplementation::partial2VoidMethod(*impl);
1129 } 1203 }
1130 1204
1131 static void partial2VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& info) 1205 static void partial2VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& info)
1132 { 1206 {
1133 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 1207 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
1134 TestInterfaceImplementationV8Internal::partial2VoidMethodMethod(info); 1208 TestInterfaceImplementationV8Internal::partial2VoidMethodMethod(info);
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate , attributeConfiguration, isolate); 1465 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate , attributeConfiguration, isolate);
1392 } 1466 }
1393 #endif // ENABLE(PARTIAL_CONDITION) 1467 #endif // ENABLE(PARTIAL_CONDITION)
1394 #if ENABLE(PARTIAL_CONDITION) 1468 #if ENABLE(PARTIAL_CONDITION)
1395 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) { 1469 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) {
1396 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\ 1470 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\
1397 {"partialPartialEnumTypeAttribute", TestInterfaceImplementationV8Interna l::partialPartialEnumTypeAttributeAttributeGetterCallback, TestInterfaceImplemen tationV8Internal::partialPartialEnumTypeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribut e>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnIns tance}; 1471 {"partialPartialEnumTypeAttribute", TestInterfaceImplementationV8Interna l::partialPartialEnumTypeAttributeAttributeGetterCallback, TestInterfaceImplemen tationV8Internal::partialPartialEnumTypeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribut e>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnIns tance};
1398 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate , attributeConfiguration, isolate); 1472 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate , attributeConfiguration, isolate);
1399 } 1473 }
1400 #endif // ENABLE(PARTIAL_CONDITION) 1474 #endif // ENABLE(PARTIAL_CONDITION)
1475 #if ENABLE(PARTIAL_CONDITION)
1476 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) {
1477 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\
1478 {"stringAttribute", TestInterfaceImplementationV8Internal::stringAttribu teAttributeGetterCallback, TestInterfaceImplementationV8Internal::stringAttribut eAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllSc ripts, V8DOMConfiguration::OnInstance};
1479 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate , attributeConfiguration, isolate);
1480 }
1481 #endif // ENABLE(PARTIAL_CONDITION)
1401 static const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceConsta nts[] = { 1482 static const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceConsta nts[] = {
1402 {"UNSIGNED_LONG", 0, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedLong} , 1483 {"UNSIGNED_LONG", 0, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedLong} ,
1403 {"CONST_JAVASCRIPT", 1, 0, 0, V8DOMConfiguration::ConstantTypeShort}, 1484 {"CONST_JAVASCRIPT", 1, 0, 0, V8DOMConfiguration::ConstantTypeShort},
1404 {"IMPLEMENTS_CONSTANT_1", 1, 0, 0, V8DOMConfiguration::ConstantTypeUnsig nedShort}, 1485 {"IMPLEMENTS_CONSTANT_1", 1, 0, 0, V8DOMConfiguration::ConstantTypeUnsig nedShort},
1405 {"IMPLEMENTS_CONSTANT_2", 2, 0, 0, V8DOMConfiguration::ConstantTypeUnsig nedShort}, 1486 {"IMPLEMENTS_CONSTANT_2", 2, 0, 0, V8DOMConfiguration::ConstantTypeUnsig nedShort},
1406 {"PARTIAL2_UNSIGNED_SHORT", 0, 0, 0, V8DOMConfiguration::ConstantTypeUns ignedShort}, 1487 {"PARTIAL2_UNSIGNED_SHORT", 0, 0, 0, V8DOMConfiguration::ConstantTypeUns ignedShort},
1407 }; 1488 };
1408 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8 TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants), isolate); 1489 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8 TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants), isolate);
1409 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) { 1490 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) {
1410 static const V8DOMConfiguration::ConstantConfiguration constantConfigura tion = {"PARTIAL_UNSIGNED_SHORT", 0, 0, 0, V8DOMConfiguration::ConstantTypeUnsig nedShort}; 1491 static const V8DOMConfiguration::ConstantConfiguration constantConfigura tion = {"PARTIAL_UNSIGNED_SHORT", 0, 0, 0, V8DOMConfiguration::ConstantTypeUnsig nedShort};
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1460 } 1541 }
1461 #endif // ENABLE(PARTIAL_CONDITION) 1542 #endif // ENABLE(PARTIAL_CONDITION)
1462 #if ENABLE(PARTIAL_CONDITION) 1543 #if ENABLE(PARTIAL_CONDITION)
1463 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) { 1544 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) {
1464 static const V8DOMConfiguration::MethodConfiguration partialVoidMethodPa rtialCallbackTypeArgMethodConfiguration = { 1545 static const V8DOMConfiguration::MethodConfiguration partialVoidMethodPa rtialCallbackTypeArgMethodConfiguration = {
1465 "partialVoidMethodPartialCallbackTypeArg", TestInterfaceImplementati onV8Internal::partialVoidMethodPartialCallbackTypeArgMethodCallback, 0, 1, V8DOM Configuration::ExposedToAllScripts, 1546 "partialVoidMethodPartialCallbackTypeArg", TestInterfaceImplementati onV8Internal::partialVoidMethodPartialCallbackTypeArgMethodCallback, 0, 1, V8DOM Configuration::ExposedToAllScripts,
1466 }; 1547 };
1467 V8DOMConfiguration::installMethod(prototypeTemplate, defaultSignature, v 8::None, partialVoidMethodPartialCallbackTypeArgMethodConfiguration, isolate); 1548 V8DOMConfiguration::installMethod(prototypeTemplate, defaultSignature, v 8::None, partialVoidMethodPartialCallbackTypeArgMethodConfiguration, isolate);
1468 } 1549 }
1469 #endif // ENABLE(PARTIAL_CONDITION) 1550 #endif // ENABLE(PARTIAL_CONDITION)
1551 #if ENABLE(PARTIAL_CONDITION)
1552 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) {
1553 static const V8DOMConfiguration::MethodConfiguration shortMethodWithShor tArgumentImplementedInPrivateScriptMethodConfiguration = {
1554 "shortMethodWithShortArgumentImplementedInPrivateScript", TestInterf aceImplementationV8Internal::shortMethodWithShortArgumentImplementedInPrivateScr iptMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts,
1555 };
1556 V8DOMConfiguration::installMethod(prototypeTemplate, defaultSignature, v 8::None, shortMethodWithShortArgumentImplementedInPrivateScriptMethodConfigurati on, isolate);
1557 }
1558 #endif // ENABLE(PARTIAL_CONDITION)
1470 static const V8DOMConfiguration::MethodConfiguration toStringMethodConfigura tion = { 1559 static const V8DOMConfiguration::MethodConfiguration toStringMethodConfigura tion = {
1471 "toString", TestInterfaceImplementationV8Internal::toStringMethodCallbac k, 0, 0, V8DOMConfiguration::ExposedToAllScripts, 1560 "toString", TestInterfaceImplementationV8Internal::toStringMethodCallbac k, 0, 0, V8DOMConfiguration::ExposedToAllScripts,
1472 }; 1561 };
1473 V8DOMConfiguration::installMethod(prototypeTemplate, defaultSignature, stati c_cast<v8::PropertyAttribute>(v8::DontDelete | v8::DontEnum), toStringMethodConf iguration, isolate); 1562 V8DOMConfiguration::installMethod(prototypeTemplate, defaultSignature, stati c_cast<v8::PropertyAttribute>(v8::DontDelete | v8::DontEnum), toStringMethodConf iguration, isolate);
1474 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "staticStrin gAttribute"), TestInterfaceImplementationV8Internal::staticStringAttributeAttrib uteGetterCallback, TestInterfaceImplementationV8Internal::staticStringAttributeA ttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyA ttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::Access Control>(v8::DEFAULT)); 1563 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "staticStrin gAttribute"), TestInterfaceImplementationV8Internal::staticStringAttributeAttrib uteGetterCallback, TestInterfaceImplementationV8Internal::staticStringAttributeA ttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyA ttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::Access Control>(v8::DEFAULT));
1475 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsS taticReadOnlyLongAttribute"), TestInterfaceImplementationV8Internal::implementsS taticReadOnlyLongAttributeAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignat ure>(), static_cast<v8::AccessControl>(v8::DEFAULT)); 1564 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsS taticReadOnlyLongAttribute"), TestInterfaceImplementationV8Internal::implementsS taticReadOnlyLongAttributeAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignat ure>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1476 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsS taticStringAttribute"), TestInterfaceImplementationV8Internal::implementsStaticS tringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::im plementsStaticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignat ure>(), static_cast<v8::AccessControl>(v8::DEFAULT)); 1565 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsS taticStringAttribute"), TestInterfaceImplementationV8Internal::implementsStaticS tringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::im plementsStaticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignat ure>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1477 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implements2 StaticStringAttribute"), TestInterfaceImplementationV8Internal::implements2Stati cStringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal:: implements2StaticStringAttributeAttributeSetterCallback, v8::External::New(isola te, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSig nature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); 1566 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implements2 StaticStringAttribute"), TestInterfaceImplementationV8Internal::implements2Stati cStringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal:: implements2StaticStringAttributeAttributeSetterCallback, v8::External::New(isola te, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSig nature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1478 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implements3 StaticStringAttribute"), TestInterfaceImplementationV8Internal::implements3Stati cStringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal:: implements3StaticStringAttributeAttributeSetterCallback, v8::External::New(isola te, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSig nature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); 1567 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implements3 StaticStringAttribute"), TestInterfaceImplementationV8Internal::implements3Stati cStringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal:: implements3StaticStringAttributeAttributeSetterCallback, v8::External::New(isola te, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSig nature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1479 #if ENABLE(PARTIAL_CONDITION) 1568 #if ENABLE(PARTIAL_CONDITION)
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1550 { 1639 {
1551 fromInternalPointer(object)->deref(); 1640 fromInternalPointer(object)->deref();
1552 } 1641 }
1553 1642
1554 template<> 1643 template<>
1555 v8::Handle<v8::Value> toV8NoInline(TestInterfaceImplementation* impl, v8::Handle <v8::Object> creationContext, v8::Isolate* isolate) 1644 v8::Handle<v8::Value> toV8NoInline(TestInterfaceImplementation* impl, v8::Handle <v8::Object> creationContext, v8::Isolate* isolate)
1556 { 1645 {
1557 return toV8(impl, creationContext, isolate); 1646 return toV8(impl, creationContext, isolate);
1558 } 1647 }
1559 1648
1649 bool V8TestInterface::shortMethodWithShortArgumentImplementedInPrivateScriptMeth odImplementedInPrivateScript(LocalFrame* frame, TestInterface* holderImpl, int v alue, int* result)
1650 {
1651 if (!frame)
1652 return false;
1653 v8::HandleScope handleScope(toIsolate(frame));
1654 ScriptForbiddenScope::AllowUserAgentScript script;
1655 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld());
1656 if (context.IsEmpty())
1657 return false;
1658 ScriptState* scriptState = ScriptState::from(context);
1659 if (!scriptState->executionContext())
1660 return false;
1661
1662 ScriptState::Scope scope(scriptState);
1663 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
1664
1665 v8::Handle<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value);
1666 v8::Handle<v8::Value> argv[] = { valueHandle };
1667 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod WithShortArgumentImplementedInPrivateScript", "TestInterfaceImplementation", scr iptState->context()->Global(), scriptState->isolate());
1668 v8::TryCatch block;
1669 V8RethrowTryCatchScope rethrow(block);
1670 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestInterfaceImplementation", "shortMethodWithShortArgumentImplementedInPriv ateScript", holder, 1, argv);
1671 if (block.HasCaught()) {
1672 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
1673 // FIXME: We should support exceptions other than DOM exceptions.
1674 RELEASE_ASSERT_NOT_REACHED();
1675 }
1676 return false;
1677 }
1678 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta te), exceptionState, false);
1679 RELEASE_ASSERT(!exceptionState.hadException());
1680 *result = cppValue;
1681 return true;
1682 }
1683
1684 bool V8TestInterface::stringAttributeAttributeGetterImplementedInPrivateScript(L ocalFrame* frame, TestInterfaceImplementation* holderImpl, String* result)
1685 {
1686 if (!frame)
1687 return false;
1688 v8::HandleScope handleScope(toIsolate(frame));
1689 ScriptForbiddenScope::AllowUserAgentScript script;
1690 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld());
1691 if (context.IsEmpty())
1692 return false;
1693 ScriptState* scriptState = ScriptState::from(context);
1694 if (!scriptState->executionContext())
1695 return false;
1696
1697 ScriptState::Scope scope(scriptState);
1698 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
1699
1700 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribut e", "TestInterfaceImplementation", scriptState->context()->Global(), scriptState ->isolate());
1701 v8::TryCatch block;
1702 V8RethrowTryCatchScope rethrow(block);
1703 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s criptState, "TestInterfaceImplementation", "stringAttribute", holder);
1704 if (block.HasCaught()) {
1705 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
1706 // FIXME: We should support exceptions other than DOM exceptions.
1707 RELEASE_ASSERT_NOT_REACHED();
1708 }
1709 return false;
1710 }
1711 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false);
1712 RELEASE_ASSERT(!exceptionState.hadException());
1713 *result = cppValue;
1714 return true;
1715 }
1716
1717 bool V8TestInterface::stringAttributeAttributeSetterImplementedInPrivateScript(L ocalFrame* frame, TestInterfaceImplementation* holderImpl, String cppValue)
1718 {
1719 if (!frame)
1720 return false;
1721 v8::HandleScope handleScope(toIsolate(frame));
1722 ScriptForbiddenScope::AllowUserAgentScript script;
1723 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld());
1724 if (context.IsEmpty())
1725 return false;
1726 ScriptState* scriptState = ScriptState::from(context);
1727 if (!scriptState->executionContext())
1728 return false;
1729
1730 ScriptState::Scope scope(scriptState);
1731 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
1732
1733 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut e", "TestInterfaceImplementation", scriptState->context()->Global(), scriptState ->isolate());
1734 v8::TryCatch block;
1735 V8RethrowTryCatchScope rethrow(block);
1736 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestInterfaceImplem entation", "stringAttribute", holder, v8String(scriptState->isolate(), cppValue) );
1737 if (block.HasCaught()) {
1738 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
1739 // FIXME: We should support exceptions other than DOM exceptions.
1740 RELEASE_ASSERT_NOT_REACHED();
1741 }
1742 return false;
1743 }
1744 return true;
1745 }
1746
1560 } // namespace blink 1747 } // namespace blink
1561 #endif // ENABLE(CONDITION) 1748 #endif // ENABLE(CONDITION)
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface.h ('k') | Source/build/scripts/make_private_script_source.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698