437b8660811c5b128a70584e2223e5f116d89fae
[WebKit-https.git] / Source / WebCore / bindings / scripts / test / V8 / V8TestNamedConstructor.h
1 /*
2     This file is part of the WebKit open source project.
3     This file has been generated by generate-bindings.pl. DO NOT MODIFY!
4
5     This library is free software; you can redistribute it and/or
6     modify it under the terms of the GNU Library General Public
7     License as published by the Free Software Foundation; either
8     version 2 of the License, or (at your option) any later version.
9
10     This library is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13     Library General Public License for more details.
14
15     You should have received a copy of the GNU Library General Public License
16     along with this library; see the file COPYING.LIB.  If not, write to
17     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18     Boston, MA 02111-1307, USA.
19 */
20
21 #ifndef V8TestNamedConstructor_h
22 #define V8TestNamedConstructor_h
23
24 #include "TestNamedConstructor.h"
25 #include "V8DOMWrapper.h"
26 #include "WrapperTypeInfo.h"
27 #include <v8.h>
28 #include <wtf/HashMap.h>
29 #include <wtf/text/StringHash.h>
30
31 namespace WebCore {
32
33 class V8TestNamedConstructorConstructor {
34 public:
35     static v8::Persistent<v8::FunctionTemplate> GetTemplate();
36     static WrapperTypeInfo info;
37 };
38
39 class V8TestNamedConstructor {
40 public:
41     static const bool hasDependentLifetime = true;
42     static bool HasInstance(v8::Handle<v8::Value>);
43     static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
44     static v8::Persistent<v8::FunctionTemplate> GetTemplate();
45     static TestNamedConstructor* toNative(v8::Handle<v8::Object> object)
46     {
47         return reinterpret_cast<TestNamedConstructor*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
48     }
49     inline static v8::Handle<v8::Object> wrap(TestNamedConstructor*);
50     static void derefObject(void*);
51     static WrapperTypeInfo info;
52     static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);
53     static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
54 private:
55     static v8::Handle<v8::Object> wrapSlow(TestNamedConstructor*);
56 };
57
58 v8::Handle<v8::Object> V8TestNamedConstructor::wrap(TestNamedConstructor* impl)
59 {
60         v8::Handle<v8::Object> wrapper = getActiveDOMObjectMap().get(impl);
61         if (!wrapper.IsEmpty())
62             return wrapper;
63     return V8TestNamedConstructor::wrapSlow(impl);
64 }
65
66 inline v8::Handle<v8::Value> toV8(TestNamedConstructor* impl)
67 {
68     if (!impl)
69         return v8::Null();
70     return V8TestNamedConstructor::wrap(impl);
71 }
72 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestNamedConstructor > impl)
73 {
74     return toV8(impl.get());
75 }
76
77 }
78
79 #endif // V8TestNamedConstructor_h