~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 "V8Binding.h"
 
26
#include "V8DOMWrapper.h"
 
27
#include "WrapperTypeInfo.h"
 
28
#include <v8.h>
 
29
#include <wtf/HashMap.h>
 
30
#include <wtf/text/StringHash.h>
 
31
 
 
32
namespace WebCore {
 
33
 
 
34
class V8TestActiveDOMObject {
 
35
public:
 
36
    static const bool hasDependentLifetime = false;
 
37
    static bool HasInstance(v8::Handle<v8::Value>);
 
38
    static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
 
39
    static v8::Persistent<v8::FunctionTemplate> GetTemplate();
 
40
    static TestActiveDOMObject* toNative(v8::Handle<v8::Object> object)
 
41
    {
 
42
        return reinterpret_cast<TestActiveDOMObject*>(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
 
43
    }
 
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
    static void installPerContextProperties(v8::Handle<v8::Object>, TestActiveDOMObject*) { }
 
50
    static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { }
 
51
private:
 
52
    friend v8::Handle<v8::Object> wrap(TestActiveDOMObject*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
 
53
    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestActiveDOMObject>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
 
54
};
 
55
 
 
56
 
 
57
inline v8::Handle<v8::Object> wrap(TestActiveDOMObject* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate = 0)
 
58
{
 
59
    ASSERT(impl);
 
60
    ASSERT(DOMDataStore::current(isolate)->get(impl).IsEmpty());
 
61
    return V8TestActiveDOMObject::createWrapper(impl, creationContext, isolate);
 
62
}
 
63
 
 
64
inline v8::Handle<v8::Object> toV8Object(TestActiveDOMObject* impl, v8::Handle<v8::Object> creationContext = v8::Handle<v8::Object>(), v8::Isolate* isolate = 0)
 
65
{
 
66
    if (UNLIKELY(!impl))
 
67
        return v8::Handle<v8::Object>();
 
68
    v8::Handle<v8::Object> wrapper = DOMDataStore::current(isolate)->get(impl);
 
69
    if (!wrapper.IsEmpty())
 
70
        return wrapper;
 
71
    return wrap(impl, creationContext, isolate);
 
72
}
 
73
 
 
74
inline v8::Handle<v8::Value> toV8(TestActiveDOMObject* impl, v8::Handle<v8::Object> creationContext = v8::Handle<v8::Object>(), v8::Isolate* isolate = 0)
 
75
{
 
76
    if (UNLIKELY(!impl))
 
77
        return v8NullWithCheck(isolate);
 
78
    v8::Handle<v8::Value> wrapper = DOMDataStore::current(isolate)->get(impl);
 
79
    if (!wrapper.IsEmpty())
 
80
        return wrapper;
 
81
    return wrap(impl, creationContext, isolate);
 
82
}
 
83
 
 
84
inline v8::Handle<v8::Value> toV8(PassRefPtr< TestActiveDOMObject > impl, v8::Handle<v8::Object> creationContext = v8::Handle<v8::Object>(), v8::Isolate* isolate = 0)
 
85
{
 
86
    return toV8(impl.get(), creationContext, isolate);
 
87
}
 
88
 
 
89
}
 
90
 
 
91
#endif // V8TestActiveDOMObject_h