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

« back to all changes in this revision

Viewing changes to Source/WebCore/bindings/scripts/test/V8/V8TestCallback.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
#if ENABLE(SQL_DATABASE)
 
22
 
 
23
#ifndef V8TestCallback_h
 
24
#define V8TestCallback_h
 
25
 
 
26
#include "ActiveDOMCallback.h"
 
27
#include "ScopedPersistent.h"
 
28
#include "TestCallback.h"
 
29
#include "WorldContextHandle.h"
 
30
#include <v8.h>
 
31
#include <wtf/Forward.h>
 
32
 
 
33
namespace WebCore {
 
34
 
 
35
class ScriptExecutionContext;
 
36
 
 
37
class V8TestCallback : public TestCallback, public ActiveDOMCallback {
 
38
public:
 
39
    static PassRefPtr<V8TestCallback> create(v8::Handle<v8::Value> value, ScriptExecutionContext* context, v8::Handle<v8::Object> owner = v8::Handle<v8::Object>())
 
40
    {
 
41
        ASSERT(value->IsObject());
 
42
        ASSERT(context);
 
43
        return adoptRef(new V8TestCallback(v8::Handle<v8::Object>::Cast(value), context, owner));
 
44
    }
 
45
 
 
46
    virtual ~V8TestCallback();
 
47
 
 
48
    // Functions
 
49
    virtual bool callbackWithNoParam();
 
50
    virtual bool callbackWithClass1Param(Class1* class1Param);
 
51
    virtual bool callbackWithClass2Param(Class2* class2Param, const String& strArg);
 
52
    COMPILE_ASSERT(false)    virtual int callbackWithNonBoolReturnType(Class3* class3Param);
 
53
    virtual int customCallback(Class5* class5Param, Class6* class6Param);
 
54
    virtual bool callbackWithStringList(RefPtr<DOMStringList> listParam);
 
55
    virtual bool callbackWithBoolean(bool boolParam);
 
56
    virtual bool callbackRequiresThisToPass(Class8* class8Param, ThisClass* thisClassParam);
 
57
 
 
58
private:
 
59
    V8TestCallback(v8::Handle<v8::Object>, ScriptExecutionContext*, v8::Handle<v8::Object>);
 
60
 
 
61
    static void weakCallback(v8::Persistent<v8::Value> wrapper, void* parameter)
 
62
    {
 
63
        V8TestCallback* object = static_cast<V8TestCallback*>(parameter);
 
64
        object->m_callback.clear();
 
65
    }
 
66
 
 
67
    ScopedPersistent<v8::Object> m_callback;
 
68
    WorldContextHandle m_worldContext;
 
69
};
 
70
 
 
71
}
 
72
 
 
73
#endif // V8TestCallback_h
 
74
 
 
75
#endif // ENABLE(SQL_DATABASE)