-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
#ifndef V8TestInterface_h
#define V8TestInterface_h
-#if ENABLE(Condition1) || ENABLE(Condition2)
-#include "bindings/tests/idls/TestInterface.h"
+#if ENABLE(CONDITION)
+#include "V8TestInterfaceEmpty.h"
+#include "bindings/tests/idls/TestInterfaceImplementation.h"
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8DOMWrapper.h"
#include "bindings/v8/WrapperTypeInfo.h"
-#include "heap/Handle.h"
+#include "platform/heap/Handle.h"
namespace WebCore {
class V8TestInterface {
public:
static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*);
- static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
- static TestInterface* toNative(v8::Handle<v8::Object> object)
+ static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Value>, v8::Isolate*);
+ static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*);
+ static TestInterfaceImplementation* toNative(v8::Handle<v8::Object> object)
{
return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
}
+ static TestInterfaceImplementation* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>);
static const WrapperTypeInfo wrapperTypeInfo;
static void derefObject(void*);
static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Isolate*);
static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);
static void implementsCustomVoidMethodMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&);
-#if ENABLE(CONDITION_PARTIAL)
- static void supplementalMethod3MethodCustom(const v8::FunctionCallbackInfo<v8::Value>&);
-#endif // ENABLE(CONDITION_PARTIAL)
- static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
- static void namedPropertySetterCustom(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&);
+ static void legacyCallCustom(const v8::FunctionCallbackInfo<v8::Value>&);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
- static inline void* toInternalPointer(TestInterface* impl)
+ static inline void* toInternalPointer(TestInterfaceImplementation* impl)
{
- return impl;
+ return V8TestInterfaceEmpty::toInternalPointer(impl);
}
- static inline TestInterface* fromInternalPointer(void* object)
+ static inline TestInterfaceImplementation* fromInternalPointer(void* object)
{
- return static_cast<TestInterface*>(object);
+ return static_cast<TestInterfaceImplementation*>(V8TestInterfaceEmpty::fromInternalPointer(object));
}
- static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestInterface*, v8::Isolate*);
- static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
+ static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestInterfaceImplementation*, v8::Isolate*);
+ static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*);
private:
- friend v8::Handle<v8::Object> wrap(TestInterface*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
- static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterface>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-};
-
-template<>
-class WrapperTypeTraits<TestInterface > {
-public:
- static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterface::wrapperTypeInfo; }
};
-inline v8::Handle<v8::Object> wrap(TestInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
- ASSERT(impl);
- ASSERT(!DOMDataStore::containsWrapper<V8TestInterface>(impl, isolate));
- return V8TestInterface::createWrapper(impl, creationContext, isolate);
-}
-
-inline v8::Handle<v8::Value> toV8(TestInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
- if (UNLIKELY(!impl))
- return v8::Null(isolate);
- v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterface>(impl, isolate);
- if (!wrapper.IsEmpty())
- return wrapper;
- return wrap(impl, creationContext, isolate);
-}
+class TestInterfaceImplementation;
+v8::Handle<v8::Value> toV8(TestInterfaceImplementation*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-template<typename CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterface* impl)
+template<class CallbackInfo>
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceImplementation* impl)
{
- if (UNLIKELY(!impl)) {
- v8SetReturnValueNull(callbackInfo);
- return;
- }
- if (DOMDataStore::setReturnValueFromWrapper<V8TestInterface>(callbackInfo.GetReturnValue(), impl))
- return;
- v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
- v8SetReturnValue(callbackInfo, wrapper);
+ v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
}
-template<typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterface* impl)
+template<class CallbackInfo>
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterfaceImplementation* impl)
{
- ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
- if (UNLIKELY(!impl)) {
- v8SetReturnValueNull(callbackInfo);
- return;
- }
- if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterface>(callbackInfo.GetReturnValue(), impl))
- return;
- v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
- v8SetReturnValue(callbackInfo, wrapper);
+ v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
}
template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface* impl, Wrappable* wrappable)
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterfaceImplementation* impl, Wrappable*)
{
- if (UNLIKELY(!impl)) {
- v8SetReturnValueNull(callbackInfo);
- return;
- }
- if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterface>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
- return;
- v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
- v8SetReturnValue(callbackInfo, wrapper);
+ v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
}
-inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfaceImplementation> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
return toV8(impl.get(), creationContext, isolate);
}
template<class CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestInterface> impl)
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceImplementation> impl)
{
v8SetReturnValue(callbackInfo, impl.get());
}
template<class CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestInterface> impl)
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceImplementation> impl)
{
v8SetReturnValueForMainWorld(callbackInfo, impl.get());
}
template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestInterface> impl, Wrappable* wrappable)
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceImplementation> impl, Wrappable* wrappable)
{
v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
}
}
-#endif // ENABLE(Condition1) || ENABLE(Condition2)
+#endif // ENABLE(CONDITION)
#endif // V8TestInterface_h