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

« back to all changes in this revision

Viewing changes to Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.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 V8TestEventTarget_h
 
22
#define V8TestEventTarget_h
 
23
 
 
24
#include "TestEventTarget.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 V8TestEventTarget {
 
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 TestEventTarget* toNative(v8::Handle<v8::Object> object)
 
41
    {
 
42
        return reinterpret_cast<TestEventTarget*>(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
 
43
    }
 
44
    static void derefObject(void*);
 
45
    static WrapperTypeInfo info;
 
46
    static v8::Handle<v8::Value> indexedPropertyGetter(uint32_t, const v8::AccessorInfo&);
 
47
    static v8::Handle<v8::Value> namedPropertyGetter(v8::Local<v8::String>, const v8::AccessorInfo&);
 
48
    static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCount + 0;
 
49
    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 1;
 
50
    static void installPerContextProperties(v8::Handle<v8::Object>, TestEventTarget*) { }
 
51
    static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { }
 
52
private:
 
53
    friend v8::Handle<v8::Object> wrap(TestEventTarget*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
 
54
    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestEventTarget>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
 
55
};
 
56
 
 
57
 
 
58
inline v8::Handle<v8::Object> wrap(TestEventTarget* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate = 0)
 
59
{
 
60
    ASSERT(impl);
 
61
    ASSERT(DOMDataStore::current(isolate)->get(impl).IsEmpty());
 
62
    return V8TestEventTarget::createWrapper(impl, creationContext, isolate);
 
63
}
 
64
 
 
65
inline v8::Handle<v8::Object> toV8Object(TestEventTarget* impl, v8::Handle<v8::Object> creationContext = v8::Handle<v8::Object>(), v8::Isolate* isolate = 0)
 
66
{
 
67
    if (UNLIKELY(!impl))
 
68
        return v8::Handle<v8::Object>();
 
69
    v8::Handle<v8::Object> wrapper = DOMDataStore::current(isolate)->get(impl);
 
70
    if (!wrapper.IsEmpty())
 
71
        return wrapper;
 
72
    return wrap(impl, creationContext, isolate);
 
73
}
 
74
 
 
75
inline v8::Handle<v8::Value> toV8(TestEventTarget* impl, v8::Handle<v8::Object> creationContext = v8::Handle<v8::Object>(), v8::Isolate* isolate = 0)
 
76
{
 
77
    if (UNLIKELY(!impl))
 
78
        return v8NullWithCheck(isolate);
 
79
    v8::Handle<v8::Value> wrapper = DOMDataStore::current(isolate)->get(impl);
 
80
    if (!wrapper.IsEmpty())
 
81
        return wrapper;
 
82
    return wrap(impl, creationContext, isolate);
 
83
}
 
84
 
 
85
inline v8::Handle<v8::Value> toV8(PassRefPtr< TestEventTarget > impl, v8::Handle<v8::Object> creationContext = v8::Handle<v8::Object>(), v8::Isolate* isolate = 0)
 
86
{
 
87
    return toV8(impl.get(), creationContext, isolate);
 
88
}
 
89
 
 
90
}
 
91
 
 
92
#endif // V8TestEventTarget_h