| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 12 matching lines...) Expand all Loading... |
| 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef WebIDBDatabase_h | 26 #ifndef WebIDBDatabase_h |
| 27 #define WebIDBDatabase_h | 27 #define WebIDBDatabase_h |
| 28 | 28 |
| 29 #include "public/platform/WebBlobInfo.h" | 29 #include "public/platform/WebBlobInfo.h" |
| 30 #include "public/platform/WebCommon.h" | 30 #include "public/platform/WebCommon.h" |
| 31 #include "public/platform/modules/indexeddb/WebIDBCursor.h" | 31 #include "public/platform/modules/indexeddb/WebIDBCursor.h" |
| 32 #include "public/platform/modules/indexeddb/WebIDBMetadata.h" | 32 #include "public/platform/modules/indexeddb/WebIDBMetadata.h" |
| 33 #include "public/platform/modules/indexeddb/WebIDBObserver.h" |
| 33 #include "public/platform/modules/indexeddb/WebIDBTypes.h" | 34 #include "public/platform/modules/indexeddb/WebIDBTypes.h" |
| 35 #include <set> |
| 36 #include <vector> |
| 34 | 37 |
| 35 namespace blink { | 38 namespace blink { |
| 36 | 39 |
| 37 class WebData; | 40 class WebData; |
| 38 class WebIDBCallbacks; | 41 class WebIDBCallbacks; |
| 39 class WebIDBDatabaseCallbacks; | 42 class WebIDBDatabaseCallbacks; |
| 40 class WebIDBKey; | 43 class WebIDBKey; |
| 41 class WebIDBKeyPath; | 44 class WebIDBKeyPath; |
| 42 class WebIDBKeyRange; | 45 class WebIDBKeyRange; |
| 46 class WebIDBObserver; |
| 43 | 47 |
| 44 class WebIDBDatabase { | 48 class WebIDBDatabase { |
| 45 public: | 49 public: |
| 46 virtual ~WebIDBDatabase() { } | 50 virtual ~WebIDBDatabase() { } |
| 47 | 51 |
| 48 virtual void createObjectStore(long long transactionId, long long objectStor
eId, const WebString& name, const WebIDBKeyPath&, bool autoIncrement) = 0; | 52 virtual void createObjectStore(long long transactionId, long long objectStor
eId, const WebString& name, const WebIDBKeyPath&, bool autoIncrement) = 0; |
| 49 virtual void deleteObjectStore(long long transactionId, long long objectStor
eId) = 0; | 53 virtual void deleteObjectStore(long long transactionId, long long objectStor
eId) = 0; |
| 50 virtual void createTransaction(long long id, WebIDBDatabaseCallbacks*, const
WebVector<long long>& scope, WebIDBTransactionMode) = 0; | 54 virtual void createTransaction(long long id, WebIDBDatabaseCallbacks*, const
WebVector<long long>& scope, WebIDBTransactionMode) = 0; |
| 51 virtual void close() = 0; | 55 virtual void close() = 0; |
| 52 virtual void versionChangeIgnored() = 0; | 56 virtual void versionChangeIgnored() = 0; |
| 53 | 57 |
| 54 virtual void abort(long long transactionId) = 0; | 58 virtual void abort(long long transactionId) = 0; |
| 55 virtual void commit(long long transactionId) = 0; | 59 virtual void commit(long long transactionId) = 0; |
| 56 | 60 |
| 57 virtual void createIndex(long long transactionId, long long objectStoreId, l
ong long indexId, const WebString& name, const WebIDBKeyPath&, bool unique, bool
multiEntry) = 0; | 61 virtual void createIndex(long long transactionId, long long objectStoreId, l
ong long indexId, const WebString& name, const WebIDBKeyPath&, bool unique, bool
multiEntry) = 0; |
| 58 virtual void deleteIndex(long long transactionId, long long objectStoreId, l
ong long indexId) = 0; | 62 virtual void deleteIndex(long long transactionId, long long objectStoreId, l
ong long indexId) = 0; |
| 59 | 63 |
| 60 static const long long minimumIndexId = 30; | 64 static const long long minimumIndexId = 30; |
| 61 | 65 |
| 62 typedef WebVector<WebIDBKey> WebIndexKeys; | 66 typedef WebVector<WebIDBKey> WebIndexKeys; |
| 63 | 67 |
| 68 virtual int32_t addObserver(std::unique_ptr<WebIDBObserver>, long long trans
actionId) = 0; |
| 69 virtual bool containsObserverId(int32_t id) const = 0; |
| 70 virtual void removeObservers(const std::vector<int32_t>& observerIdsToRemove
) = 0; |
| 64 virtual void get(long long transactionId, long long objectStoreId, long long
indexId, const WebIDBKeyRange&, bool keyOnly, WebIDBCallbacks*) = 0; | 71 virtual void get(long long transactionId, long long objectStoreId, long long
indexId, const WebIDBKeyRange&, bool keyOnly, WebIDBCallbacks*) = 0; |
| 65 virtual void getAll(long long transactionId, long long objectStoreId, long l
ong indexId, const WebIDBKeyRange&, long long maxCount, bool keyOnly, WebIDBCall
backs*) = 0; | 72 virtual void getAll(long long transactionId, long long objectStoreId, long l
ong indexId, const WebIDBKeyRange&, long long maxCount, bool keyOnly, WebIDBCall
backs*) = 0; |
| 66 virtual void put(long long transactionId, long long objectStoreId, const Web
Data& value, const WebVector<WebBlobInfo>&, const WebIDBKey&, WebIDBPutMode, Web
IDBCallbacks*, const WebVector<long long>& indexIds, const WebVector<WebIndexKey
s>&) = 0; | 73 virtual void put(long long transactionId, long long objectStoreId, const Web
Data& value, const WebVector<WebBlobInfo>&, const WebIDBKey&, WebIDBPutMode, Web
IDBCallbacks*, const WebVector<long long>& indexIds, const WebVector<WebIndexKey
s>&) = 0; |
| 67 virtual void setIndexKeys(long long transactionId, long long objectStoreId,
const WebIDBKey&, const WebVector<long long>& indexIds, const WebVector<WebIndex
Keys>&) = 0; | 74 virtual void setIndexKeys(long long transactionId, long long objectStoreId,
const WebIDBKey&, const WebVector<long long>& indexIds, const WebVector<WebIndex
Keys>&) = 0; |
| 68 virtual void setIndexesReady(long long transactionId, long long objectStoreI
d, const WebVector<long long>& indexIds) = 0; | 75 virtual void setIndexesReady(long long transactionId, long long objectStoreI
d, const WebVector<long long>& indexIds) = 0; |
| 69 virtual void openCursor(long long transactionId, long long objectStoreId, lo
ng long indexId, const WebIDBKeyRange&, WebIDBCursorDirection, bool keyOnly, Web
IDBTaskType, WebIDBCallbacks*) = 0; | 76 virtual void openCursor(long long transactionId, long long objectStoreId, lo
ng long indexId, const WebIDBKeyRange&, WebIDBCursorDirection, bool keyOnly, Web
IDBTaskType, WebIDBCallbacks*) = 0; |
| 70 virtual void count(long long transactionId, long long objectStoreId, long lo
ng indexId, const WebIDBKeyRange&, WebIDBCallbacks*) = 0; | 77 virtual void count(long long transactionId, long long objectStoreId, long lo
ng indexId, const WebIDBKeyRange&, WebIDBCallbacks*) = 0; |
| 71 virtual void deleteRange(long long transactionId, long long objectStoreId, c
onst WebIDBKeyRange&, WebIDBCallbacks*) = 0; | 78 virtual void deleteRange(long long transactionId, long long objectStoreId, c
onst WebIDBKeyRange&, WebIDBCallbacks*) = 0; |
| 72 virtual void clear(long long transactionId, long long objectStoreId, WebIDBC
allbacks*) = 0; | 79 virtual void clear(long long transactionId, long long objectStoreId, WebIDBC
allbacks*) = 0; |
| 73 virtual void ackReceivedBlobs(const WebVector<WebString>& uuids) = 0; | 80 virtual void ackReceivedBlobs(const WebVector<WebString>& uuids) = 0; |
| 74 | 81 |
| 75 protected: | 82 protected: |
| 76 WebIDBDatabase() { } | 83 WebIDBDatabase() { } |
| 77 }; | 84 }; |
| 78 | 85 |
| 79 } // namespace blink | 86 } // namespace blink |
| 80 | 87 |
| 81 #endif // WebIDBDatabase_h | 88 #endif // WebIDBDatabase_h |
| OLD | NEW |