fbd40f3ea0758bfa633c9fef8b3251c55eea41f4
[WebKit-https.git] / Source / WebCore / bindings / scripts / test / V8 / V8TestActiveDOMObject.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 V8TestActiveDOMObject_h
22 #define V8TestActiveDOMObject_h
23
24 #include "TestActiveDOMObject.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 V8TestActiveDOMObject {
34 public:
35     static const bool hasDependentLifetime = false;
36     static bool HasInstance(v8::Handle<v8::Value>);
37     static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
38     static v8::Persistent<v8::FunctionTemplate> GetTemplate();
39     static TestActiveDOMObject* toNative(v8::Handle<v8::Object> object)
40     {
41         return reinterpret_cast<TestActiveDOMObject*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
42     }
43     inline static v8::Handle<v8::Object> wrap(TestActiveDOMObject*);
44     static void derefObject(void*);
45     static WrapperTypeInfo info;
46     static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
47     static bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType, v8::Local<v8::Value> data);
48     static bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType, v8::Local<v8::Value> data);
49 private:
50     static v8::Handle<v8::Object> wrapSlow(TestActiveDOMObject*);
51 };
52
53 v8::Handle<v8::Object> V8TestActiveDOMObject::wrap(TestActiveDOMObject* impl)
54 {
55         v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
56         if (!wrapper.IsEmpty())
57             return wrapper;
58     return V8TestActiveDOMObject::wrapSlow(impl);
59 }
60
61 inline v8::Handle<v8::Value> toV8(TestActiveDOMObject* impl)
62 {
63     if (!impl)
64         return v8::Null();
65     return V8TestActiveDOMObject::wrap(impl);
66 }
67 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestActiveDOMObject > impl)
68 {
69     return toV8(impl.get());
70 }
71
72 }
73
74 #endif // V8TestActiveDOMObject_h