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
3 // found in the LICENSE file.
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
7 #ifndef V8TestInterface_h
8 #define V8TestInterface_h
11 #include "bindings/core/v8/ScriptWrappable.h"
12 #include "bindings/core/v8/V8Binding.h"
13 #include "bindings/core/v8/V8DOMWrapper.h"
14 #include "bindings/core/v8/V8TestInterfaceEmpty.h"
15 #include "bindings/core/v8/WrapperTypeInfo.h"
16 #include "bindings/tests/idls/core/TestInterfaceImplementation.h"
17 #include "platform/heap/Handle.h"
21 class V8TestInterface {
25 static bool shortMethodWithShortArgumentImplementedInPrivateScriptMethod(LocalFrame* frame, TestInterface* holderImpl, int value, int* result);
26 static bool stringAttributeAttributeGetter(LocalFrame* frame, TestInterfaceImplementation* holderImpl, String* result);
27 static bool stringAttributeAttributeSetter(LocalFrame* frame, TestInterfaceImplementation* holderImpl, String cppValue);
30 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*);
31 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Value>, v8::Isolate*);
32 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*);
33 static TestInterfaceImplementation* toImpl(v8::Handle<v8::Object> object)
35 return blink::toScriptWrappableBase(object)->toImpl<TestInterfaceImplementation>();
37 static TestInterfaceImplementation* toImplWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>);
38 static WrapperTypeInfo wrapperTypeInfo;
39 static void refObject(ScriptWrappableBase*);
40 static void derefObject(ScriptWrappableBase*);
41 static void trace(Visitor* visitor, ScriptWrappableBase* scriptWrappableBase)
44 static void visitDOMWrapper(v8::Isolate*, ScriptWrappableBase*, const v8::Persistent<v8::Object>&);
45 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);
46 static void implementsCustomVoidMethodMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&);
47 static void legacyCallCustom(const v8::FunctionCallbackInfo<v8::Value>&);
48 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
49 static inline ScriptWrappableBase* toScriptWrappableBase(TestInterfaceImplementation* impl)
51 return impl->toScriptWrappableBase();
53 static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, v8::Isolate*);
54 static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*);
55 static void updateWrapperTypeInfo(InstallTemplateFunction, InstallConditionallyEnabledMethodsFunction);
56 static void installV8TestInterfaceTemplate(v8::Handle<v8::FunctionTemplate>, v8::Isolate*);
57 static void registerVoidMethodPartialOverloadMethodForPartialInterface(void (*)(const v8::FunctionCallbackInfo<v8::Value>&));
58 static void registerStaticVoidMethodPartialOverloadMethodForPartialInterface(void (*)(const v8::FunctionCallbackInfo<v8::Value>&));
59 static void registerPromiseMethodPartialOverloadMethodForPartialInterface(void (*)(const v8::FunctionCallbackInfo<v8::Value>&));
60 static void registerStaticPromiseMethodPartialOverloadMethodForPartialInterface(void (*)(const v8::FunctionCallbackInfo<v8::Value>&));
61 static void registerPartial2VoidMethodMethodForPartialInterface(void (*)(const v8::FunctionCallbackInfo<v8::Value>&));
62 static void registerPartial2StaticVoidMethodMethodForPartialInterface(void (*)(const v8::FunctionCallbackInfo<v8::Value>&));
65 static InstallTemplateFunction installV8TestInterfaceTemplateFunction;
68 v8::Handle<v8::Value> toV8(TestInterfaceImplementation*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
70 template<typename CallbackInfo>
71 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceImplementation* impl)
73 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
76 template<typename CallbackInfo>
77 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterfaceImplementation* impl)
79 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
82 template<typename CallbackInfo>
83 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterfaceImplementation* impl, const ScriptWrappable*)
85 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
89 #endif // ENABLE(CONDITION)
91 #endif // V8TestInterface_h