| 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 27 matching lines...) Expand all Loading... |
| 38 #include "modules/indexeddb/IDBHistograms.h" | 38 #include "modules/indexeddb/IDBHistograms.h" |
| 39 #include "modules/indexeddb/IDBMetadata.h" | 39 #include "modules/indexeddb/IDBMetadata.h" |
| 40 #include "modules/indexeddb/IDBObjectStore.h" | 40 #include "modules/indexeddb/IDBObjectStore.h" |
| 41 #include "modules/indexeddb/IDBObjectStoreParameters.h" | 41 #include "modules/indexeddb/IDBObjectStoreParameters.h" |
| 42 #include "modules/indexeddb/IDBTransaction.h" | 42 #include "modules/indexeddb/IDBTransaction.h" |
| 43 #include "modules/indexeddb/IndexedDB.h" | 43 #include "modules/indexeddb/IndexedDB.h" |
| 44 #include "platform/heap/Handle.h" | 44 #include "platform/heap/Handle.h" |
| 45 #include "public/platform/modules/indexeddb/WebIDBDatabase.h" | 45 #include "public/platform/modules/indexeddb/WebIDBDatabase.h" |
| 46 #include "wtf/PassRefPtr.h" | 46 #include "wtf/PassRefPtr.h" |
| 47 #include "wtf/RefPtr.h" | 47 #include "wtf/RefPtr.h" |
| 48 |
| 48 #include <memory> | 49 #include <memory> |
| 49 | 50 |
| 50 namespace blink { | 51 namespace blink { |
| 51 | 52 |
| 52 class DOMException; | 53 class DOMException; |
| 53 class ExceptionState; | 54 class ExceptionState; |
| 54 class ExecutionContext; | 55 class ExecutionContext; |
| 55 class IDBObserver; | 56 class IDBObserver; |
| 56 struct WebIDBObservation; | 57 struct WebIDBObservation; |
| 57 | 58 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); | 112 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); |
| 112 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 113 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
| 113 DEFINE_ATTRIBUTE_EVENT_LISTENER(versionchange); | 114 DEFINE_ATTRIBUTE_EVENT_LISTENER(versionchange); |
| 114 | 115 |
| 115 // IDBDatabaseCallbacks | 116 // IDBDatabaseCallbacks |
| 116 void onVersionChange(int64_t oldVersion, int64_t newVersion); | 117 void onVersionChange(int64_t oldVersion, int64_t newVersion); |
| 117 void onAbort(int64_t, DOMException*); | 118 void onAbort(int64_t, DOMException*); |
| 118 void onComplete(int64_t); | 119 void onComplete(int64_t); |
| 119 void onChanges(const std::unordered_map<int32_t, std::vector<int32_t>>& | 120 void onChanges(const std::unordered_map<int32_t, std::vector<int32_t>>& |
| 120 observation_index_map, | 121 observation_index_map, |
| 121 const WebVector<WebIDBObservation>& observations); | 122 const WebVector<WebIDBObservation>& observations, |
| 123 const IDBDatabaseCallbacks::TransactionMap& transactions); |
| 122 | 124 |
| 123 // ScriptWrappable | 125 // ScriptWrappable |
| 124 bool hasPendingActivity() const final; | 126 bool hasPendingActivity() const final; |
| 125 | 127 |
| 126 // ContextLifecycleObserver | 128 // ContextLifecycleObserver |
| 127 void contextDestroyed(ExecutionContext*) override; | 129 void contextDestroyed(ExecutionContext*) override; |
| 128 | 130 |
| 129 // EventTarget | 131 // EventTarget |
| 130 const AtomicString& interfaceName() const override; | 132 const AtomicString& interfaceName() const override; |
| 131 ExecutionContext* getExecutionContext() const override; | 133 ExecutionContext* getExecutionContext() const override; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 142 void renameObjectStore(int64_t storeId, const String& newName); | 144 void renameObjectStore(int64_t storeId, const String& newName); |
| 143 void revertObjectStoreCreation(int64_t objectStoreId); | 145 void revertObjectStoreCreation(int64_t objectStoreId); |
| 144 void revertObjectStoreMetadata(RefPtr<IDBObjectStoreMetadata> oldMetadata); | 146 void revertObjectStoreMetadata(RefPtr<IDBObjectStoreMetadata> oldMetadata); |
| 145 | 147 |
| 146 // Will return nullptr if this database is stopped. | 148 // Will return nullptr if this database is stopped. |
| 147 WebIDBDatabase* backend() const { return m_backend.get(); } | 149 WebIDBDatabase* backend() const { return m_backend.get(); } |
| 148 | 150 |
| 149 static int64_t nextTransactionId(); | 151 static int64_t nextTransactionId(); |
| 150 static int32_t nextObserverId(); | 152 static int32_t nextObserverId(); |
| 151 | 153 |
| 154 static const char cannotObserveVersionChangeTransaction[]; |
| 152 static const char indexDeletedErrorMessage[]; | 155 static const char indexDeletedErrorMessage[]; |
| 153 static const char indexNameTakenErrorMessage[]; | 156 static const char indexNameTakenErrorMessage[]; |
| 154 static const char isKeyCursorErrorMessage[]; | 157 static const char isKeyCursorErrorMessage[]; |
| 155 static const char noKeyOrKeyRangeErrorMessage[]; | 158 static const char noKeyOrKeyRangeErrorMessage[]; |
| 156 static const char noSuchIndexErrorMessage[]; | 159 static const char noSuchIndexErrorMessage[]; |
| 157 static const char noSuchObjectStoreErrorMessage[]; | 160 static const char noSuchObjectStoreErrorMessage[]; |
| 158 static const char noValueErrorMessage[]; | 161 static const char noValueErrorMessage[]; |
| 159 static const char notValidKeyErrorMessage[]; | 162 static const char notValidKeyErrorMessage[]; |
| 160 static const char notVersionChangeTransactionErrorMessage[]; | 163 static const char notVersionChangeTransactionErrorMessage[]; |
| 161 static const char objectStoreDeletedErrorMessage[]; | 164 static const char objectStoreDeletedErrorMessage[]; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 // Keep track of the versionchange events waiting to be fired on this | 198 // Keep track of the versionchange events waiting to be fired on this |
| 196 // database so that we can cancel them if the database closes. | 199 // database so that we can cancel them if the database closes. |
| 197 HeapVector<Member<Event>> m_enqueuedEvents; | 200 HeapVector<Member<Event>> m_enqueuedEvents; |
| 198 | 201 |
| 199 Member<IDBDatabaseCallbacks> m_databaseCallbacks; | 202 Member<IDBDatabaseCallbacks> m_databaseCallbacks; |
| 200 }; | 203 }; |
| 201 | 204 |
| 202 } // namespace blink | 205 } // namespace blink |
| 203 | 206 |
| 204 #endif // IDBDatabase_h | 207 #endif // IDBDatabase_h |
| OLD | NEW |