Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / tests / results / core / V8TestInterface.h
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.
4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6
7 #ifndef V8TestInterface_h
8 #define V8TestInterface_h
9
10 #if ENABLE(CONDITION)
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"
18
19 namespace blink {
20
21 class V8TestInterface {
22 public:
23     class PrivateScript {
24     public:
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);
28     };
29
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)
34     {
35         return blink::toScriptWrappableBase(object)->toImpl<TestInterfaceImplementation>();
36     }
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)
42     {
43     }
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)
50     {
51         return impl->toScriptWrappableBase();
52     }
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>&));
63
64 private:
65     static InstallTemplateFunction installV8TestInterfaceTemplateFunction;
66 };
67
68 v8::Handle<v8::Value> toV8(TestInterfaceImplementation*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
69
70 template<typename CallbackInfo>
71 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceImplementation* impl)
72 {
73     v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
74 }
75
76 template<typename CallbackInfo>
77 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterfaceImplementation* impl)
78 {
79      v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
80 }
81
82 template<typename CallbackInfo>
83 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterfaceImplementation* impl, const ScriptWrappable*)
84 {
85      v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
86 }
87
88 } // namespace blink
89 #endif // ENABLE(CONDITION)
90
91 #endif // V8TestInterface_h