~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/storage/Database.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#ifndef Database_h
30
30
#define Database_h
31
31
 
 
32
#if ENABLE(DATABASE)
32
33
#include <wtf/MessageQueue.h>
33
34
#include "PlatformString.h"
34
35
#include "SecurityOrigin.h"
40
41
 
41
42
#include <wtf/Forward.h>
42
43
#include <wtf/HashSet.h>
43
 
#include <wtf/OwnPtr.h>
44
44
#include <wtf/PassRefPtr.h>
45
45
#include <wtf/RefPtr.h>
46
46
#include <wtf/Deque.h>
 
47
#else
 
48
#include "PlatformString.h"
 
49
#endif
47
50
 
 
51
#if ENABLE(DATABASE)
48
52
namespace WebCore {
49
53
 
50
54
class DatabaseAuthorizer;
52
56
class Document;
53
57
class SQLResultSet;
54
58
class SQLTransactionCallback;
 
59
class SQLTransactionClient;
 
60
class SQLTransactionCoordinator;
55
61
class SQLTransactionErrorCallback;
56
62
class SQLValue;
57
 
    
 
63
 
58
64
typedef int ExceptionCode;
59
65
 
60
66
class Database : public ThreadSafeShared<Database> {
67
73
// Direct support for the DOM API
68
74
    static PassRefPtr<Database> openDatabase(Document* document, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, ExceptionCode&);
69
75
    String version() const;
70
 
    void changeVersion(const String& oldVersion, const String& newVersion, 
 
76
    void changeVersion(const String& oldVersion, const String& newVersion,
71
77
                       PassRefPtr<SQLTransactionCallback> callback, PassRefPtr<SQLTransactionErrorCallback> errorCallback,
72
78
                       PassRefPtr<VoidCallback> successCallback);
73
79
    void transaction(PassRefPtr<SQLTransactionCallback> callback, PassRefPtr<SQLTransactionErrorCallback> errorCallback,
74
 
                     PassRefPtr<VoidCallback> successCallback);
75
 
    
 
80
                     PassRefPtr<VoidCallback> successCallback, bool readOnly);
 
81
 
76
82
// Internal engine support
77
83
    static const String& databaseInfoTableName();
78
84
 
79
85
    void disableAuthorizer();
80
86
    void enableAuthorizer();
 
87
    void setAuthorizerReadOnly();
81
88
 
82
89
    Vector<String> tableNames();
83
90
 
84
91
    Document* document() const { return m_document.get(); }
85
92
    PassRefPtr<SecurityOrigin> securityOriginCopy() const;
86
93
    String stringIdentifier() const;
87
 
    
 
94
 
88
95
    bool getVersionFromDatabase(String&);
89
96
    bool setVersionInDatabase(const String&);
90
97
    void setExpectedVersion(const String&);
94
101
    bool deleted() const { return m_deleted; }
95
102
 
96
103
    void close();
97
 
    
 
104
    bool opened() const { return m_opened; }
 
105
 
98
106
    void stop();
99
107
    bool stopped() const { return m_stopped; }
100
108
 
109
117
 
110
118
    Vector<String> performGetTableNames();
111
119
 
 
120
    SQLTransactionClient* transactionClient() const;
 
121
    SQLTransactionCoordinator* transactionCoordinator() const;
 
122
 
112
123
private:
113
124
    Database(Document* document, const String& name, const String& expectedVersion);
114
125
 
116
127
 
117
128
    void scheduleTransaction();
118
129
    void scheduleTransactionCallback(SQLTransaction*);
119
 
    void scheduleTransactionStep(SQLTransaction* transaction);
120
 
    
 
130
    void scheduleTransactionStep(SQLTransaction* transaction, bool immediately = false);
 
131
 
121
132
    MessageQueue<RefPtr<SQLTransaction> > m_transactionQueue;
122
133
    Mutex m_transactionInProgressMutex;
123
134
    bool m_transactionInProgress;
132
143
    String m_filename;
133
144
 
134
145
    bool m_deleted;
135
 
    
 
146
 
136
147
    bool m_stopped;
137
148
 
 
149
    bool m_opened;
 
150
 
138
151
    SQLiteDatabase m_sqliteDatabase;
139
152
    RefPtr<DatabaseAuthorizer> m_databaseAuthorizer;
140
153
 
145
158
 
146
159
} // namespace WebCore
147
160
 
 
161
#else
 
162
 
 
163
namespace WebCore {
 
164
class Database : public ThreadSafeShared<Database> {
 
165
public:
 
166
    static const String& databaseInfoTableName();
 
167
};
 
168
} // namespace WebCore
 
169
 
 
170
#endif // ENABLE(DATABASE)
 
171
 
148
172
#endif // Database_h