| Differences between
and this patch
- a/Source/WebCore/ChangeLog +39 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2013-01-31  Alec Flett  <alecflett@chromium.org>
2
3
        IndexedDB: remove old transaction backend bootstrap code
4
        https://bugs.webkit.org/show_bug.cgi?id=103923
5
6
        Reviewed by Dimitri Glazkov.
7
8
        Finally remove all leftover code from the IndexedDB "giant
9
        async refactor of 2012." This includes removal of all
10
        IDBTransaction* interfaces that were shared between
11
        the frontend and backend and a few straggling methods
12
        like onUpgradeNeeded and onSuccess that were left from
13
        the last stage of refactoring.
14
15
        * Modules/indexeddb/IDBCallbacks.h:
16
        * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
17
        * Modules/indexeddb/IDBDatabaseBackendImpl.h:
18
        (WebCore):
19
        (WebCore::IDBDatabaseBackendImpl::metadata):
20
        (IDBDatabaseBackendImpl):
21
        * Modules/indexeddb/IDBDatabaseBackendInterface.h:
22
        (WebCore):
23
        (IDBDatabaseBackendInterface):
24
        * Modules/indexeddb/IDBObjectStoreBackendImpl.h:
25
        (WebCore):
26
        * Modules/indexeddb/IDBTransaction.h:
27
        (WebCore):
28
        (IDBTransaction):
29
        * Modules/indexeddb/IDBTransactionBackendImpl.h:
30
        (WebCore):
31
        (IDBTransactionBackendImpl):
32
        * Modules/indexeddb/IDBTransactionBackendInterface.h: Removed.
33
        * Modules/indexeddb/IDBTransactionCallbacks.h: Removed.
34
        * Modules/indexeddb/IDBTransactionCoordinator.h:
35
        (WebCore):
36
        * Target.pri:
37
        * WebCore.gypi:
38
        * WebCore.xcodeproj/project.pbxproj:
39
1
2013-01-31  Dmitry Zvorygin  <zvorygin@chromium.org>
40
2013-01-31  Dmitry Zvorygin  <zvorygin@chromium.org>
2
41
3
        Web Inspector: searching for <u> in elements panel finds all tags containing "u"
42
        Web Inspector: searching for <u> in elements panel finds all tags containing "u"
- a/Source/WebKit/chromium/ChangeLog +39 lines
Lines 1-5 a/Source/WebKit/chromium/ChangeLog_sec1
1
2013-01-31  Alec Flett  <alecflett@chromium.org>
1
2013-01-31  Alec Flett  <alecflett@chromium.org>
2
2
3
        IndexedDB: remove old transaction backend bootstrap code
4
        https://bugs.webkit.org/show_bug.cgi?id=103923
5
6
        Reviewed by Dimitri Glazkov.
7
8
        Remove all deprecated WebKit APIs from
9
        the IDB backend.
10
11
        * WebKit.gyp:
12
        * public/WebIDBCallbacks.h:
13
        (WebKit):
14
        * public/WebIDBDatabase.h:
15
        (WebKit):
16
        * public/WebIDBTransaction.h: Removed.
17
        * public/WebIDBTransactionCallbacks.h: Removed.
18
        * src/AssertMatchingEnums.cpp:
19
        * src/IDBCallbacksProxy.cpp:
20
        * src/IDBDatabaseBackendProxy.cpp:
21
        * src/IDBDatabaseBackendProxy.h:
22
        (IDBDatabaseBackendProxy):
23
        * src/IDBTransactionBackendProxy.cpp: Removed.
24
        * src/IDBTransactionBackendProxy.h: Removed.
25
        * src/IDBTransactionCallbacksProxy.cpp: Removed.
26
        * src/IDBTransactionCallbacksProxy.h: Removed.
27
        * src/WebIDBCallbacksImpl.cpp:
28
        * src/WebIDBDatabaseImpl.cpp:
29
        (WebKit):
30
        * src/WebIDBDatabaseImpl.h:
31
        (WebKit):
32
        (WebIDBDatabaseImpl):
33
        * src/WebIDBTransactionCallbacksImpl.cpp: Removed.
34
        * src/WebIDBTransactionCallbacksImpl.h: Removed.
35
        * src/WebIDBTransactionImpl.cpp: Removed.
36
        * src/WebIDBTransactionImpl.h: Removed.
37
        * tests/IDBAbortOnCorruptTest.cpp:
38
        * tests/IDBDatabaseBackendTest.cpp:
39
40
2013-01-31  Alec Flett  <alecflett@chromium.org>
41
3
        IndexedDB: Remove WebKit API for old onSuccess/onUpgradeNeeded
42
        IndexedDB: Remove WebKit API for old onSuccess/onUpgradeNeeded
4
        https://bugs.webkit.org/show_bug.cgi?id=108399
43
        https://bugs.webkit.org/show_bug.cgi?id=108399
5
44
- a/Source/WebCore/Modules/indexeddb/IDBCallbacks.h -1 lines
Lines 33-39 a/Source/WebCore/Modules/indexeddb/IDBCallbacks.h_sec1
33
#include "IDBDatabaseError.h"
33
#include "IDBDatabaseError.h"
34
#include "IDBKey.h"
34
#include "IDBKey.h"
35
#include "IDBKeyPath.h"
35
#include "IDBKeyPath.h"
36
#include "IDBTransactionBackendInterface.h"
37
#include "SerializedScriptValue.h"
36
#include "SerializedScriptValue.h"
38
#include <wtf/RefCounted.h>
37
#include <wtf/RefCounted.h>
39
38
- a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp -12 lines
Lines 548-558 PassRefPtr<IDBBackingStore> IDBDatabaseBackendImpl::backingStore() const a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp_sec1
548
    return m_backingStore;
548
    return m_backingStore;
549
}
549
}
550
550
551
IDBDatabaseMetadata IDBDatabaseBackendImpl::metadata() const
552
{
553
    return m_metadata;
554
}
555
556
void IDBDatabaseBackendImpl::createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const IDBKeyPath& keyPath, bool autoIncrement)
551
void IDBDatabaseBackendImpl::createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const IDBKeyPath& keyPath, bool autoIncrement)
557
{
552
{
558
    IDB_TRACE("IDBDatabaseBackendImpl::createObjectStore");
553
    IDB_TRACE("IDBDatabaseBackendImpl::createObjectStore");
Lines 1167-1179 void IDBDatabaseBackendImpl::processPendingCalls() a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp_sec2
1167
    }
1162
    }
1168
}
1163
}
1169
1164
1170
// FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
1171
PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseBackendImpl::createTransaction(int64_t transactionId, const Vector<int64_t>& objectStoreIds, IDBTransaction::Mode mode)
1172
{
1173
    ASSERT_NOT_REACHED();
1174
    return 0;
1175
}
1176
1177
void IDBDatabaseBackendImpl::createTransaction(int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks> callbacks, const Vector<int64_t>& objectStoreIds, unsigned short mode)
1165
void IDBDatabaseBackendImpl::createTransaction(int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks> callbacks, const Vector<int64_t>& objectStoreIds, unsigned short mode)
1178
{
1166
{
1179
    RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::create(transactionId, callbacks, objectStoreIds, static_cast<IDBTransaction::Mode>(mode), this);
1167
    RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::create(transactionId, callbacks, objectStoreIds, static_cast<IDBTransaction::Mode>(mode), this);
- a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h -4 / +1 lines
Lines 41-47 class IDBBackingStore; a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h_sec1
41
class IDBDatabase;
41
class IDBDatabase;
42
class IDBFactoryBackendImpl;
42
class IDBFactoryBackendImpl;
43
class IDBTransactionBackendImpl;
43
class IDBTransactionBackendImpl;
44
class IDBTransactionBackendInterface;
45
class IDBTransactionCoordinator;
44
class IDBTransactionCoordinator;
46
45
47
class IDBDatabaseBackendImpl : public IDBDatabaseBackendInterface {
46
class IDBDatabaseBackendImpl : public IDBDatabaseBackendInterface {
Lines 60-72 public: a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h_sec2
60
59
61
    void openConnection(PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, int64_t transactionId, int64_t version);
60
    void openConnection(PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, int64_t transactionId, int64_t version);
62
    void deleteDatabase(PassRefPtr<IDBCallbacks>);
61
    void deleteDatabase(PassRefPtr<IDBCallbacks>);
62
    const IDBDatabaseMetadata& metadata() const { return m_metadata; }
63
63
64
    // IDBDatabaseBackendInterface
64
    // IDBDatabaseBackendInterface
65
    virtual IDBDatabaseMetadata metadata() const;
66
    virtual void createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement);
65
    virtual void createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement);
67
    virtual void deleteObjectStore(int64_t transactionId, int64_t objectStoreId);
66
    virtual void deleteObjectStore(int64_t transactionId, int64_t objectStoreId);
68
    // FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
69
    virtual PassRefPtr<IDBTransactionBackendInterface> createTransaction(int64_t transactionId, const Vector<int64_t>& objectStoreIds, IDBTransaction::Mode);
70
    virtual void createTransaction(int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>& objectStoreIds, unsigned short mode);
67
    virtual void createTransaction(int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>& objectStoreIds, unsigned short mode);
71
    virtual void close(PassRefPtr<IDBDatabaseCallbacks>);
68
    virtual void close(PassRefPtr<IDBDatabaseCallbacks>);
72
69
- a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendInterface.h -4 lines
Lines 40-46 class IDBDatabaseCallbacks; a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendInterface.h_sec1
40
class IDBKey;
40
class IDBKey;
41
class IDBKeyPath;
41
class IDBKeyPath;
42
class IDBKeyRange;
42
class IDBKeyRange;
43
class IDBTransactionBackendInterface;
44
struct IDBDatabaseMetadata;
43
struct IDBDatabaseMetadata;
45
44
46
typedef int ExceptionCode;
45
typedef int ExceptionCode;
Lines 52-62 class IDBDatabaseBackendInterface : public RefCounted<IDBDatabaseBackendInterfac a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendInterface.h_sec2
52
public:
51
public:
53
    virtual ~IDBDatabaseBackendInterface() { }
52
    virtual ~IDBDatabaseBackendInterface() { }
54
53
55
    virtual IDBDatabaseMetadata metadata() const = 0;
56
57
    virtual void createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement) = 0;
54
    virtual void createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement) = 0;
58
    virtual void deleteObjectStore(int64_t transactionId, int64_t objectStoreId) = 0;
55
    virtual void deleteObjectStore(int64_t transactionId, int64_t objectStoreId) = 0;
59
    virtual PassRefPtr<IDBTransactionBackendInterface> createTransaction(int64_t transactionId, const Vector<int64_t>& objectStoreIds, IDBTransaction::Mode) = 0;
60
    virtual void createTransaction(int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>& objectStoreIds, unsigned short mode) = 0;
56
    virtual void createTransaction(int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>& objectStoreIds, unsigned short mode) = 0;
61
    virtual void close(PassRefPtr<IDBDatabaseCallbacks>) = 0;
57
    virtual void close(PassRefPtr<IDBDatabaseCallbacks>) = 0;
62
58
- a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h -1 lines
Lines 39-45 namespace WebCore { a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h_sec1
39
39
40
class IDBDatabaseBackendImpl;
40
class IDBDatabaseBackendImpl;
41
class IDBTransactionBackendImpl;
41
class IDBTransactionBackendImpl;
42
class IDBTransactionBackendInterface;
43
struct IDBObjectStoreMetadata;
42
struct IDBObjectStoreMetadata;
44
43
45
// FIXME: this namespace is temporary until we move its contents out to their own home.
44
// FIXME: this namespace is temporary until we move its contents out to their own home.
- a/Source/WebCore/Modules/indexeddb/IDBTransaction.h -6 / +5 lines
Lines 35-41 a/Source/WebCore/Modules/indexeddb/IDBTransaction.h_sec1
35
#include "EventNames.h"
35
#include "EventNames.h"
36
#include "EventTarget.h"
36
#include "EventTarget.h"
37
#include "IDBMetadata.h"
37
#include "IDBMetadata.h"
38
#include "IDBTransactionCallbacks.h"
39
#include "ScriptWrappable.h"
38
#include "ScriptWrappable.h"
40
#include <wtf/HashSet.h>
39
#include <wtf/HashSet.h>
41
#include <wtf/RefCounted.h>
40
#include <wtf/RefCounted.h>
Lines 44-55 namespace WebCore { a/Source/WebCore/Modules/indexeddb/IDBTransaction.h_sec2
44
43
45
class IDBCursor;
44
class IDBCursor;
46
class IDBDatabase;
45
class IDBDatabase;
46
class IDBDatabaseBackendInterface;
47
class IDBDatabaseError;
47
class IDBObjectStore;
48
class IDBObjectStore;
48
class IDBOpenDBRequest;
49
class IDBOpenDBRequest;
49
class IDBDatabaseBackendInterface;
50
struct IDBObjectStoreMetadata;
50
struct IDBObjectStoreMetadata;
51
51
52
class IDBTransaction : public ScriptWrappable, public IDBTransactionCallbacks, public EventTarget, public ActiveDOMObject {
52
class IDBTransaction : public ScriptWrappable, public RefCounted<IDBTransaction>, public EventTarget, public ActiveDOMObject {
53
public:
53
public:
54
    enum Mode {
54
    enum Mode {
55
        READ_ONLY = 0,
55
        READ_ONLY = 0,
Lines 107-113 public: a/Source/WebCore/Modules/indexeddb/IDBTransaction.h_sec3
107
    DEFINE_ATTRIBUTE_EVENT_LISTENER(complete);
107
    DEFINE_ATTRIBUTE_EVENT_LISTENER(complete);
108
    DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
108
    DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
109
109
110
    // IDBTransactionCallbacks
111
    virtual void onAbort(PassRefPtr<IDBDatabaseError>);
110
    virtual void onAbort(PassRefPtr<IDBDatabaseError>);
112
    virtual void onComplete();
111
    virtual void onComplete();
113
112
Lines 123-130 public: a/Source/WebCore/Modules/indexeddb/IDBTransaction.h_sec4
123
    virtual bool canSuspend() const OVERRIDE;
122
    virtual bool canSuspend() const OVERRIDE;
124
    virtual void stop() OVERRIDE;
123
    virtual void stop() OVERRIDE;
125
124
126
    using RefCounted<IDBTransactionCallbacks>::ref;
125
    using RefCounted<IDBTransaction>::ref;
127
    using RefCounted<IDBTransactionCallbacks>::deref;
126
    using RefCounted<IDBTransaction>::deref;
128
127
129
private:
128
private:
130
    IDBTransaction(ScriptExecutionContext*, int64_t, const Vector<String>&, Mode, IDBDatabase*, IDBOpenDBRequest*, const IDBDatabaseMetadata&);
129
    IDBTransaction(ScriptExecutionContext*, int64_t, const Vector<String>&, Mode, IDBDatabase*, IDBOpenDBRequest*, const IDBDatabaseMetadata&);
- a/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h -9 / +4 lines
Lines 29-38 a/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h_sec1
29
#if ENABLE(INDEXED_DATABASE)
29
#if ENABLE(INDEXED_DATABASE)
30
30
31
#include "IDBBackingStore.h"
31
#include "IDBBackingStore.h"
32
#include "IDBDatabaseBackendInterface.h"
32
#include "IDBDatabaseError.h"
33
#include "IDBDatabaseError.h"
33
#include "IDBTransaction.h"
34
#include "IDBTransaction.h"
34
#include "IDBTransactionBackendInterface.h"
35
#include "IDBTransactionCallbacks.h"
36
#include "Timer.h"
35
#include "Timer.h"
37
#include <wtf/Deque.h>
36
#include <wtf/Deque.h>
38
#include <wtf/HashSet.h>
37
#include <wtf/HashSet.h>
Lines 41-60 a/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h_sec2
41
namespace WebCore {
40
namespace WebCore {
42
41
43
class IDBDatabaseBackendImpl;
42
class IDBDatabaseBackendImpl;
43
class IDBCursorBackendImpl;
44
class IDBDatabaseCallbacks;
44
45
45
class IDBTransactionBackendImpl : public IDBTransactionBackendInterface {
46
class IDBTransactionBackendImpl : public RefCounted<IDBTransactionBackendImpl> {
46
public:
47
public:
47
    static PassRefPtr<IDBTransactionBackendImpl> create(int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>&, IDBTransaction::Mode, IDBDatabaseBackendImpl*);
48
    static PassRefPtr<IDBTransactionBackendImpl> create(int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>&, IDBTransaction::Mode, IDBDatabaseBackendImpl*);
48
    static IDBTransactionBackendImpl* from(IDBTransactionBackendInterface* interface)
49
    {
50
        return static_cast<IDBTransactionBackendImpl*>(interface);
51
    }
52
    virtual ~IDBTransactionBackendImpl();
49
    virtual ~IDBTransactionBackendImpl();
53
50
54
    // IDBTransactionBackendInterface
55
    virtual void abort();
51
    virtual void abort();
56
    void commit();
52
    void commit();
57
    virtual void setCallbacks(IDBTransactionCallbacks* callbacks) { }
58
53
59
    class Operation {
54
    class Operation {
60
    public:
55
    public:
- a/Source/WebCore/Modules/indexeddb/IDBTransactionBackendInterface.h -58 lines
Lines 1-58 a/Source/WebCore/Modules/indexeddb/IDBTransactionBackendInterface.h_sec1
1
/*
2
 * Copyright (C) 2010 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#ifndef IDBTransactionBackendInterface_h
27
#define IDBTransactionBackendInterface_h
28
29
#include "IDBCallbacks.h"
30
#include <wtf/PassRefPtr.h>
31
#include <wtf/RefCounted.h>
32
#include <wtf/text/WTFString.h>
33
34
#if ENABLE(INDEXED_DATABASE)
35
36
namespace WebCore {
37
38
class IDBCursorBackendImpl;
39
class IDBTransactionCallbacks;
40
41
typedef int ExceptionCode;
42
43
// This is implemented by IDBTransactionBackendImpl and optionally others (in order to proxy
44
// calls across process barriers). All calls to these classes should be non-blocking and
45
// trigger work on a background thread if necessary.
46
class IDBTransactionBackendInterface : public RefCounted<IDBTransactionBackendInterface> {
47
public:
48
    virtual ~IDBTransactionBackendInterface() { }
49
    virtual void commit() = 0;
50
    virtual void abort() = 0;
51
    virtual void setCallbacks(IDBTransactionCallbacks*) = 0;
52
};
53
54
} // namespace WebCore
55
56
#endif
57
58
#endif // IDBTransactionBackendInterface_h
- a/Source/WebCore/Modules/indexeddb/IDBTransactionCallbacks.h -51 lines
Lines 1-51 a/Source/WebCore/Modules/indexeddb/IDBTransactionCallbacks.h_sec1
1
/*
2
 * Copyright (C) 2010 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14
 *     its contributors may be used to endorse or promote products derived
15
 *     from this software without specific prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
28
29
#ifndef IDBTransactionCallbacks_h
30
#define IDBTransactionCallbacks_h
31
32
#if ENABLE(INDEXED_DATABASE)
33
34
#include "IDBDatabaseError.h"
35
#include <wtf/RefCounted.h>
36
37
namespace WebCore {
38
39
class IDBTransactionCallbacks : public RefCounted<IDBTransactionCallbacks> {
40
public:
41
    virtual ~IDBTransactionCallbacks() { }
42
43
    virtual void onAbort(PassRefPtr<IDBDatabaseError>) = 0;
44
    virtual void onComplete() = 0;
45
};
46
47
} // namespace WebCore
48
49
#endif
50
51
#endif // IDBTransactionCallbacks_h
- a/Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.h -1 lines
Lines 35-41 a/Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.h_sec1
35
namespace WebCore {
35
namespace WebCore {
36
36
37
class IDBTransactionBackendImpl;
37
class IDBTransactionBackendImpl;
38
class IDBTransactionCallbacks;
39
class IDBDatabaseBackendImpl;
38
class IDBDatabaseBackendImpl;
40
39
41
// Transactions are executed in the order the were created.
40
// Transactions are executed in the order the were created.
- a/Source/WebCore/Target.pri -2 / +1 lines
Lines 3063-3070 enable?(INDEXED_DATABASE) { a/Source/WebCore/Target.pri_sec1
3063
        Modules/indexeddb/IDBObjectStore.h \
3063
        Modules/indexeddb/IDBObjectStore.h \
3064
        Modules/indexeddb/IDBObjectStoreBackendImpl.h \
3064
        Modules/indexeddb/IDBObjectStoreBackendImpl.h \
3065
        Modules/indexeddb/IDBRequest.h \
3065
        Modules/indexeddb/IDBRequest.h \
3066
        Modules/indexeddb/IDBTransaction.h \
3066
        Modules/indexeddb/IDBTransaction.h
3067
        Modules/indexeddb/IDBTransactionBackendInterface.h
3068
3067
3069
    SOURCES += \
3068
    SOURCES += \
3070
        bindings/js/IDBBindingUtilities.cpp \
3069
        bindings/js/IDBBindingUtilities.cpp \
- a/Source/WebCore/WebCore.gypi -2 lines
Lines 769-776 a/Source/WebCore/WebCore.gypi_sec1
769
            'Modules/indexeddb/IDBTransaction.h',
769
            'Modules/indexeddb/IDBTransaction.h',
770
            'Modules/indexeddb/IDBTransactionBackendImpl.cpp',
770
            'Modules/indexeddb/IDBTransactionBackendImpl.cpp',
771
            'Modules/indexeddb/IDBTransactionBackendImpl.h',
771
            'Modules/indexeddb/IDBTransactionBackendImpl.h',
772
            'Modules/indexeddb/IDBTransactionBackendInterface.h',
773
            'Modules/indexeddb/IDBTransactionCallbacks.h',
774
            'Modules/indexeddb/IDBTransactionCoordinator.cpp',
772
            'Modules/indexeddb/IDBTransactionCoordinator.cpp',
775
            'Modules/indexeddb/IDBTransactionCoordinator.h',
773
            'Modules/indexeddb/IDBTransactionCoordinator.h',
776
            'Modules/indexeddb/IDBVersionChangeEvent.cpp',
774
            'Modules/indexeddb/IDBVersionChangeEvent.cpp',
- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj -4 lines
Lines 3517-3523 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
3517
		9712A5F615004EDA0048AF10 /* IDBTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A59D15004EDA0048AF10 /* IDBTransaction.h */; };
3517
		9712A5F615004EDA0048AF10 /* IDBTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A59D15004EDA0048AF10 /* IDBTransaction.h */; };
3518
		9712A5F815004EDA0048AF10 /* IDBTransactionBackendImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9712A59F15004EDA0048AF10 /* IDBTransactionBackendImpl.cpp */; };
3518
		9712A5F815004EDA0048AF10 /* IDBTransactionBackendImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9712A59F15004EDA0048AF10 /* IDBTransactionBackendImpl.cpp */; };
3519
		9712A5F915004EDA0048AF10 /* IDBTransactionBackendImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A5A015004EDA0048AF10 /* IDBTransactionBackendImpl.h */; };
3519
		9712A5F915004EDA0048AF10 /* IDBTransactionBackendImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A5A015004EDA0048AF10 /* IDBTransactionBackendImpl.h */; };
3520
		9712A5FA15004EDA0048AF10 /* IDBTransactionBackendInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A5A115004EDA0048AF10 /* IDBTransactionBackendInterface.h */; };
3521
		9712A5FB15004EDA0048AF10 /* IDBTransactionCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A5A215004EDA0048AF10 /* IDBTransactionCallbacks.h */; };
3520
		9712A5FB15004EDA0048AF10 /* IDBTransactionCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A5A215004EDA0048AF10 /* IDBTransactionCallbacks.h */; };
3522
		9712A5FC15004EDA0048AF10 /* IDBTransactionCoordinator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9712A5A315004EDA0048AF10 /* IDBTransactionCoordinator.cpp */; };
3521
		9712A5FC15004EDA0048AF10 /* IDBTransactionCoordinator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9712A5A315004EDA0048AF10 /* IDBTransactionCoordinator.cpp */; };
3523
		9712A5FD15004EDA0048AF10 /* IDBTransactionCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A5A415004EDA0048AF10 /* IDBTransactionCoordinator.h */; };
3522
		9712A5FD15004EDA0048AF10 /* IDBTransactionCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A5A415004EDA0048AF10 /* IDBTransactionCoordinator.h */; };
Lines 10905-10911 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
10905
		9712A59E15004EDA0048AF10 /* IDBTransaction.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = IDBTransaction.idl; path = Modules/indexeddb/IDBTransaction.idl; sourceTree = "<group>"; };
10904
		9712A59E15004EDA0048AF10 /* IDBTransaction.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = IDBTransaction.idl; path = Modules/indexeddb/IDBTransaction.idl; sourceTree = "<group>"; };
10906
		9712A59F15004EDA0048AF10 /* IDBTransactionBackendImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IDBTransactionBackendImpl.cpp; path = Modules/indexeddb/IDBTransactionBackendImpl.cpp; sourceTree = "<group>"; };
10905
		9712A59F15004EDA0048AF10 /* IDBTransactionBackendImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IDBTransactionBackendImpl.cpp; path = Modules/indexeddb/IDBTransactionBackendImpl.cpp; sourceTree = "<group>"; };
10907
		9712A5A015004EDA0048AF10 /* IDBTransactionBackendImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IDBTransactionBackendImpl.h; path = Modules/indexeddb/IDBTransactionBackendImpl.h; sourceTree = "<group>"; };
10906
		9712A5A015004EDA0048AF10 /* IDBTransactionBackendImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IDBTransactionBackendImpl.h; path = Modules/indexeddb/IDBTransactionBackendImpl.h; sourceTree = "<group>"; };
10908
		9712A5A115004EDA0048AF10 /* IDBTransactionBackendInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IDBTransactionBackendInterface.h; path = Modules/indexeddb/IDBTransactionBackendInterface.h; sourceTree = "<group>"; };
10909
		9712A5A215004EDA0048AF10 /* IDBTransactionCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IDBTransactionCallbacks.h; path = Modules/indexeddb/IDBTransactionCallbacks.h; sourceTree = "<group>"; };
10907
		9712A5A215004EDA0048AF10 /* IDBTransactionCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IDBTransactionCallbacks.h; path = Modules/indexeddb/IDBTransactionCallbacks.h; sourceTree = "<group>"; };
10910
		9712A5A315004EDA0048AF10 /* IDBTransactionCoordinator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IDBTransactionCoordinator.cpp; path = Modules/indexeddb/IDBTransactionCoordinator.cpp; sourceTree = "<group>"; };
10908
		9712A5A315004EDA0048AF10 /* IDBTransactionCoordinator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IDBTransactionCoordinator.cpp; path = Modules/indexeddb/IDBTransactionCoordinator.cpp; sourceTree = "<group>"; };
10911
		9712A5A415004EDA0048AF10 /* IDBTransactionCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IDBTransactionCoordinator.h; path = Modules/indexeddb/IDBTransactionCoordinator.h; sourceTree = "<group>"; };
10909
		9712A5A415004EDA0048AF10 /* IDBTransactionCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IDBTransactionCoordinator.h; path = Modules/indexeddb/IDBTransactionCoordinator.h; sourceTree = "<group>"; };
Lines 18319-18325 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
18319
				9712A59E15004EDA0048AF10 /* IDBTransaction.idl */,
18317
				9712A59E15004EDA0048AF10 /* IDBTransaction.idl */,
18320
				9712A59F15004EDA0048AF10 /* IDBTransactionBackendImpl.cpp */,
18318
				9712A59F15004EDA0048AF10 /* IDBTransactionBackendImpl.cpp */,
18321
				9712A5A015004EDA0048AF10 /* IDBTransactionBackendImpl.h */,
18319
				9712A5A015004EDA0048AF10 /* IDBTransactionBackendImpl.h */,
18322
				9712A5A115004EDA0048AF10 /* IDBTransactionBackendInterface.h */,
18323
				9712A5A215004EDA0048AF10 /* IDBTransactionCallbacks.h */,
18320
				9712A5A215004EDA0048AF10 /* IDBTransactionCallbacks.h */,
18324
				9712A5A315004EDA0048AF10 /* IDBTransactionCoordinator.cpp */,
18321
				9712A5A315004EDA0048AF10 /* IDBTransactionCoordinator.cpp */,
18325
				9712A5A415004EDA0048AF10 /* IDBTransactionCoordinator.h */,
18322
				9712A5A415004EDA0048AF10 /* IDBTransactionCoordinator.h */,
Lines 24416-24422 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
24416
				9712A5F415004EDA0048AF10 /* IDBTracing.h in Headers */,
24413
				9712A5F415004EDA0048AF10 /* IDBTracing.h in Headers */,
24417
				9712A5F615004EDA0048AF10 /* IDBTransaction.h in Headers */,
24414
				9712A5F615004EDA0048AF10 /* IDBTransaction.h in Headers */,
24418
				9712A5F915004EDA0048AF10 /* IDBTransactionBackendImpl.h in Headers */,
24415
				9712A5F915004EDA0048AF10 /* IDBTransactionBackendImpl.h in Headers */,
24419
				9712A5FA15004EDA0048AF10 /* IDBTransactionBackendInterface.h in Headers */,
24420
				9712A5FB15004EDA0048AF10 /* IDBTransactionCallbacks.h in Headers */,
24416
				9712A5FB15004EDA0048AF10 /* IDBTransactionCallbacks.h in Headers */,
24421
				9712A5FD15004EDA0048AF10 /* IDBTransactionCoordinator.h in Headers */,
24417
				9712A5FD15004EDA0048AF10 /* IDBTransactionCoordinator.h in Headers */,
24422
				9712A5FF15004EDA0048AF10 /* IDBVersionChangeEvent.h in Headers */,
24418
				9712A5FF15004EDA0048AF10 /* IDBVersionChangeEvent.h in Headers */,
- a/Source/WebKit/chromium/WebKit.gyp -10 lines
Lines 188-195 a/Source/WebKit/chromium/WebKit.gyp_sec1
188
                'public/WebIDBKeyPath.h',
188
                'public/WebIDBKeyPath.h',
189
                'public/WebIDBKeyRange.h',
189
                'public/WebIDBKeyRange.h',
190
                'public/WebIDBMetadata.h',
190
                'public/WebIDBMetadata.h',
191
                'public/WebIDBTransaction.h',
192
                'public/WebIDBTransactionCallbacks.h',
193
                'public/WebIconLoadingCompletion.h',
191
                'public/WebIconLoadingCompletion.h',
194
                'public/WebIconURL.h',
192
                'public/WebIconURL.h',
195
                'public/WebImageDecoder.h',
193
                'public/WebImageDecoder.h',
Lines 375-384 a/Source/WebKit/chromium/WebKit.gyp_sec2
375
                'src/IDBFactoryBackendInterface.cpp',
373
                'src/IDBFactoryBackendInterface.cpp',
376
                'src/IDBFactoryBackendProxy.cpp',
374
                'src/IDBFactoryBackendProxy.cpp',
377
                'src/IDBFactoryBackendProxy.h',
375
                'src/IDBFactoryBackendProxy.h',
378
                'src/IDBTransactionBackendProxy.cpp',
379
                'src/IDBTransactionBackendProxy.h',
380
                'src/IDBTransactionCallbacksProxy.cpp',
381
                'src/IDBTransactionCallbacksProxy.h',
382
                'src/InspectorClientImpl.cpp',
376
                'src/InspectorClientImpl.cpp',
383
                'src/InspectorClientImpl.h',
377
                'src/InspectorClientImpl.h',
384
                'src/InspectorFrontendClientImpl.cpp',
378
                'src/InspectorFrontendClientImpl.cpp',
Lines 516-525 a/Source/WebKit/chromium/WebKit.gyp_sec3
516
                'src/WebIDBKeyPath.cpp',
510
                'src/WebIDBKeyPath.cpp',
517
                'src/WebIDBKeyRange.cpp',
511
                'src/WebIDBKeyRange.cpp',
518
                'src/WebIDBMetadata.cpp',
512
                'src/WebIDBMetadata.cpp',
519
                'src/WebIDBTransactionImpl.cpp',
520
                'src/WebIDBTransactionImpl.h',
521
                'src/WebIDBTransactionCallbacksImpl.cpp',
522
                'src/WebIDBTransactionCallbacksImpl.h',
523
                'src/WebImageDecoder.cpp',
513
                'src/WebImageDecoder.cpp',
524
                'src/WebImageSkia.cpp',
514
                'src/WebImageSkia.cpp',
525
                'src/WebInputElement.cpp',
515
                'src/WebInputElement.cpp',
- a/Source/WebKit/chromium/public/WebIDBCallbacks.h -2 lines
Lines 38-44 class WebIDBDatabaseError; a/Source/WebKit/chromium/public/WebIDBCallbacks.h_sec1
38
class WebIDBKey;
38
class WebIDBKey;
39
class WebIDBKeyPath;
39
class WebIDBKeyPath;
40
class WebIDBIndex;
40
class WebIDBIndex;
41
class WebIDBTransaction;
42
class WebSerializedScriptValue;
41
class WebSerializedScriptValue;
43
struct WebIDBMetadata;
42
struct WebIDBMetadata;
44
43
Lines 63-69 public: a/Source/WebKit/chromium/public/WebIDBCallbacks.h_sec2
63
    virtual void onBlocked() { WEBKIT_ASSERT_NOT_REACHED(); }
62
    virtual void onBlocked() { WEBKIT_ASSERT_NOT_REACHED(); }
64
    virtual void onBlocked(long long oldVersion) { WEBKIT_ASSERT_NOT_REACHED(); }
63
    virtual void onBlocked(long long oldVersion) { WEBKIT_ASSERT_NOT_REACHED(); }
65
    virtual void onSuccessWithPrefetch(const WebVector<WebIDBKey>& keys, const WebVector<WebIDBKey>& primaryKeys, const WebVector<WebSerializedScriptValue>& values) { WEBKIT_ASSERT_NOT_REACHED(); }
64
    virtual void onSuccessWithPrefetch(const WebVector<WebIDBKey>& keys, const WebVector<WebIDBKey>& primaryKeys, const WebVector<WebSerializedScriptValue>& values) { WEBKIT_ASSERT_NOT_REACHED(); }
66
    virtual void onUpgradeNeeded(long long oldVersion, WebIDBTransaction*, WebIDBDatabase*) { WEBKIT_ASSERT_NOT_REACHED(); }
67
    virtual void onUpgradeNeeded(long long oldVersion, WebIDBDatabase*, const WebIDBMetadata&) { WEBKIT_ASSERT_NOT_REACHED(); }
65
    virtual void onUpgradeNeeded(long long oldVersion, WebIDBDatabase*, const WebIDBMetadata&) { WEBKIT_ASSERT_NOT_REACHED(); }
68
};
66
};
69
67
- a/Source/WebKit/chromium/public/WebIDBDatabase.h -9 lines
Lines 30-36 a/Source/WebKit/chromium/public/WebIDBDatabase.h_sec1
30
#include "WebDOMStringList.h"
30
#include "WebDOMStringList.h"
31
#include "WebExceptionCode.h"
31
#include "WebExceptionCode.h"
32
#include "WebIDBMetadata.h"
32
#include "WebIDBMetadata.h"
33
#include "WebIDBTransaction.h"
34
33
35
namespace WebKit {
34
namespace WebKit {
36
35
Lines 41-62 class WebIDBDatabaseError; a/Source/WebKit/chromium/public/WebIDBDatabase.h_sec2
41
class WebIDBKey;
40
class WebIDBKey;
42
class WebIDBKeyPath;
41
class WebIDBKeyPath;
43
class WebIDBKeyRange;
42
class WebIDBKeyRange;
44
class WebIDBTransaction;
45
43
46
// See comment in WebIDBFactory for a high level overview of these classes.
44
// See comment in WebIDBFactory for a high level overview of these classes.
47
class WebIDBDatabase {
45
class WebIDBDatabase {
48
public:
46
public:
49
    virtual ~WebIDBDatabase() { }
47
    virtual ~WebIDBDatabase() { }
50
48
51
    virtual WebIDBMetadata metadata() const
52
    {
53
        WEBKIT_ASSERT_NOT_REACHED();
54
        return WebIDBMetadata();
55
    }
56
    virtual void createObjectStore(long long transactionId, long long objectStoreId, const WebString& name, const WebIDBKeyPath&, bool autoIncrement) { WEBKIT_ASSERT_NOT_REACHED(); }
49
    virtual void createObjectStore(long long transactionId, long long objectStoreId, const WebString& name, const WebIDBKeyPath&, bool autoIncrement) { WEBKIT_ASSERT_NOT_REACHED(); }
57
    virtual void deleteObjectStore(long long transactionId, long long objectStoreId) { WEBKIT_ASSERT_NOT_REACHED(); }
50
    virtual void deleteObjectStore(long long transactionId, long long objectStoreId) { WEBKIT_ASSERT_NOT_REACHED(); }
58
    // FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
59
    virtual WebIDBTransaction* createTransaction(long long id, const WebVector<long long>&, unsigned short mode) { WEBKIT_ASSERT_NOT_REACHED(); return 0; }
60
    virtual void createTransaction(long long id, WebIDBDatabaseCallbacks* callbacks, const WebVector<long long>&, unsigned short mode) { WEBKIT_ASSERT_NOT_REACHED(); }
51
    virtual void createTransaction(long long id, WebIDBDatabaseCallbacks* callbacks, const WebVector<long long>&, unsigned short mode) { WEBKIT_ASSERT_NOT_REACHED(); }
61
    virtual void close() { WEBKIT_ASSERT_NOT_REACHED(); }
52
    virtual void close() { WEBKIT_ASSERT_NOT_REACHED(); }
62
    virtual void forceClose() { WEBKIT_ASSERT_NOT_REACHED(); }
53
    virtual void forceClose() { WEBKIT_ASSERT_NOT_REACHED(); }
- a/Source/WebKit/chromium/public/WebIDBTransaction.h -66 lines
Lines 1-66 a/Source/WebKit/chromium/public/WebIDBTransaction.h_sec1
1
/*
2
 * Copyright (C) 2010 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#ifndef WebIDBTransaction_h
27
#define WebIDBTransaction_h
28
29
#include "../../../Platform/chromium/public/WebString.h"
30
#include "WebExceptionCode.h"
31
32
namespace WebCore { class IDBTransactionBackendInterface; }
33
34
namespace WebKit {
35
36
class WebIDBTransactionCallbacks;
37
38
// See comment in WebIDBFactory for a high level overview of these classes.
39
class WebIDBTransaction {
40
public:
41
    virtual ~WebIDBTransaction() { }
42
43
    enum TaskType {
44
        NormalTask = 0,
45
        PreemptiveTask
46
    };
47
48
    virtual void commit() { WEBKIT_ASSERT_NOT_REACHED(); }
49
    virtual void abort() { WEBKIT_ASSERT_NOT_REACHED(); }
50
    virtual void setCallbacks(WebIDBTransactionCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
51
52
    // FIXME: this is never called from WebCore. Find a cleaner solution.
53
    virtual WebCore::IDBTransactionBackendInterface* getIDBTransactionBackendInterface() const
54
    {
55
        return 0;
56
    }
57
58
    virtual void addPendingEvents(int) { WEBKIT_ASSERT_NOT_REACHED(); }
59
60
protected:
61
    WebIDBTransaction() {}
62
};
63
64
} // namespace WebKit
65
66
#endif // WebIDBTransaction_h
- a/Source/WebKit/chromium/public/WebIDBTransactionCallbacks.h -45 lines
Lines 1-45 a/Source/WebKit/chromium/public/WebIDBTransactionCallbacks.h_sec1
1
/*
2
 * Copyright (C) 2010 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#ifndef WebIDBTransactionCallbacks_h
27
#define WebIDBTransactionCallbacks_h
28
29
#include "../../../Platform/chromium/public/WebCommon.h"
30
31
namespace WebKit {
32
33
class WebIDBDatabaseError;
34
35
class WebIDBTransactionCallbacks {
36
public:
37
    virtual ~WebIDBTransactionCallbacks() { }
38
39
    virtual void onAbort(const WebIDBDatabaseError&) { WEBKIT_ASSERT_NOT_REACHED(); }
40
    virtual void onComplete() { WEBKIT_ASSERT_NOT_REACHED(); }
41
};
42
43
} // namespace WebKit
44
45
#endif // WebIDBTransactionCallbacks_h
- a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp -4 / +4 lines
Lines 54-65 a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp_sec1
54
#endif
54
#endif
55
#include "HTMLInputElement.h"
55
#include "HTMLInputElement.h"
56
#include "IDBCursor.h"
56
#include "IDBCursor.h"
57
#include "IDBDatabaseBackendInterface.h"
57
#include "IDBDatabaseException.h"
58
#include "IDBDatabaseException.h"
58
#include "IDBFactoryBackendInterface.h"
59
#include "IDBFactoryBackendInterface.h"
59
#include "IDBKey.h"
60
#include "IDBKey.h"
60
#include "IDBKeyPath.h"
61
#include "IDBKeyPath.h"
61
#include "IDBMetadata.h"
62
#include "IDBMetadata.h"
62
#include "IDBTransactionBackendInterface.h"
63
#include "IconURL.h"
63
#include "IconURL.h"
64
#include "MediaPlayer.h"
64
#include "MediaPlayer.h"
65
#include "MediaStreamSource.h"
65
#include "MediaStreamSource.h"
Lines 95-106 a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp_sec2
95
#include "WebGeolocationError.h"
95
#include "WebGeolocationError.h"
96
#include "WebGeolocationPosition.h"
96
#include "WebGeolocationPosition.h"
97
#include "WebIDBCursor.h"
97
#include "WebIDBCursor.h"
98
#include "WebIDBDatabase.h"
98
#include "WebIDBDatabaseException.h"
99
#include "WebIDBDatabaseException.h"
99
#include "WebIDBFactory.h"
100
#include "WebIDBFactory.h"
100
#include "WebIDBKey.h"
101
#include "WebIDBKey.h"
101
#include "WebIDBKeyPath.h"
102
#include "WebIDBKeyPath.h"
102
#include "WebIDBMetadata.h"
103
#include "WebIDBMetadata.h"
103
#include "WebIDBTransaction.h"
104
#include "WebIconURL.h"
104
#include "WebIconURL.h"
105
#include "WebInputElement.h"
105
#include "WebInputElement.h"
106
#include "WebMediaPlayer.h"
106
#include "WebMediaPlayer.h"
Lines 505-512 COMPILE_ASSERT_MATCHING_ENUM(WebIDBCursor::NextNoDuplicate, IDBCursor::NEXT_NO_D a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp_sec3
505
COMPILE_ASSERT_MATCHING_ENUM(WebIDBCursor::Prev, IDBCursor::PREV);
505
COMPILE_ASSERT_MATCHING_ENUM(WebIDBCursor::Prev, IDBCursor::PREV);
506
COMPILE_ASSERT_MATCHING_ENUM(WebIDBCursor::PrevNoDuplicate, IDBCursor::PREV_NO_DUPLICATE);
506
COMPILE_ASSERT_MATCHING_ENUM(WebIDBCursor::PrevNoDuplicate, IDBCursor::PREV_NO_DUPLICATE);
507
507
508
COMPILE_ASSERT_MATCHING_ENUM(WebIDBTransaction::PreemptiveTask, IDBDatabaseBackendInterface::PreemptiveTask);
508
COMPILE_ASSERT_MATCHING_ENUM(WebIDBDatabase::PreemptiveTask, IDBDatabaseBackendInterface::PreemptiveTask);
509
COMPILE_ASSERT_MATCHING_ENUM(WebIDBTransaction::NormalTask, IDBDatabaseBackendInterface::NormalTask);
509
COMPILE_ASSERT_MATCHING_ENUM(WebIDBDatabase::NormalTask, IDBDatabaseBackendInterface::NormalTask);
510
#endif
510
#endif
511
511
512
#if ENABLE(FILE_SYSTEM)
512
#if ENABLE(FILE_SYSTEM)
- a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp -2 / +1 lines
Lines 38-44 a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp_sec1
38
#include "IDBDatabaseCallbacksProxy.h"
38
#include "IDBDatabaseCallbacksProxy.h"
39
#include "IDBDatabaseError.h"
39
#include "IDBDatabaseError.h"
40
#include "IDBMetadata.h"
40
#include "IDBMetadata.h"
41
#include "IDBTransactionBackendInterface.h"
42
#include "WebIDBCallbacks.h"
41
#include "WebIDBCallbacks.h"
43
#include "WebIDBCursorImpl.h"
42
#include "WebIDBCursorImpl.h"
44
#include "WebIDBDatabaseCallbacks.h"
43
#include "WebIDBDatabaseCallbacks.h"
Lines 46-52 a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp_sec2
46
#include "WebIDBDatabaseException.h"
45
#include "WebIDBDatabaseException.h"
47
#include "WebIDBDatabaseImpl.h"
46
#include "WebIDBDatabaseImpl.h"
48
#include "WebIDBKey.h"
47
#include "WebIDBKey.h"
49
#include "WebIDBTransactionImpl.h"
48
#include "WebIDBMetadata.h"
50
#include "WebSerializedScriptValue.h"
49
#include "WebSerializedScriptValue.h"
51
50
52
using namespace WebCore;
51
using namespace WebCore;
- a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp -16 lines
Lines 33-39 a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp_sec1
33
#include "IDBDatabaseCallbacks.h"
33
#include "IDBDatabaseCallbacks.h"
34
#include "IDBKeyRange.h"
34
#include "IDBKeyRange.h"
35
#include "IDBMetadata.h"
35
#include "IDBMetadata.h"
36
#include "IDBTransactionBackendProxy.h"
37
#include "WebDOMStringList.h"
36
#include "WebDOMStringList.h"
38
#include "WebFrameImpl.h"
37
#include "WebFrameImpl.h"
39
#include "WebIDBCallbacksImpl.h"
38
#include "WebIDBCallbacksImpl.h"
Lines 42-48 a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp_sec2
42
#include "WebIDBDatabaseCallbacksImpl.h"
41
#include "WebIDBDatabaseCallbacksImpl.h"
43
#include "WebIDBDatabaseError.h"
42
#include "WebIDBDatabaseError.h"
44
#include "WebIDBKeyRange.h"
43
#include "WebIDBKeyRange.h"
45
#include "WebIDBTransaction.h"
46
44
47
using namespace WebCore;
45
using namespace WebCore;
48
46
Lines 62-72 IDBDatabaseBackendProxy::~IDBDatabaseBackendProxy() a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp_sec3
62
{
60
{
63
}
61
}
64
62
65
IDBDatabaseMetadata IDBDatabaseBackendProxy::metadata() const
66
{
67
    return m_webIDBDatabase->metadata();
68
}
69
70
void IDBDatabaseBackendProxy::createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const IDBKeyPath& keyPath, bool autoIncrement)
63
void IDBDatabaseBackendProxy::createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const IDBKeyPath& keyPath, bool autoIncrement)
71
{
64
{
72
    if (m_webIDBDatabase)
65
    if (m_webIDBDatabase)
Lines 79-93 void IDBDatabaseBackendProxy::deleteObjectStore(int64_t transactionId, int64_t o a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp_sec4
79
        m_webIDBDatabase->deleteObjectStore(transactionId, objectStoreId);
72
        m_webIDBDatabase->deleteObjectStore(transactionId, objectStoreId);
80
}
73
}
81
74
82
PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseBackendProxy::createTransaction(int64_t id, const Vector<int64_t>& objectStoreIds, IDBTransaction::Mode mode)
83
{
84
    OwnPtr<WebIDBTransaction> transaction = adoptPtr(m_webIDBDatabase->createTransaction(id, objectStoreIds, mode));
85
    if (!transaction)
86
        return 0;
87
88
    return IDBTransactionBackendProxy::create(transaction.release());
89
}
90
91
void IDBDatabaseBackendProxy::createTransaction(int64_t id, PassRefPtr<IDBDatabaseCallbacks> callbacks, const Vector<int64_t>& objectStoreIds, unsigned short mode)
75
void IDBDatabaseBackendProxy::createTransaction(int64_t id, PassRefPtr<IDBDatabaseCallbacks> callbacks, const Vector<int64_t>& objectStoreIds, unsigned short mode)
92
{
76
{
93
    m_webIDBDatabase->createTransaction(id, new WebIDBDatabaseCallbacksImpl(callbacks), objectStoreIds, mode);
77
    m_webIDBDatabase->createTransaction(id, new WebIDBDatabaseCallbacksImpl(callbacks), objectStoreIds, mode);
- a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h -4 lines
Lines 42-53 public: a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h_sec1
42
    static PassRefPtr<WebCore::IDBDatabaseBackendInterface> create(PassOwnPtr<WebIDBDatabase>);
42
    static PassRefPtr<WebCore::IDBDatabaseBackendInterface> create(PassOwnPtr<WebIDBDatabase>);
43
    virtual ~IDBDatabaseBackendProxy();
43
    virtual ~IDBDatabaseBackendProxy();
44
44
45
    virtual WebCore::IDBDatabaseMetadata metadata() const;
46
47
    virtual void createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const WebCore::IDBKeyPath&, bool autoIncrement);
45
    virtual void createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const WebCore::IDBKeyPath&, bool autoIncrement);
48
    virtual void deleteObjectStore(int64_t transactionId, int64_t objectStoreId);
46
    virtual void deleteObjectStore(int64_t transactionId, int64_t objectStoreId);
49
    // FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
50
    virtual PassRefPtr<WebCore::IDBTransactionBackendInterface> createTransaction(int64_t, const Vector<int64_t>&, WebCore::IDBTransaction::Mode);
51
    virtual void createTransaction(int64_t, PassRefPtr<WebCore::IDBDatabaseCallbacks>, const Vector<int64_t>&, unsigned short mode);
47
    virtual void createTransaction(int64_t, PassRefPtr<WebCore::IDBDatabaseCallbacks>, const Vector<int64_t>&, unsigned short mode);
52
    virtual void close(PassRefPtr<WebCore::IDBDatabaseCallbacks>);
48
    virtual void close(PassRefPtr<WebCore::IDBDatabaseCallbacks>);
53
49
- a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp -72 lines
Lines 1-72 a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "IDBTransactionBackendProxy.h"
28
29
#if ENABLE(INDEXED_DATABASE)
30
31
#include "IDBTransactionCallbacks.h"
32
#include "WebIDBDatabaseError.h"
33
#include "WebIDBTransaction.h"
34
#include "WebIDBTransactionCallbacksImpl.h"
35
36
using namespace WebCore;
37
38
namespace WebKit {
39
40
PassRefPtr<IDBTransactionBackendInterface> IDBTransactionBackendProxy::create(PassOwnPtr<WebIDBTransaction> transaction)
41
{
42
    return adoptRef(new IDBTransactionBackendProxy(transaction));
43
}
44
45
IDBTransactionBackendProxy::IDBTransactionBackendProxy(PassOwnPtr<WebIDBTransaction> transaction)
46
    : m_webIDBTransaction(transaction)
47
{
48
    ASSERT(m_webIDBTransaction);
49
}
50
51
IDBTransactionBackendProxy::~IDBTransactionBackendProxy()
52
{
53
}
54
55
void IDBTransactionBackendProxy::commit()
56
{
57
    m_webIDBTransaction->commit();
58
}
59
60
void IDBTransactionBackendProxy::abort()
61
{
62
    m_webIDBTransaction->abort();
63
}
64
65
void IDBTransactionBackendProxy::setCallbacks(IDBTransactionCallbacks* callbacks)
66
{
67
    m_webIDBTransaction->setCallbacks(new WebIDBTransactionCallbacksImpl(callbacks));
68
}
69
70
} // namespace WebKit
71
72
#endif // ENABLE(INDEXED_DATABASE)
- a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h -60 lines
Lines 1-60 a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#ifndef IDBTransactionBackendProxy_h
27
#define IDBTransactionBackendProxy_h
28
29
#if ENABLE(INDEXED_DATABASE)
30
31
#include "IDBTransactionBackendInterface.h"
32
#include <wtf/OwnPtr.h>
33
#include <wtf/PassOwnPtr.h>
34
35
namespace WebKit {
36
37
class WebIDBTransaction;
38
39
class IDBTransactionBackendProxy : public WebCore::IDBTransactionBackendInterface {
40
public:
41
    static PassRefPtr<IDBTransactionBackendInterface> create(PassOwnPtr<WebIDBTransaction>);
42
    virtual ~IDBTransactionBackendProxy();
43
44
    virtual void commit();
45
    virtual void abort();
46
    virtual void setCallbacks(WebCore::IDBTransactionCallbacks*);
47
48
    WebIDBTransaction* getWebIDBTransaction() const { return m_webIDBTransaction.get(); }
49
50
private:
51
    IDBTransactionBackendProxy(PassOwnPtr<WebIDBTransaction>);
52
53
    OwnPtr<WebIDBTransaction> m_webIDBTransaction;
54
};
55
56
} // namespace WebKit
57
58
#endif
59
60
#endif // IDBTransactionBackendProxy_h
- a/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp -68 lines
Lines 1-68 a/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14
 *     its contributors may be used to endorse or promote products derived
15
 *     from this software without specific prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
28
29
#include "config.h"
30
#include "IDBTransactionCallbacksProxy.h"
31
32
#if ENABLE(INDEXED_DATABASE)
33
34
#include "IDBDatabaseError.h"
35
#include "WebIDBDatabaseError.h"
36
#include "WebIDBTransactionCallbacks.h"
37
38
using namespace WebCore;
39
40
namespace WebKit {
41
42
PassRefPtr<IDBTransactionCallbacksProxy> IDBTransactionCallbacksProxy::create(PassOwnPtr<WebIDBTransactionCallbacks> callbacks)
43
{
44
    return adoptRef(new IDBTransactionCallbacksProxy(callbacks));
45
}
46
47
IDBTransactionCallbacksProxy::IDBTransactionCallbacksProxy(PassOwnPtr<WebIDBTransactionCallbacks> callbacks)
48
    : m_callbacks(callbacks)
49
{
50
}
51
52
IDBTransactionCallbacksProxy::~IDBTransactionCallbacksProxy()
53
{
54
}
55
56
void IDBTransactionCallbacksProxy::onAbort(PassRefPtr<IDBDatabaseError> idbDatabaseError)
57
{
58
    m_callbacks->onAbort(WebIDBDatabaseError(idbDatabaseError));
59
}
60
61
void IDBTransactionCallbacksProxy::onComplete()
62
{
63
    m_callbacks->onComplete();
64
}
65
66
} // namespace WebKit
67
68
#endif // ENABLE(INDEXED_DATABASE)
- a/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.h -61 lines
Lines 1-61 a/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.h_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14
 *     its contributors may be used to endorse or promote products derived
15
 *     from this software without specific prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
28
29
#ifndef IDBTransactionCallbacksProxy_h
30
#define IDBTransactionCallbacksProxy_h
31
32
#if ENABLE(INDEXED_DATABASE)
33
34
#include "IDBTransactionCallbacks.h"
35
#include <wtf/PassOwnPtr.h>
36
#include <wtf/PassRefPtr.h>
37
38
namespace WebKit {
39
40
class WebIDBTransactionCallbacks;
41
42
class IDBTransactionCallbacksProxy : public WebCore::IDBTransactionCallbacks {
43
public:
44
    static PassRefPtr<IDBTransactionCallbacksProxy> create(PassOwnPtr<WebIDBTransactionCallbacks>);
45
    virtual ~IDBTransactionCallbacksProxy();
46
47
    virtual void onAbort(PassRefPtr<WebCore::IDBDatabaseError>);
48
    virtual void onComplete();
49
50
private:
51
    IDBTransactionCallbacksProxy(PassOwnPtr<WebIDBTransactionCallbacks>);
52
53
    OwnPtr<WebIDBTransactionCallbacks> m_callbacks;
54
};
55
56
57
} // namespace WebKit
58
59
#endif
60
61
#endif // IDBTransactionCallbacksProxy_h
- a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp -2 lines
Lines 34-46 a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp_sec1
34
#include "IDBDatabaseBackendProxy.h"
34
#include "IDBDatabaseBackendProxy.h"
35
#include "IDBDatabaseError.h"
35
#include "IDBDatabaseError.h"
36
#include "IDBKey.h"
36
#include "IDBKey.h"
37
#include "IDBTransactionBackendProxy.h"
38
#include "WebDOMStringList.h"
37
#include "WebDOMStringList.h"
39
#include "WebIDBCallbacks.h"
38
#include "WebIDBCallbacks.h"
40
#include "WebIDBDatabase.h"
39
#include "WebIDBDatabase.h"
41
#include "WebIDBDatabaseError.h"
40
#include "WebIDBDatabaseError.h"
42
#include "WebIDBKey.h"
41
#include "WebIDBKey.h"
43
#include "WebIDBTransaction.h"
44
#include "WebSerializedScriptValue.h"
42
#include "WebSerializedScriptValue.h"
45
43
46
using namespace WebCore;
44
using namespace WebCore;
- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp -19 lines
Lines 35-48 a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp_sec1
35
#include "IDBDatabaseCallbacksProxy.h"
35
#include "IDBDatabaseCallbacksProxy.h"
36
#include "IDBKeyRange.h"
36
#include "IDBKeyRange.h"
37
#include "IDBMetadata.h"
37
#include "IDBMetadata.h"
38
#include "IDBTransactionBackendInterface.h"
39
#include "WebIDBCallbacks.h"
38
#include "WebIDBCallbacks.h"
40
#include "WebIDBDatabaseCallbacks.h"
39
#include "WebIDBDatabaseCallbacks.h"
41
#include "WebIDBDatabaseError.h"
40
#include "WebIDBDatabaseError.h"
42
#include "WebIDBKey.h"
41
#include "WebIDBKey.h"
43
#include "WebIDBKeyRange.h"
42
#include "WebIDBKeyRange.h"
44
#include "WebIDBMetadata.h"
43
#include "WebIDBMetadata.h"
45
#include "WebIDBTransactionImpl.h"
46
44
47
using namespace WebCore;
45
using namespace WebCore;
48
46
Lines 58-68 WebIDBDatabaseImpl::~WebIDBDatabaseImpl() a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp_sec2
58
{
56
{
59
}
57
}
60
58
61
WebIDBMetadata WebIDBDatabaseImpl::metadata() const
62
{
63
    return m_databaseBackend->metadata();
64
}
65
66
void WebIDBDatabaseImpl::createObjectStore(long long transactionId, long long objectStoreId, const WebString& name, const WebIDBKeyPath& keyPath, bool autoIncrement)
59
void WebIDBDatabaseImpl::createObjectStore(long long transactionId, long long objectStoreId, const WebString& name, const WebIDBKeyPath& keyPath, bool autoIncrement)
67
{
60
{
68
    m_databaseBackend->createObjectStore(transactionId, objectStoreId, name, keyPath, autoIncrement);
61
    m_databaseBackend->createObjectStore(transactionId, objectStoreId, name, keyPath, autoIncrement);
Lines 74-91 void WebIDBDatabaseImpl::deleteObjectStore(long long transactionId, long long ob a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp_sec3
74
}
67
}
75
68
76
69
77
// FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
78
WebIDBTransaction* WebIDBDatabaseImpl::createTransaction(long long id, const WebVector<long long>& objectStoreIds, unsigned short mode)
79
{
80
    Vector<int64_t> objectStoreIdList(objectStoreIds.size());
81
    for (size_t i = 0; i < objectStoreIds.size(); ++i)
82
        objectStoreIdList[i] = objectStoreIds[i];
83
    RefPtr<IDBTransactionBackendInterface> transaction = m_databaseBackend->createTransaction(id, objectStoreIdList, static_cast<IDBTransaction::Mode>(mode));
84
    if (!transaction)
85
        return 0;
86
    return new WebIDBTransactionImpl(transaction);
87
}
88
89
void WebIDBDatabaseImpl::createTransaction(long long id, WebIDBDatabaseCallbacks* callbacks, const WebVector<long long>& objectStoreIds, unsigned short mode)
70
void WebIDBDatabaseImpl::createTransaction(long long id, WebIDBDatabaseCallbacks* callbacks, const WebVector<long long>& objectStoreIds, unsigned short mode)
90
{
71
{
91
    Vector<int64_t> objectStoreIdList(objectStoreIds.size());
72
    Vector<int64_t> objectStoreIdList(objectStoreIds.size());
- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h -6 lines
Lines 31-37 a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h_sec1
31
#include "IDBDatabaseCallbacksProxy.h"
31
#include "IDBDatabaseCallbacksProxy.h"
32
#include "WebExceptionCode.h"
32
#include "WebExceptionCode.h"
33
#include "WebIDBDatabase.h"
33
#include "WebIDBDatabase.h"
34
#include "WebIDBTransaction.h"
35
#include <public/WebCommon.h>
34
#include <public/WebCommon.h>
36
#include <wtf/PassRefPtr.h>
35
#include <wtf/PassRefPtr.h>
37
#include <wtf/RefPtr.h>
36
#include <wtf/RefPtr.h>
Lines 43-49 namespace WebKit { a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h_sec2
43
class WebIDBDatabaseCallbacks;
42
class WebIDBDatabaseCallbacks;
44
class WebIDBDatabaseError;
43
class WebIDBDatabaseError;
45
class WebIDBDatabaseMetadata;
44
class WebIDBDatabaseMetadata;
46
class WebIDBTransaction;
47
45
48
// See comment in WebIDBFactory for a high level overview these classes.
46
// See comment in WebIDBFactory for a high level overview these classes.
49
class WebIDBDatabaseImpl : public WebIDBDatabase {
47
class WebIDBDatabaseImpl : public WebIDBDatabase {
Lines 51-62 public: a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h_sec3
51
    WebIDBDatabaseImpl(WTF::PassRefPtr<WebCore::IDBDatabaseBackendInterface>, WTF::PassRefPtr<IDBDatabaseCallbacksProxy>);
49
    WebIDBDatabaseImpl(WTF::PassRefPtr<WebCore::IDBDatabaseBackendInterface>, WTF::PassRefPtr<IDBDatabaseCallbacksProxy>);
52
    virtual ~WebIDBDatabaseImpl();
50
    virtual ~WebIDBDatabaseImpl();
53
51
54
    virtual WebIDBMetadata metadata() const;
55
56
    virtual void createObjectStore(long long transactionId, long long objectStoreId, const WebString& name, const WebIDBKeyPath&, bool autoIncrement);
52
    virtual void createObjectStore(long long transactionId, long long objectStoreId, const WebString& name, const WebIDBKeyPath&, bool autoIncrement);
57
    virtual void deleteObjectStore(long long objectStoreId, long long transactionId);
53
    virtual void deleteObjectStore(long long objectStoreId, long long transactionId);
58
    // FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
59
    virtual WebIDBTransaction* createTransaction(long long id, const WebVector<long long>&, unsigned short mode);
60
    virtual void createTransaction(long long id, WebIDBDatabaseCallbacks*, const WebVector<long long>&, unsigned short mode);
54
    virtual void createTransaction(long long id, WebIDBDatabaseCallbacks*, const WebVector<long long>&, unsigned short mode);
61
    virtual void forceClose();
55
    virtual void forceClose();
62
    virtual void close();
56
    virtual void close();
- a/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp -60 lines
Lines 1-60 a/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "WebIDBTransactionCallbacksImpl.h"
28
29
#if ENABLE(INDEXED_DATABASE)
30
31
#include "IDBDatabaseError.h"
32
#include "IDBTransactionCallbacks.h"
33
#include "WebIDBDatabaseError.h"
34
35
using namespace WebCore;
36
37
namespace WebKit {
38
39
WebIDBTransactionCallbacksImpl::WebIDBTransactionCallbacksImpl(PassRefPtr<IDBTransactionCallbacks> callbacks)
40
    : m_callbacks(callbacks)
41
{
42
}
43
44
WebIDBTransactionCallbacksImpl::~WebIDBTransactionCallbacksImpl()
45
{
46
}
47
48
void WebIDBTransactionCallbacksImpl::onAbort(const WebIDBDatabaseError& error)
49
{
50
    m_callbacks->onAbort(error);
51
}
52
53
void WebIDBTransactionCallbacksImpl::onComplete()
54
{
55
    m_callbacks->onComplete();
56
}
57
58
} // namespace WebKit
59
60
#endif // ENABLE(INDEXED_DATABASE)
- a/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h -55 lines
Lines 1-55 a/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#ifndef WebIDBTransactionCallbacksImpl_h
27
#define WebIDBTransactionCallbacksImpl_h
28
29
#if ENABLE(INDEXED_DATABASE)
30
31
#include "WebIDBTransactionCallbacks.h"
32
#include <wtf/PassRefPtr.h>
33
#include <wtf/RefPtr.h>
34
35
namespace WebCore { class IDBTransactionCallbacks; }
36
37
namespace WebKit {
38
39
class WebIDBTransactionCallbacksImpl : public WebIDBTransactionCallbacks {
40
public:
41
    WebIDBTransactionCallbacksImpl(PassRefPtr<WebCore::IDBTransactionCallbacks>);
42
    virtual ~WebIDBTransactionCallbacksImpl();
43
44
    virtual void onAbort(const WebIDBDatabaseError&);
45
    virtual void onComplete();
46
47
private:
48
    RefPtr<WebCore::IDBTransactionCallbacks> m_callbacks;
49
};
50
51
} // namespace WebKit
52
53
#endif // ENABLE(INDEXED_DATABASE)
54
55
#endif // WebIDBTransactionCallbacksImpl_h
- a/Source/WebKit/chromium/src/WebIDBTransactionImpl.cpp -72 lines
Lines 1-72 a/Source/WebKit/chromium/src/WebIDBTransactionImpl.cpp_sec1
1
/*
2
 * Copyright (C) 2010 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "WebIDBTransactionImpl.h"
28
29
#if ENABLE(INDEXED_DATABASE)
30
31
#include "IDBTransaction.h"
32
#include "IDBTransactionBackendInterface.h"
33
#include "IDBTransactionCallbacksProxy.h"
34
#include "WebIDBTransactionCallbacks.h"
35
36
using namespace WebCore;
37
38
namespace WebKit {
39
40
WebIDBTransactionImpl::WebIDBTransactionImpl(PassRefPtr<IDBTransactionBackendInterface> backend)
41
    : m_backend(backend)
42
{
43
}
44
45
WebIDBTransactionImpl::~WebIDBTransactionImpl()
46
{
47
}
48
49
void WebIDBTransactionImpl::commit()
50
{
51
    m_backend->commit();
52
}
53
54
void WebIDBTransactionImpl::abort()
55
{
56
    m_backend->abort();
57
}
58
59
void WebIDBTransactionImpl::setCallbacks(WebIDBTransactionCallbacks* callbacks)
60
{
61
    RefPtr<IDBTransactionCallbacks> idbCallbacks = IDBTransactionCallbacksProxy::create(adoptPtr(callbacks));
62
    m_backend->setCallbacks(idbCallbacks.get());
63
}
64
65
IDBTransactionBackendInterface* WebIDBTransactionImpl::getIDBTransactionBackendInterface() const
66
{
67
    return m_backend.get();
68
}
69
70
} // namespace WebKit
71
72
#endif // ENABLE(INDEXED_DATABASE)
- a/Source/WebKit/chromium/src/WebIDBTransactionImpl.h -58 lines
Lines 1-58 a/Source/WebKit/chromium/src/WebIDBTransactionImpl.h_sec1
1
/*
2
 * Copyright (C) 2010 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#ifndef WebIDBTransactionImpl_h
27
#define WebIDBTransactionImpl_h
28
29
#if ENABLE(INDEXED_DATABASE)
30
31
#include "WebIDBTransaction.h"
32
#include <public/WebCommon.h>
33
#include <wtf/PassRefPtr.h>
34
#include <wtf/RefPtr.h>
35
36
namespace WebKit {
37
38
// See comment in WebIndexedDatabase for a high level overview these classes.
39
class WebIDBTransactionImpl: public WebIDBTransaction {
40
public:
41
    WebIDBTransactionImpl(WTF::PassRefPtr<WebCore::IDBTransactionBackendInterface>);
42
    virtual ~WebIDBTransactionImpl();
43
44
    virtual void commit();
45
    virtual void abort();
46
    virtual void setCallbacks(WebIDBTransactionCallbacks*);
47
48
    virtual WebCore::IDBTransactionBackendInterface* getIDBTransactionBackendInterface() const;
49
50
private:
51
    WTF::RefPtr<WebCore::IDBTransactionBackendInterface> m_backend;
52
};
53
54
} // namespace WebKit
55
56
#endif // ENABLE(INDEXED_DATABASE)
57
58
#endif // WebIDBTransactionImpl_h
- a/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp -1 lines
Lines 62-68 public: a/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp_sec1
62
        EXPECT_TRUE(false);
62
        EXPECT_TRUE(false);
63
    }
63
    }
64
    virtual void onSuccess(PassRefPtr<IDBKey>) { }
64
    virtual void onSuccess(PassRefPtr<IDBKey>) { }
65
    virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>) { }
66
    virtual void onSuccess(PassRefPtr<SerializedScriptValue>) { }
65
    virtual void onSuccess(PassRefPtr<SerializedScriptValue>) { }
67
    virtual void onSuccess(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, const IDBKeyPath&) { }
66
    virtual void onSuccess(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, const IDBKeyPath&) { }
68
    virtual void onSuccess(int64_t) OVERRIDE { }
67
    virtual void onSuccess(int64_t) OVERRIDE { }
- a/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp -2 lines
Lines 138-145 public: a/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp_sec1
138
    virtual IDBDatabaseMetadata metadata() const { return IDBDatabaseMetadata(); }
138
    virtual IDBDatabaseMetadata metadata() const { return IDBDatabaseMetadata(); }
139
    virtual void createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement) OVERRIDE { };
139
    virtual void createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement) OVERRIDE { };
140
    virtual void deleteObjectStore(int64_t transactionId, int64_t objectStoreId) OVERRIDE { }
140
    virtual void deleteObjectStore(int64_t transactionId, int64_t objectStoreId) OVERRIDE { }
141
    // FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
142
    virtual PassRefPtr<IDBTransactionBackendInterface> createTransaction(int64_t, const Vector<int64_t>&, IDBTransaction::Mode) OVERRIDE { return 0; }
143
    virtual void createTransaction(int64_t, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>&, unsigned short mode) OVERRIDE { }
141
    virtual void createTransaction(int64_t, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>&, unsigned short mode) OVERRIDE { }
144
142
145
    virtual void close(PassRefPtr<IDBDatabaseCallbacks>) OVERRIDE
143
    virtual void close(PassRefPtr<IDBDatabaseCallbacks>) OVERRIDE

Return to Bug 103923