Title: [191598] trunk/Source/WebCore
Revision
191598
Author
beid...@apple.com
Date
2015-10-26 14:07:21 -0700 (Mon, 26 Oct 2015)

Log Message

Modern IDB: Backing store objectStores (plumbing for b/150468).
https://bugs.webkit.org/show_bug.cgi?id=150543

Reviewed by Alex Christensen.

No new tests (No change in behavior, plumbing for future testability)

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:

* Modules/indexeddb/server/IDBBackingStore.h:

* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::addNewObjectStore):
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
(WebCore::IDBServer::MemoryBackingStoreTransaction::commit):
(WebCore::IDBServer::MemoryBackingStoreTransaction::finish):
* Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
(WebCore::IDBServer::MemoryBackingStoreTransaction::isWriting):

* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:

* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::create):
(WebCore::IDBServer::MemoryObjectStore::MemoryObjectStore):
(WebCore::IDBServer::MemoryObjectStore::~MemoryObjectStore):
(WebCore::IDBServer::MemoryObjectStore::writeTransactionStarted):
(WebCore::IDBServer::MemoryObjectStore::writeTransactionFinished):
* Modules/indexeddb/server/MemoryObjectStore.h:
(WebCore::IDBServer::MemoryObjectStore::info):

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):

* Modules/indexeddb/shared/IDBError.cpp:
(WebCore::idbErrorName):
(WebCore::idbErrorDescription):
* Modules/indexeddb/shared/IDBError.h:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (191597 => 191598)


--- trunk/Source/WebCore/CMakeLists.txt	2015-10-26 20:16:53 UTC (rev 191597)
+++ trunk/Source/WebCore/CMakeLists.txt	2015-10-26 21:07:21 UTC (rev 191598)
@@ -902,6 +902,7 @@
     Modules/indexeddb/server/IDBServerOperation.cpp
     Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp
     Modules/indexeddb/server/MemoryIDBBackingStore.cpp
+    Modules/indexeddb/server/MemoryObjectStore.cpp
     Modules/indexeddb/server/UniqueIDBDatabase.cpp
     Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp
     Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp

Modified: trunk/Source/WebCore/ChangeLog (191597 => 191598)


--- trunk/Source/WebCore/ChangeLog	2015-10-26 20:16:53 UTC (rev 191597)
+++ trunk/Source/WebCore/ChangeLog	2015-10-26 21:07:21 UTC (rev 191598)
@@ -1,3 +1,47 @@
+2015-10-26  Brady Eidson  <beid...@apple.com>
+
+        Modern IDB: Backing store objectStores (plumbing for b/150468).
+        https://bugs.webkit.org/show_bug.cgi?id=150543
+
+        Reviewed by Alex Christensen.
+
+        No new tests (No change in behavior, plumbing for future testability)
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+
+        * Modules/indexeddb/server/IDBBackingStore.h:
+
+        * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::addNewObjectStore):
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::commit):
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::finish):
+        * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::isWriting):
+
+        * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
+        (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
+        (WebCore::IDBServer::MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort):
+        * Modules/indexeddb/server/MemoryIDBBackingStore.h:
+
+        * Modules/indexeddb/server/MemoryObjectStore.cpp:
+        (WebCore::IDBServer::MemoryObjectStore::create):
+        (WebCore::IDBServer::MemoryObjectStore::MemoryObjectStore):
+        (WebCore::IDBServer::MemoryObjectStore::~MemoryObjectStore):
+        (WebCore::IDBServer::MemoryObjectStore::writeTransactionStarted):
+        (WebCore::IDBServer::MemoryObjectStore::writeTransactionFinished):
+        * Modules/indexeddb/server/MemoryObjectStore.h:
+        (WebCore::IDBServer::MemoryObjectStore::info):
+
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
+
+        * Modules/indexeddb/shared/IDBError.cpp:
+        (WebCore::idbErrorName):
+        (WebCore::idbErrorDescription):
+        * Modules/indexeddb/shared/IDBError.h:
+
 2015-10-26  Jiewen Tan  <jiewen_...@apple.com>
 
         Null dereference loading Blink layout test editing/execCommand/indent-inline-box-crash.html

Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h (191597 => 191598)


--- trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h	2015-10-26 20:16:53 UTC (rev 191597)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h	2015-10-26 21:07:21 UTC (rev 191598)
@@ -33,6 +33,7 @@
 
 namespace WebCore {
 
+class IDBObjectStoreInfo;
 class IDBResourceIdentifier;
 class IDBTransactionInfo;
 
@@ -47,6 +48,8 @@
     virtual IDBError beginTransaction(const IDBTransactionInfo&) = 0;
     virtual IDBError abortTransaction(const IDBResourceIdentifier& transactionIdentifier) = 0;
     virtual IDBError commitTransaction(const IDBResourceIdentifier& transactionIdentifier) = 0;
+
+    virtual IDBError createObjectStore(const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo&) = 0;
 };
 
 } // namespace IDBServer

Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp (191597 => 191598)


--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp	2015-10-26 20:16:53 UTC (rev 191597)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp	2015-10-26 21:07:21 UTC (rev 191598)
@@ -31,6 +31,7 @@
 #include "IndexedDB.h"
 #include "Logging.h"
 #include "MemoryIDBBackingStore.h"
+#include "MemoryObjectStore.h"
 
 namespace WebCore {
 namespace IDBServer {
@@ -53,6 +54,19 @@
     ASSERT(!m_inProgress);
 }
 
+void MemoryBackingStoreTransaction::addNewObjectStore(MemoryObjectStore& objectStore)
+{
+    LOG(IndexedDB, "MemoryBackingStoreTransaction::addNewObjectStore()");
+
+    ASSERT(isVersionChange());
+
+    ASSERT(!m_objectStores.contains(&objectStore));
+    m_objectStores.add(&objectStore);
+    m_versionChangeAddedObjectStores.add(&objectStore);
+
+    objectStore.writeTransactionStarted(*this);
+}
+
 void MemoryBackingStoreTransaction::abort()
 {
     LOG(IndexedDB, "MemoryBackingStoreTransaction::abort()");
@@ -62,14 +76,28 @@
         m_backingStore.setDatabaseInfo(*m_originalDatabaseInfo);
     }
 
-    m_inProgress = false;
+    finish();
+
+    for (auto objectStore : m_versionChangeAddedObjectStores)
+        m_backingStore.removeObjectStoreForVersionChangeAbort(*objectStore);
 }
 
 void MemoryBackingStoreTransaction::commit()
 {
     LOG(IndexedDB, "MemoryBackingStoreTransaction::commit()");
 
+    finish();
+}
+
+void MemoryBackingStoreTransaction::finish()
+{
     m_inProgress = false;
+
+    if (!isWriting())
+        return;
+
+    for (auto objectStore : m_objectStores)
+        objectStore->writeTransactionFinished(*this);
 }
 
 } // namespace IDBServer

Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h (191597 => 191598)


--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h	2015-10-26 20:16:53 UTC (rev 191597)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h	2015-10-26 21:07:21 UTC (rev 191598)
@@ -30,11 +30,13 @@
 
 #include "IDBDatabaseInfo.h"
 #include "IDBTransactionInfo.h"
+#include <wtf/HashSet.h>
 
 namespace WebCore {
 namespace IDBServer {
 
 class MemoryIDBBackingStore;
+class MemoryObjectStore;
 
 class MemoryBackingStoreTransaction {
     friend std::unique_ptr<MemoryBackingStoreTransaction> std::make_unique<MemoryBackingStoreTransaction>(WebCore::IDBServer::MemoryIDBBackingStore&, const WebCore::IDBTransactionInfo&);
@@ -44,21 +46,30 @@
     ~MemoryBackingStoreTransaction();
 
     bool isVersionChange() const { return m_info.mode() == IndexedDB::TransactionMode::VersionChange; }
+    bool isWriting() const { return m_info.mode() != IndexedDB::TransactionMode::ReadOnly; }
 
     const IDBDatabaseInfo& originalDatabaseInfo() const;
 
+    void addNewObjectStore(MemoryObjectStore&);
+
     void abort();
     void commit();
 
 private:
     MemoryBackingStoreTransaction(MemoryIDBBackingStore&, const IDBTransactionInfo&);
 
+    void finish();
+
     MemoryIDBBackingStore& m_backingStore;
     IDBTransactionInfo m_info;
 
     std::unique_ptr<IDBDatabaseInfo> m_originalDatabaseInfo;
 
     bool m_inProgress { true };
+
+    HashSet<MemoryObjectStore*> m_objectStores;
+    HashSet<MemoryObjectStore*> m_versionChangeAddedObjectStores;
+
 };
 
 } // namespace IDBServer

Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp (191597 => 191598)


--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp	2015-10-26 20:16:53 UTC (rev 191597)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp	2015-10-26 21:07:21 UTC (rev 191598)
@@ -29,6 +29,7 @@
 #if ENABLE(INDEXED_DATABASE)
 
 #include "Logging.h"
+#include "MemoryObjectStore.h"
 
 namespace WebCore {
 namespace IDBServer {
@@ -102,6 +103,39 @@
     return IDBError();
 }
 
+IDBError MemoryIDBBackingStore::createObjectStore(const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo& info)
+{
+    LOG(IndexedDB, "MemoryIDBBackingStore::createObjectStore");
+
+    ASSERT(m_databaseInfo);
+    if (m_databaseInfo->hasObjectStore(info.name()))
+        return IDBError(IDBExceptionCode::ConstraintError);
+
+    ASSERT(!m_objectStores.contains(info.identifier()));
+    auto objectStore = MemoryObjectStore::create(info);
+
+    m_databaseInfo->addExistingObjectStore(info);
+
+    auto rawTransaction = m_transactions.get(transactionIdentifier);
+    ASSERT(rawTransaction);
+    ASSERT(rawTransaction->isVersionChange());
+
+    rawTransaction->addNewObjectStore(*objectStore);
+    m_objectStores.set(info.identifier(), WTF::move(objectStore));
+
+    return IDBError();
+}
+
+void MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort(MemoryObjectStore& objectStore)
+{
+    LOG(IndexedDB, "MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort");
+
+    ASSERT(m_objectStores.contains(objectStore.info().identifier()));
+    ASSERT(m_objectStores.get(objectStore.info().identifier()) == &objectStore);
+
+    m_objectStores.remove(objectStore.info().identifier());
+}
+
 } // namespace IDBServer
 } // namespace WebCore
 

Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h (191597 => 191598)


--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h	2015-10-26 20:16:53 UTC (rev 191597)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h	2015-10-26 21:07:21 UTC (rev 191598)
@@ -37,6 +37,8 @@
 namespace WebCore {
 namespace IDBServer {
 
+class MemoryObjectStore;
+
 class MemoryIDBBackingStore : public IDBBackingStore {
     friend std::unique_ptr<MemoryIDBBackingStore> std::make_unique<MemoryIDBBackingStore>(const WebCore::IDBDatabaseIdentifier&);
 public:
@@ -50,7 +52,10 @@
     virtual IDBError beginTransaction(const IDBTransactionInfo&) override final;
     virtual IDBError abortTransaction(const IDBResourceIdentifier& transactionIdentifier) override final;
     virtual IDBError commitTransaction(const IDBResourceIdentifier& transactionIdentifier) override final;
+    virtual IDBError createObjectStore(const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo&) override final;
 
+    void removeObjectStoreForVersionChangeAbort(MemoryObjectStore&);
+
 private:
     MemoryIDBBackingStore(const IDBDatabaseIdentifier&);
 
@@ -58,7 +63,7 @@
     std::unique_ptr<IDBDatabaseInfo> m_databaseInfo;
 
     HashMap<IDBResourceIdentifier, std::unique_ptr<MemoryBackingStoreTransaction>> m_transactions;
-
+    HashMap<uint64_t, std::unique_ptr<MemoryObjectStore>> m_objectStores;
 };
 
 } // namespace IDBServer

Copied: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp (from rev 191597, trunk/Source/WebCore/Modules/indexeddb/shared/IDBError.h) (0 => 191598)


--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp	2015-10-26 21:07:21 UTC (rev 191598)
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "MemoryObjectStore.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "Logging.h"
+
+namespace WebCore {
+namespace IDBServer {
+
+std::unique_ptr<MemoryObjectStore> MemoryObjectStore::create(const IDBObjectStoreInfo& info)
+{
+    return std::make_unique<MemoryObjectStore>(info);
+}
+
+MemoryObjectStore::MemoryObjectStore(const IDBObjectStoreInfo& info)
+    : m_info(info)
+{
+}
+
+MemoryObjectStore::~MemoryObjectStore()
+{
+    ASSERT(!m_writeTransaction);
+}
+
+void MemoryObjectStore::writeTransactionStarted(MemoryBackingStoreTransaction& transaction)
+{
+    LOG(IndexedDB, "MemoryObjectStore::writeTransactionStarted");
+
+    ASSERT(!m_writeTransaction);
+    m_writeTransaction = &transaction;
+}
+
+void MemoryObjectStore::writeTransactionFinished(MemoryBackingStoreTransaction& transaction)
+{
+    LOG(IndexedDB, "MemoryObjectStore::writeTransactionFinished");
+
+    ASSERT_UNUSED(transaction, m_writeTransaction == &transaction);
+    m_writeTransaction = nullptr;
+}
+
+} // namespace IDBServer
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)

Copied: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h (from rev 191597, trunk/Source/WebCore/Modules/indexeddb/shared/IDBError.h) (0 => 191598)


--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h	2015-10-26 21:07:21 UTC (rev 191598)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MemoryObjectStore_h
+#define MemoryObjectStore_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBObjectStoreInfo.h"
+
+namespace WebCore {
+namespace IDBServer {
+
+class MemoryBackingStoreTransaction;
+
+class MemoryObjectStore {
+    friend std::unique_ptr<MemoryObjectStore> std::make_unique<MemoryObjectStore>(const WebCore::IDBObjectStoreInfo&);
+public:
+    static std::unique_ptr<MemoryObjectStore> create(const IDBObjectStoreInfo&);
+
+    ~MemoryObjectStore();
+
+    void writeTransactionStarted(MemoryBackingStoreTransaction&);
+    void writeTransactionFinished(MemoryBackingStoreTransaction&);
+
+    const IDBObjectStoreInfo& info() const { return m_info; }
+
+private:
+    MemoryObjectStore(const IDBObjectStoreInfo&);
+
+    IDBObjectStoreInfo m_info;
+
+    MemoryBackingStoreTransaction* m_writeTransaction { nullptr };
+};
+
+} // namespace IDBServer
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+#endif // MemoryObjectStore_h

Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (191597 => 191598)


--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp	2015-10-26 20:16:53 UTC (rev 191597)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp	2015-10-26 21:07:21 UTC (rev 191598)
@@ -222,6 +222,9 @@
     ASSERT(isMainThread());
     LOG(IndexedDB, "(main) UniqueIDBDatabase::createObjectStore");
 
+    ASSERT(m_backingStore);
+    m_backingStore->createObjectStore(transaction.info().identifier(), info);
+
     uint64_t callbackID = storeCallback(callback);
     m_server.postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performCreateObjectStore, callbackID, transaction.info().identifier(), info));
 }

Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBError.cpp (191597 => 191598)


--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBError.cpp	2015-10-26 20:16:53 UTC (rev 191597)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBError.cpp	2015-10-26 21:07:21 UTC (rev 191598)
@@ -39,6 +39,10 @@
         static NeverDestroyed<String> entry = ASCIILiteral("UnknownError");
         return entry;
     }
+    case IDBExceptionCode::ConstraintError: {
+        static NeverDestroyed<String> entry = ASCIILiteral("ConstraintError");
+        return entry;
+    }
     case IDBExceptionCode::VersionError: {
         static NeverDestroyed<String> entry = ASCIILiteral("VersionError");
         return entry;
@@ -61,6 +65,10 @@
         static NeverDestroyed<String> entry = ASCIILiteral("Operation failed for reasons unrelated to the database itself and not covered by any other errors.");
         return entry.get();
     }
+    case IDBExceptionCode::ConstraintError: {
+        static NeverDestroyed<String> entry = ASCIILiteral("Mutation operation in the transaction failed because a constraint was not satisfied.");
+        return entry.get();
+    }
     case IDBExceptionCode::VersionError: {
         static NeverDestroyed<String> entry = ASCIILiteral("An attempt was made to open a database using a lower version than the existing version.");
         return entry.get();

Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBError.h (191597 => 191598)


--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBError.h	2015-10-26 20:16:53 UTC (rev 191597)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBError.h	2015-10-26 21:07:21 UTC (rev 191598)
@@ -35,6 +35,7 @@
 enum class IDBExceptionCode {
     None = 0,
     Unknown,
+    ConstraintError,
     VersionError,
 
     // Indexed DB existing exception codes with IDB-specific error messages:

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (191597 => 191598)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-10-26 20:16:53 UTC (rev 191597)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-10-26 21:07:21 UTC (rev 191598)
@@ -2051,6 +2051,8 @@
 		51741D110B07259A00ED442C /* HistoryItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 51741D0D0B07259A00ED442C /* HistoryItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		51741D120B07259A00ED442C /* HistoryItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51741D0E0B07259A00ED442C /* HistoryItem.cpp */; };
 		5174E20A10A1F44F00F95E6F /* PopStateEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 5174E20810A1F44F00F95E6F /* PopStateEvent.h */; };
+		51771DFE1BDB485000CAE8E4 /* MemoryObjectStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51771DFC1BDB475600CAE8E4 /* MemoryObjectStore.cpp */; };
+		51771DFF1BDB485000CAE8E4 /* MemoryObjectStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 51771DFD1BDB475600CAE8E4 /* MemoryObjectStore.h */; };
 		5179CE24195C81420019C198 /* GamepadProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 5179CE23195C81420019C198 /* GamepadProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		5179CE26195C821D0019C198 /* GamepadProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5179CE25195C821D0019C198 /* GamepadProvider.cpp */; };
 		5179CE2A195C91860019C198 /* GamepadProviderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 5179CE29195C91860019C198 /* GamepadProviderClient.h */; };
@@ -9472,6 +9474,8 @@
 		51741D0E0B07259A00ED442C /* HistoryItem.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HistoryItem.cpp; sourceTree = "<group>"; };
 		5174E20810A1F44F00F95E6F /* PopStateEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PopStateEvent.h; sourceTree = "<group>"; };
 		5174E20B10A1F49A00F95E6F /* PopStateEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PopStateEvent.idl; sourceTree = "<group>"; };
+		51771DFC1BDB475600CAE8E4 /* MemoryObjectStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryObjectStore.cpp; sourceTree = "<group>"; };
+		51771DFD1BDB475600CAE8E4 /* MemoryObjectStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryObjectStore.h; sourceTree = "<group>"; };
 		5179CE23195C81420019C198 /* GamepadProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GamepadProvider.h; sourceTree = "<group>"; };
 		5179CE25195C821D0019C198 /* GamepadProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GamepadProvider.cpp; sourceTree = "<group>"; };
 		5179CE29195C91860019C198 /* GamepadProviderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GamepadProviderClient.h; sourceTree = "<group>"; };
@@ -16844,6 +16848,8 @@
 				51E1BAC11BD806470055D81F /* MemoryBackingStoreTransaction.h */,
 				51BA4AC81BBC5B9E00DF3D6D /* MemoryIDBBackingStore.cpp */,
 				51BA4AC91BBC5B9E00DF3D6D /* MemoryIDBBackingStore.h */,
+				51771DFC1BDB475600CAE8E4 /* MemoryObjectStore.cpp */,
+				51771DFD1BDB475600CAE8E4 /* MemoryObjectStore.h */,
 				518864DE1BBAF30F00E540C9 /* UniqueIDBDatabase.cpp */,
 				518864DF1BBAF30F00E540C9 /* UniqueIDBDatabase.h */,
 				5198F7A21BBDAA2900E2CC5F /* UniqueIDBDatabaseConnection.cpp */,
@@ -24899,6 +24905,7 @@
 				85031B3E0A44EFC700F992E0 /* DataTransfer.h in Headers */,
 				4B8AF4AA0B1CE02B00687690 /* DataTransferAccessPolicy.h in Headers */,
 				81AC5999131636E60009A7E0 /* DataTransferItem.h in Headers */,
+				51771DFF1BDB485000CAE8E4 /* MemoryObjectStore.h in Headers */,
 				81AC599A131636E60009A7E0 /* DataTransferItemList.h in Headers */,
 				E4A007831B820EC8002C5A6E /* DataURLDecoder.h in Headers */,
 				E4A007831B820EC8002C5A6E /* DataURLDecoder.h in Headers */,
@@ -28539,6 +28546,7 @@
 				BCC0657D0F3CE1B700CD2D87 /* ClientRect.cpp in Sources */,
 				BCC065800F3CE1B700CD2D87 /* ClientRectList.cpp in Sources */,
 				85031B3F0A44EFC700F992E0 /* ClipboardEvent.cpp in Sources */,
+				51771DFE1BDB485000CAE8E4 /* MemoryObjectStore.cpp in Sources */,
 				580371611A66F00A00BAF519 /* ClipRect.cpp in Sources */,
 				CDEA76351460B71A008B31F1 /* Clock.cpp in Sources */,
 				CDEA76341460B56F008B31F1 /* ClockGeneric.cpp in Sources */,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to