| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * 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 * | 10 * |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #ifndef WebIDBCallbacksImpl_h | 29 #ifndef WebIDBCallbacksImpl_h |
| 30 #define WebIDBCallbacksImpl_h | 30 #define WebIDBCallbacksImpl_h |
| 31 | 31 |
| 32 #include "public/platform/modules/indexeddb/WebIDBCallbacks.h" | 32 #include "public/platform/modules/indexeddb/WebIDBCallbacks.h" |
| 33 #include "wtf/PassOwnPtr.h" | |
| 34 #include "wtf/PassRefPtr.h" | 33 #include "wtf/PassRefPtr.h" |
| 35 #include "wtf/RefPtr.h" | 34 #include "wtf/RefPtr.h" |
| 35 #include <memory> |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class IDBRequest; | 39 class IDBRequest; |
| 40 class WebIDBCursor; | 40 class WebIDBCursor; |
| 41 class WebIDBDatabase; | 41 class WebIDBDatabase; |
| 42 class WebIDBDatabaseError; | 42 class WebIDBDatabaseError; |
| 43 class WebIDBKey; | 43 class WebIDBKey; |
| 44 struct WebIDBMetadata; | 44 struct WebIDBMetadata; |
| 45 struct WebIDBValue; | 45 struct WebIDBValue; |
| 46 | 46 |
| 47 class WebIDBCallbacksImpl final : public WebIDBCallbacks { | 47 class WebIDBCallbacksImpl final : public WebIDBCallbacks { |
| 48 USING_FAST_MALLOC(WebIDBCallbacksImpl); | 48 USING_FAST_MALLOC(WebIDBCallbacksImpl); |
| 49 public: | 49 public: |
| 50 static PassOwnPtr<WebIDBCallbacksImpl> create(IDBRequest*); | 50 static std::unique_ptr<WebIDBCallbacksImpl> create(IDBRequest*); |
| 51 | 51 |
| 52 ~WebIDBCallbacksImpl() override; | 52 ~WebIDBCallbacksImpl() override; |
| 53 | 53 |
| 54 // Pointers transfer ownership. | 54 // Pointers transfer ownership. |
| 55 void onError(const WebIDBDatabaseError&) override; | 55 void onError(const WebIDBDatabaseError&) override; |
| 56 void onSuccess(const WebVector<WebString>&) override; | 56 void onSuccess(const WebVector<WebString>&) override; |
| 57 void onSuccess(WebIDBCursor*, const WebIDBKey&, const WebIDBKey& primaryKey,
const WebIDBValue&) override; | 57 void onSuccess(WebIDBCursor*, const WebIDBKey&, const WebIDBKey& primaryKey,
const WebIDBValue&) override; |
| 58 void onSuccess(WebIDBDatabase*, const WebIDBMetadata&) override; | 58 void onSuccess(WebIDBDatabase*, const WebIDBMetadata&) override; |
| 59 void onSuccess(const WebIDBKey&) override; | 59 void onSuccess(const WebIDBKey&) override; |
| 60 void onSuccess(const WebIDBValue&) override; | 60 void onSuccess(const WebIDBValue&) override; |
| 61 void onSuccess(const WebVector<WebIDBValue>&) override; | 61 void onSuccess(const WebVector<WebIDBValue>&) override; |
| 62 void onSuccess(long long) override; | 62 void onSuccess(long long) override; |
| 63 void onSuccess() override; | 63 void onSuccess() override; |
| 64 void onSuccess(const WebIDBKey&, const WebIDBKey& primaryKey, const WebIDBVa
lue&) override; | 64 void onSuccess(const WebIDBKey&, const WebIDBKey& primaryKey, const WebIDBVa
lue&) override; |
| 65 void onBlocked(long long oldVersion) override; | 65 void onBlocked(long long oldVersion) override; |
| 66 void onUpgradeNeeded(long long oldVersion, WebIDBDatabase*, const WebIDBMeta
data&, unsigned short dataLoss, WebString dataLossMessage) override; | 66 void onUpgradeNeeded(long long oldVersion, WebIDBDatabase*, const WebIDBMeta
data&, unsigned short dataLoss, WebString dataLossMessage) override; |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 explicit WebIDBCallbacksImpl(IDBRequest*); | 69 explicit WebIDBCallbacksImpl(IDBRequest*); |
| 70 | 70 |
| 71 Persistent<IDBRequest> m_request; | 71 Persistent<IDBRequest> m_request; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace blink | 74 } // namespace blink |
| 75 | 75 |
| 76 #endif // WebIDBCallbacksImpl_h | 76 #endif // WebIDBCallbacksImpl_h |
| OLD | NEW |