| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 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. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #ifndef IDBCallbacksProxy_h | 29 #ifndef IDBCallbacksProxy_h |
| 30 #define IDBCallbacksProxy_h | 30 #define IDBCallbacksProxy_h |
| 31 | 31 |
| 32 #include "heap/Handle.h" |
| 32 #include "modules/indexeddb/IDBCallbacks.h" | 33 #include "modules/indexeddb/IDBCallbacks.h" |
| 33 #include <wtf/PassOwnPtr.h> | 34 #include <wtf/PassOwnPtr.h> |
| 34 #include <wtf/PassRefPtr.h> | 35 #include <wtf/PassRefPtr.h> |
| 35 #include <wtf/RefPtr.h> | 36 #include <wtf/RefPtr.h> |
| 36 | 37 |
| 37 namespace WebKit { | 38 namespace WebKit { |
| 38 | 39 |
| 39 class WebIDBCallbacks; | 40 class WebIDBCallbacks; |
| 40 class IDBDatabaseCallbacksProxy; | 41 class IDBDatabaseCallbacksProxy; |
| 41 | 42 |
| 42 class IDBCallbacksProxy : public WebCore::IDBCallbacks { | 43 class IDBCallbacksProxy : public WebCore::IDBCallbacks { |
| 43 public: | 44 public: |
| 44 static PassRefPtr<IDBCallbacksProxy> create(PassOwnPtr<WebIDBCallbacks>); | 45 static IDBCallbacksProxy* create(PassOwnPtr<WebIDBCallbacks>); |
| 45 virtual ~IDBCallbacksProxy(); | 46 virtual ~IDBCallbacksProxy(); |
| 46 | 47 |
| 47 virtual void onError(PassRefPtr<WebCore::IDBDatabaseError>); | 48 virtual void onError(PassRefPtr<WebCore::IDBDatabaseError>); |
| 48 virtual void onSuccess(const Vector<String>&); | 49 virtual void onSuccess(const Vector<String>&); |
| 49 virtual void onSuccess(PassRefPtr<WebCore::IDBCursorBackendInterface>, PassR
efPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBKey> primaryKey, PassRefPtr<WebCo
re::SharedBuffer>); | 50 virtual void onSuccess(PassRefPtr<WebCore::IDBCursorBackendInterface>, PassR
efPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBKey> primaryKey, PassRefPtr<WebCo
re::SharedBuffer>); |
| 50 virtual void onSuccess(PassRefPtr<WebCore::IDBDatabaseBackendInterface>, con
st WebCore::IDBDatabaseMetadata&); | 51 virtual void onSuccess(WebCore::IDBDatabaseBackendInterface*, const WebCore:
:IDBDatabaseMetadata&); |
| 51 virtual void onSuccess(PassRefPtr<WebCore::IDBKey>); | 52 virtual void onSuccess(PassRefPtr<WebCore::IDBKey>); |
| 52 virtual void onSuccess(PassRefPtr<WebCore::SharedBuffer>); | 53 virtual void onSuccess(PassRefPtr<WebCore::SharedBuffer>); |
| 53 virtual void onSuccess(PassRefPtr<WebCore::SharedBuffer>, PassRefPtr<WebCore
::IDBKey>, const WebCore::IDBKeyPath&); | 54 virtual void onSuccess(PassRefPtr<WebCore::SharedBuffer>, PassRefPtr<WebCore
::IDBKey>, const WebCore::IDBKeyPath&); |
| 54 virtual void onSuccess(int64_t); | 55 virtual void onSuccess(int64_t); |
| 55 virtual void onSuccess(); | 56 virtual void onSuccess(); |
| 56 virtual void onSuccess(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBK
ey> primaryKey, PassRefPtr<WebCore::SharedBuffer>); | 57 virtual void onSuccess(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBK
ey> primaryKey, PassRefPtr<WebCore::SharedBuffer>); |
| 57 virtual void onSuccessWithPrefetch(const Vector<RefPtr<WebCore::IDBKey> >& k
eys, const Vector<RefPtr<WebCore::IDBKey> >& primaryKeys, const Vector<RefPtr<We
bCore::SharedBuffer> >& values); | 58 virtual void onSuccessWithPrefetch(const Vector<RefPtr<WebCore::IDBKey> >& k
eys, const Vector<RefPtr<WebCore::IDBKey> >& primaryKeys, const Vector<RefPtr<We
bCore::SharedBuffer> >& values); |
| 58 virtual void onBlocked(int64_t existingVersion); | 59 virtual void onBlocked(int64_t existingVersion); |
| 59 virtual void onUpgradeNeeded(int64_t oldVersion, PassRefPtr<WebCore::IDBData
baseBackendInterface>, const WebCore::IDBDatabaseMetadata&); | 60 virtual void onUpgradeNeeded(int64_t oldVersion, WebCore::IDBDatabaseBackend
Interface*, const WebCore::IDBDatabaseMetadata&); |
| 60 | 61 |
| 61 void setDatabaseCallbacks(PassRefPtr<IDBDatabaseCallbacksProxy>); | 62 void setDatabaseCallbacks(IDBDatabaseCallbacksProxy*); |
| 63 |
| 64 void trace(WebCore::Visitor*); |
| 62 | 65 |
| 63 private: | 66 private: |
| 64 IDBCallbacksProxy(PassOwnPtr<WebIDBCallbacks>); | 67 IDBCallbacksProxy(PassOwnPtr<WebIDBCallbacks>); |
| 65 | 68 |
| 66 OwnPtr<WebIDBCallbacks> m_callbacks; | 69 OwnPtr<WebIDBCallbacks> m_callbacks; |
| 67 RefPtr<IDBDatabaseCallbacksProxy> m_databaseCallbacks; | 70 WebCore::Member<IDBDatabaseCallbacksProxy> m_databaseCallbacks; |
| 68 bool m_didComplete; | 71 bool m_didComplete; |
| 69 bool m_didCreateProxy; | 72 bool m_didCreateProxy; |
| 70 }; | 73 }; |
| 71 | 74 |
| 72 } // namespace WebKit | 75 } // namespace WebKit |
| 73 | 76 |
| 74 #endif // IDBCallbacksProxy_h | 77 #endif // IDBCallbacksProxy_h |
| OLD | NEW |