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 V8TestSpecialOperations_h
8 #define V8TestSpecialOperations_h
10 #include "bindings/core/v8/ScriptWrappable.h"
11 #include "bindings/core/v8/V8Binding.h"
12 #include "bindings/core/v8/V8DOMWrapper.h"
13 #include "bindings/core/v8/WrapperTypeInfo.h"
14 #include "bindings/tests/idls/TestSpecialOperations.h"
15 #include "platform/heap/Handle.h"
19 class V8TestSpecialOperations {
21 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*);
22 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Value>, v8::Isolate*);
23 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*);
24 static TestSpecialOperations* toNative(v8::Handle<v8::Object> object)
26 return fromInternalPointer(blink::toInternalPointer(object));
28 static TestSpecialOperations* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>);
29 static const WrapperTypeInfo wrapperTypeInfo;
30 static void derefObject(ScriptWrappableBase* internalPointer);
31 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
32 static inline ScriptWrappableBase* toInternalPointer(TestSpecialOperations* impl)
34 return reinterpret_cast<ScriptWrappableBase*>(static_cast<void*>(impl));
37 static inline TestSpecialOperations* fromInternalPointer(ScriptWrappableBase* internalPointer)
39 return reinterpret_cast<TestSpecialOperations*>(static_cast<void*>(internalPointer));
41 static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, v8::Isolate*) { }
42 static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
45 friend v8::Handle<v8::Object> wrap(TestSpecialOperations*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
46 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestSpecialOperations>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
49 v8::Handle<v8::Object> wrap(TestSpecialOperations* impl, v8::Handle<v8::Object> creationContext, v8::Isolate*);
51 inline v8::Handle<v8::Value> toV8(TestSpecialOperations* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
54 return v8::Null(isolate);
55 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestSpecialOperations>(impl, isolate);
56 if (!wrapper.IsEmpty())
58 return wrap(impl, creationContext, isolate);
61 template<typename CallbackInfo>
62 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestSpecialOperations* impl)
64 if (UNLIKELY(!impl)) {
65 v8SetReturnValueNull(callbackInfo);
68 if (DOMDataStore::setReturnValueFromWrapper<V8TestSpecialOperations>(callbackInfo.GetReturnValue(), impl))
70 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
71 v8SetReturnValue(callbackInfo, wrapper);
74 template<typename CallbackInfo>
75 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestSpecialOperations* impl)
77 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld());
78 if (UNLIKELY(!impl)) {
79 v8SetReturnValueNull(callbackInfo);
82 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestSpecialOperations>(callbackInfo.GetReturnValue(), impl))
84 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
85 v8SetReturnValue(callbackInfo, wrapper);
88 template<class CallbackInfo, class Wrappable>
89 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestSpecialOperations* impl, Wrappable* wrappable)
91 if (UNLIKELY(!impl)) {
92 v8SetReturnValueNull(callbackInfo);
95 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestSpecialOperations>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
97 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
98 v8SetReturnValue(callbackInfo, wrapper);
101 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestSpecialOperations> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
103 return toV8(impl.get(), creationContext, isolate);
106 template<class CallbackInfo>
107 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestSpecialOperations> impl)
109 v8SetReturnValue(callbackInfo, impl.get());
112 template<class CallbackInfo>
113 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestSpecialOperations> impl)
115 v8SetReturnValueForMainWorld(callbackInfo, impl.get());
118 template<class CallbackInfo, class Wrappable>
119 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestSpecialOperations> impl, Wrappable* wrappable)
121 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
125 #endif // V8TestSpecialOperations_h