Address style feedback in https://bugs.webkit.org/show_bug.cgi?id=164097
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Nov 2016 00:46:52 +0000 (00:46 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Nov 2016 00:46:52 +0000 (00:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=164248

Unreviewed. Addressing review feedback (and then some) from Darin Adler on earlier patch.

No new tests (No behavior change).

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::commit):
(WebCore::IDBTransaction::createObjectStore):
(WebCore::IDBTransaction::renameObjectStore):
(WebCore::IDBTransaction::createIndex):
(WebCore::IDBTransaction::renameIndex):
(WebCore::IDBTransaction::requestOpenCursor):
(WebCore::IDBTransaction::doRequestOpenCursor):
(WebCore::IDBTransaction::iterateCursor):
(WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
(WebCore::IDBTransaction::requestGetRecord):
(WebCore::IDBTransaction::requestGetValue):
(WebCore::IDBTransaction::requestGetKey):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::requestCount):
(WebCore::IDBTransaction::requestDeleteRecord):
(WebCore::IDBTransaction::requestClearObjectStore):
(WebCore::IDBTransaction::requestPutOrAdd):
(WebCore::IDBTransaction::deleteObjectStore):
(WebCore::IDBTransaction::deleteIndex):

* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::createObjectStore):
(WebCore::IDBClient::IDBConnectionProxy::renameObjectStore):
(WebCore::IDBClient::IDBConnectionProxy::renameIndex):
(WebCore::IDBClient::IDBConnectionProxy::deleteObjectStore):
(WebCore::IDBClient::IDBConnectionProxy::clearObjectStore):
(WebCore::IDBClient::IDBConnectionProxy::createIndex):
(WebCore::IDBClient::IDBConnectionProxy::deleteIndex):
(WebCore::IDBClient::IDBConnectionProxy::putOrAdd):
(WebCore::IDBClient::IDBConnectionProxy::getRecord):
(WebCore::IDBClient::IDBConnectionProxy::getAllRecords):
(WebCore::IDBClient::IDBConnectionProxy::getCount):
(WebCore::IDBClient::IDBConnectionProxy::deleteRecord):
(WebCore::IDBClient::IDBConnectionProxy::openCursor):
(WebCore::IDBClient::IDBConnectionProxy::iterateCursor):

* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
(WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
(WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getCount):
(WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber):
(WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
(WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):

* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::error):
(WebCore::IDBResultData::openDatabaseSuccess):
(WebCore::IDBResultData::openDatabaseUpgradeNeeded):
(WebCore::IDBResultData::deleteDatabaseSuccess):
(WebCore::IDBResultData::putOrAddSuccess):
(WebCore::IDBResultData::getRecordSuccess):
(WebCore::IDBResultData::getAllRecordsSuccess):
(WebCore::IDBResultData::getCountSuccess):
(WebCore::IDBResultData::openCursorSuccess):
(WebCore::IDBResultData::iterateCursorSuccess):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208203 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp
Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp
Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp

index a15b1e2..e7d6bfe 100644 (file)
@@ -1,3 +1,83 @@
+2016-10-31  Brady Eidson  <beidson@apple.com>
+
+        Address style feedback in https://bugs.webkit.org/show_bug.cgi?id=164097
+        https://bugs.webkit.org/show_bug.cgi?id=164248
+
+        Unreviewed. Addressing review feedback (and then some) from Darin Adler on earlier patch.
+
+        No new tests (No behavior change).
+
+        * Modules/indexeddb/IDBTransaction.cpp:
+        (WebCore::IDBTransaction::commit):
+        (WebCore::IDBTransaction::createObjectStore):
+        (WebCore::IDBTransaction::renameObjectStore):
+        (WebCore::IDBTransaction::createIndex):
+        (WebCore::IDBTransaction::renameIndex):
+        (WebCore::IDBTransaction::requestOpenCursor):
+        (WebCore::IDBTransaction::doRequestOpenCursor):
+        (WebCore::IDBTransaction::iterateCursor):
+        (WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
+        (WebCore::IDBTransaction::requestGetRecord):
+        (WebCore::IDBTransaction::requestGetValue):
+        (WebCore::IDBTransaction::requestGetKey):
+        (WebCore::IDBTransaction::requestIndexRecord):
+        (WebCore::IDBTransaction::requestCount):
+        (WebCore::IDBTransaction::requestDeleteRecord):
+        (WebCore::IDBTransaction::requestClearObjectStore):
+        (WebCore::IDBTransaction::requestPutOrAdd):
+        (WebCore::IDBTransaction::deleteObjectStore):
+        (WebCore::IDBTransaction::deleteIndex):
+
+        * Modules/indexeddb/client/IDBConnectionProxy.cpp:
+        (WebCore::IDBClient::IDBConnectionProxy::createObjectStore):
+        (WebCore::IDBClient::IDBConnectionProxy::renameObjectStore):
+        (WebCore::IDBClient::IDBConnectionProxy::renameIndex):
+        (WebCore::IDBClient::IDBConnectionProxy::deleteObjectStore):
+        (WebCore::IDBClient::IDBConnectionProxy::clearObjectStore):
+        (WebCore::IDBClient::IDBConnectionProxy::createIndex):
+        (WebCore::IDBClient::IDBConnectionProxy::deleteIndex):
+        (WebCore::IDBClient::IDBConnectionProxy::putOrAdd):
+        (WebCore::IDBClient::IDBConnectionProxy::getRecord):
+        (WebCore::IDBClient::IDBConnectionProxy::getAllRecords):
+        (WebCore::IDBClient::IDBConnectionProxy::getCount):
+        (WebCore::IDBClient::IDBConnectionProxy::deleteRecord):
+        (WebCore::IDBClient::IDBConnectionProxy::openCursor):
+        (WebCore::IDBClient::IDBConnectionProxy::iterateCursor):
+
+        * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
+        (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
+        (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
+        (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
+        (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
+        (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
+        (WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
+        (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
+        (WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
+        (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
+        (WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
+        (WebCore::IDBServer::MemoryIDBBackingStore::keyExistsInObjectStore):
+        (WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
+        (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
+        (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
+        (WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
+        (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
+        (WebCore::IDBServer::MemoryIDBBackingStore::getCount):
+        (WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber):
+        (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
+        (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
+
+        * Modules/indexeddb/shared/IDBResultData.cpp:
+        (WebCore::IDBResultData::error):
+        (WebCore::IDBResultData::openDatabaseSuccess):
+        (WebCore::IDBResultData::openDatabaseUpgradeNeeded):
+        (WebCore::IDBResultData::deleteDatabaseSuccess):
+        (WebCore::IDBResultData::putOrAddSuccess):
+        (WebCore::IDBResultData::getRecordSuccess):
+        (WebCore::IDBResultData::getAllRecordsSuccess):
+        (WebCore::IDBResultData::getCountSuccess):
+        (WebCore::IDBResultData::openCursorSuccess):
+        (WebCore::IDBResultData::iterateCursorSuccess):
+
 2016-10-31  Ryosuke Niwa  <rniwa@webkit.org>
 
         Enable custom elements by default everywhere
index df67a20..6f94345 100644 (file)
@@ -366,8 +366,7 @@ void IDBTransaction::commit()
     transitionedToFinishing(IndexedDB::TransactionState::Committing);
     m_database->willCommitTransaction(*this);
 
-    auto operation = IDBClient::createTransactionOperation(*this, nullptr, &IDBTransaction::commitOnServer);
-    scheduleOperation(WTFMove(operation));
+    scheduleOperation(IDBClient::createTransactionOperation(*this, nullptr, &IDBTransaction::commitOnServer));
 }
 
 void IDBTransaction::commitOnServer(IDBClient::TransactionOperation& operation)
@@ -521,8 +520,7 @@ Ref<IDBObjectStore> IDBTransaction::createObjectStore(const IDBObjectStoreInfo&
     Ref<IDBObjectStore> objectStore = IDBObjectStore::create(*scriptExecutionContext(), info, *this);
     m_referencedObjectStores.set(info.name(), &objectStore.get());
 
-    auto operation = IDBClient::createTransactionOperation(*this, &IDBTransaction::didCreateObjectStoreOnServer, &IDBTransaction::createObjectStoreOnServer, info);
-    scheduleOperation(WTFMove(operation));
+    scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didCreateObjectStoreOnServer, &IDBTransaction::createObjectStoreOnServer, info));
 
     return objectStore;
 }
@@ -555,8 +553,7 @@ void IDBTransaction::renameObjectStore(IDBObjectStore& objectStore, const String
     ASSERT(m_referencedObjectStores.get(objectStore.info().name()) == &objectStore);
 
     uint64_t objectStoreIdentifier = objectStore.info().identifier();
-    auto operation = IDBClient::createTransactionOperation(*this, &IDBTransaction::didRenameObjectStoreOnServer, &IDBTransaction::renameObjectStoreOnServer, objectStoreIdentifier, newName);
-    scheduleOperation(WTFMove(operation));
+    scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didRenameObjectStoreOnServer, &IDBTransaction::renameObjectStoreOnServer, objectStoreIdentifier, newName));
 
     m_referencedObjectStores.set(newName, m_referencedObjectStores.take(objectStore.info().name()));
 }
@@ -586,8 +583,7 @@ std::unique_ptr<IDBIndex> IDBTransaction::createIndex(IDBObjectStore& objectStor
     if (!scriptExecutionContext())
         return nullptr;
 
-    auto operation = IDBClient::createTransactionOperation(*this, &IDBTransaction::didCreateIndexOnServer, &IDBTransaction::createIndexOnServer, info);
-    scheduleOperation(WTFMove(operation));
+    scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didCreateIndexOnServer, &IDBTransaction::createIndexOnServer, info));
 
     return std::make_unique<IDBIndex>(*scriptExecutionContext(), info, objectStore);
 }
@@ -633,8 +629,7 @@ void IDBTransaction::renameIndex(IDBIndex& index, const String& newName)
 
     uint64_t objectStoreIdentifier = index.objectStore().info().identifier();
     uint64_t indexIdentifier = index.info().identifier();
-    auto operation = IDBClient::createTransactionOperation(*this, &IDBTransaction::didRenameIndexOnServer, &IDBTransaction::renameIndexOnServer, objectStoreIdentifier, indexIdentifier, newName);
-    scheduleOperation(WTFMove(operation));
+    scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didRenameIndexOnServer, &IDBTransaction::renameIndexOnServer, objectStoreIdentifier, indexIdentifier, newName));
 }
 
 void IDBTransaction::renameIndexOnServer(IDBClient::TransactionOperation& operation, const uint64_t& objectStoreIdentifier, const uint64_t& indexIdentifier, const String& newName)
@@ -653,41 +648,39 @@ void IDBTransaction::didRenameIndexOnServer(const IDBResultData& resultData)
     ASSERT_UNUSED(resultData, resultData.type() == IDBResultType::RenameIndexSuccess || resultData.type() == IDBResultType::Error);
 }
 
-Ref<IDBRequest> IDBTransaction::requestOpenCursor(ExecState& execState, IDBObjectStore& objectStore, const IDBCursorInfo& info)
+Ref<IDBRequest> IDBTransaction::requestOpenCursor(ExecState& state, IDBObjectStore& objectStore, const IDBCursorInfo& info)
 {
     LOG(IndexedDB, "IDBTransaction::requestOpenCursor");
     ASSERT(currentThread() == m_database->originThreadID());
 
     if (info.cursorType() == IndexedDB::CursorType::KeyOnly)
-        return doRequestOpenCursor(execState, IDBCursor::create(*this, objectStore, info));
+        return doRequestOpenCursor(state, IDBCursor::create(*this, objectStore, info));
 
-    return doRequestOpenCursor(execState, IDBCursorWithValue::create(*this, objectStore, info));
+    return doRequestOpenCursor(state, IDBCursorWithValue::create(*this, objectStore, info));
 }
 
-Ref<IDBRequest> IDBTransaction::requestOpenCursor(ExecState& execState, IDBIndex& index, const IDBCursorInfo& info)
+Ref<IDBRequest> IDBTransaction::requestOpenCursor(ExecState& state, IDBIndex& index, const IDBCursorInfo& info)
 {
     LOG(IndexedDB, "IDBTransaction::requestOpenCursor");
     ASSERT(currentThread() == m_database->originThreadID());
 
     if (info.cursorType() == IndexedDB::CursorType::KeyOnly)
-        return doRequestOpenCursor(execState, IDBCursor::create(*this, index, info));
+        return doRequestOpenCursor(state, IDBCursor::create(*this, index, info));
 
-    return doRequestOpenCursor(execState, IDBCursorWithValue::create(*this, index, info));
+    return doRequestOpenCursor(state, IDBCursorWithValue::create(*this, index, info));
 }
 
-Ref<IDBRequest> IDBTransaction::doRequestOpenCursor(ExecState& execState, Ref<IDBCursor>&& cursor)
+Ref<IDBRequest> IDBTransaction::doRequestOpenCursor(ExecState& state, Ref<IDBCursor>&& cursor)
 {
     ASSERT(isActive());
     ASSERT(currentThread() == m_database->originThreadID());
 
-    RELEASE_ASSERT(scriptExecutionContext());
-    ASSERT_UNUSED(execState, scriptExecutionContext() == scriptExecutionContextFromExecState(&execState));
+    ASSERT_UNUSED(state, scriptExecutionContext() == scriptExecutionContextFromExecState(&state));
 
-    Ref<IDBRequest> request = IDBRequest::create(*scriptExecutionContext(), cursor.get(), *this);
+    auto request = IDBRequest::create(*scriptExecutionContext(), cursor.get(), *this);
     addRequest(request.get());
 
-    auto operation = IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didOpenCursorOnServer, &IDBTransaction::openCursorOnServer, cursor->info());
-    scheduleOperation(WTFMove(operation));
+    scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didOpenCursorOnServer, &IDBTransaction::openCursorOnServer, cursor->info()));
 
     return request;
 }
@@ -717,8 +710,7 @@ void IDBTransaction::iterateCursor(IDBCursor& cursor, const IDBKeyData& key, uns
 
     addRequest(*cursor.request());
 
-    auto operation = IDBClient::createTransactionOperation(*this, *cursor.request(), &IDBTransaction::didIterateCursorOnServer, &IDBTransaction::iterateCursorOnServer, key, count);
-    scheduleOperation(WTFMove(operation));
+    scheduleOperation(IDBClient::createTransactionOperation(*this, *cursor.request(), &IDBTransaction::didIterateCursorOnServer, &IDBTransaction::iterateCursorOnServer, key, count));
 }
 
 void IDBTransaction::iterateCursorOnServer(IDBClient::TransactionOperation& operation, const IDBKeyData& key, const unsigned long& count)
@@ -745,13 +737,12 @@ Ref<IDBRequest> IDBTransaction::requestGetAllObjectStoreRecords(JSC::ExecState&
 
     ASSERT_UNUSED(state, scriptExecutionContext() == scriptExecutionContextFromExecState(&state));
 
-    Ref<IDBRequest> request = IDBRequest::create(*scriptExecutionContext(), objectStore, *this);
+    auto request = IDBRequest::create(*scriptExecutionContext(), objectStore, *this);
     addRequest(request.get());
 
     IDBGetAllRecordsData getAllRecordsData { keyRangeData, getAllType, count, objectStore.info().identifier(), 0 };
 
-    auto operation = IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetAllRecordsOnServer, &IDBTransaction::getAllRecordsOnServer, getAllRecordsData);
-    scheduleOperation(WTFMove(operation));
+    scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetAllRecordsOnServer, &IDBTransaction::getAllRecordsOnServer, getAllRecordsData));
 
     return request;
 }
@@ -789,57 +780,53 @@ void IDBTransaction::didGetAllRecordsOnServer(IDBRequest& request, const IDBResu
     request.requestCompleted(resultData);
 }
 
-Ref<IDBRequest> IDBTransaction::requestGetRecord(ExecState& execState, IDBObjectStore& objectStore, const IDBGetRecordData& getRecordData)
+Ref<IDBRequest> IDBTransaction::requestGetRecord(ExecState& state, IDBObjectStore& objectStore, const IDBGetRecordData& getRecordData)
 {
     LOG(IndexedDB, "IDBTransaction::requestGetRecord");
     ASSERT(isActive());
     ASSERT(!getRecordData.keyRangeData.isNull);
     ASSERT(currentThread() == m_database->originThreadID());
 
-    RELEASE_ASSERT(scriptExecutionContext());
-    ASSERT_UNUSED(execState, scriptExecutionContext() == scriptExecutionContextFromExecState(&execState));
+    ASSERT_UNUSED(state, scriptExecutionContext() == scriptExecutionContextFromExecState(&state));
 
-    Ref<IDBRequest> request = IDBRequest::create(*scriptExecutionContext(), objectStore, *this);
+    auto request = IDBRequest::create(*scriptExecutionContext(), objectStore, *this);
     addRequest(request.get());
 
-    auto operation = IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetRecordOnServer, &IDBTransaction::getRecordOnServer, getRecordData);
-    scheduleOperation(WTFMove(operation));
+    scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetRecordOnServer, &IDBTransaction::getRecordOnServer, getRecordData));
 
     return request;
 }
 
-Ref<IDBRequest> IDBTransaction::requestGetValue(ExecState& execState, IDBIndex& index, const IDBKeyRangeData& range)
+Ref<IDBRequest> IDBTransaction::requestGetValue(ExecState& state, IDBIndex& index, const IDBKeyRangeData& range)
 {
     LOG(IndexedDB, "IDBTransaction::requestGetValue");
     ASSERT(currentThread() == m_database->originThreadID());
 
-    return requestIndexRecord(execState, index, IndexedDB::IndexRecordType::Value, range);
+    return requestIndexRecord(state, index, IndexedDB::IndexRecordType::Value, range);
 }
 
-Ref<IDBRequest> IDBTransaction::requestGetKey(ExecState& execState, IDBIndex& index, const IDBKeyRangeData& range)
+Ref<IDBRequest> IDBTransaction::requestGetKey(ExecState& state, IDBIndex& index, const IDBKeyRangeData& range)
 {
     LOG(IndexedDB, "IDBTransaction::requestGetValue");
     ASSERT(currentThread() == m_database->originThreadID());
 
-    return requestIndexRecord(execState, index, IndexedDB::IndexRecordType::Key, range);
+    return requestIndexRecord(state, index, IndexedDB::IndexRecordType::Key, range);
 }
 
-Ref<IDBRequest> IDBTransaction::requestIndexRecord(ExecState& execState, IDBIndex& index, IndexedDB::IndexRecordType type, const IDBKeyRangeData& range)
+Ref<IDBRequest> IDBTransaction::requestIndexRecord(ExecState& state, IDBIndex& index, IndexedDB::IndexRecordType type, const IDBKeyRangeData& range)
 {
     LOG(IndexedDB, "IDBTransaction::requestGetValue");
     ASSERT(isActive());
     ASSERT(!range.isNull);
     ASSERT(currentThread() == m_database->originThreadID());
 
-    RELEASE_ASSERT(scriptExecutionContext());
-    ASSERT_UNUSED(execState, scriptExecutionContext() == scriptExecutionContextFromExecState(&execState));
+    ASSERT_UNUSED(state, scriptExecutionContext() == scriptExecutionContextFromExecState(&state));
 
-    Ref<IDBRequest> request = IDBRequest::createGet(*scriptExecutionContext(), index, type, *this);
+    auto request = IDBRequest::createGet(*scriptExecutionContext(), index, type, *this);
     addRequest(request.get());
 
     IDBGetRecordData getRecordData = { range };
-    auto operation = IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetRecordOnServer, &IDBTransaction::getRecordOnServer, getRecordData);
-    scheduleOperation(WTFMove(operation));
+    scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetRecordOnServer, &IDBTransaction::getRecordOnServer, getRecordData));
 
     return request;
 }
@@ -881,17 +868,16 @@ void IDBTransaction::didGetRecordOnServer(IDBRequest& request, const IDBResultDa
     request.requestCompleted(resultData);
 }
 
-Ref<IDBRequest> IDBTransaction::requestCount(ExecState& execState, IDBObjectStore& objectStore, const IDBKeyRangeData& range)
+Ref<IDBRequest> IDBTransaction::requestCount(ExecState& state, IDBObjectStore& objectStore, const IDBKeyRangeData& range)
 {
     LOG(IndexedDB, "IDBTransaction::requestCount (IDBObjectStore)");
     ASSERT(isActive());
     ASSERT(!range.isNull);
     ASSERT(currentThread() == m_database->originThreadID());
 
-    RELEASE_ASSERT(scriptExecutionContext());
-    ASSERT_UNUSED(execState, scriptExecutionContext() == scriptExecutionContextFromExecState(&execState));
+    ASSERT_UNUSED(state, scriptExecutionContext() == scriptExecutionContextFromExecState(&state));
 
-    Ref<IDBRequest> request = IDBRequest::create(*scriptExecutionContext(), objectStore, *this);
+    auto request = IDBRequest::create(*scriptExecutionContext(), objectStore, *this);
     addRequest(request.get());
 
     scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetCountOnServer, &IDBTransaction::getCountOnServer, range));
@@ -899,17 +885,16 @@ Ref<IDBRequest> IDBTransaction::requestCount(ExecState& execState, IDBObjectStor
     return request;
 }
 
-Ref<IDBRequest> IDBTransaction::requestCount(ExecState& execState, IDBIndex& index, const IDBKeyRangeData& range)
+Ref<IDBRequest> IDBTransaction::requestCount(ExecState& state, IDBIndex& index, const IDBKeyRangeData& range)
 {
     LOG(IndexedDB, "IDBTransaction::requestCount (IDBIndex)");
     ASSERT(isActive());
     ASSERT(!range.isNull);
     ASSERT(currentThread() == m_database->originThreadID());
 
-    RELEASE_ASSERT(scriptExecutionContext());
-    ASSERT_UNUSED(execState, scriptExecutionContext() == scriptExecutionContextFromExecState(&execState));
+    ASSERT_UNUSED(state, scriptExecutionContext() == scriptExecutionContextFromExecState(&state));
 
-    Ref<IDBRequest> request = IDBRequest::createCount(*scriptExecutionContext(), index, *this);
+    auto request = IDBRequest::createCount(*scriptExecutionContext(), index, *this);
     addRequest(request.get());
 
     scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetCountOnServer, &IDBTransaction::getCountOnServer, range));
@@ -934,17 +919,16 @@ void IDBTransaction::didGetCountOnServer(IDBRequest& request, const IDBResultDat
     request.requestCompleted(resultData);
 }
 
-Ref<IDBRequest> IDBTransaction::requestDeleteRecord(ExecState& execState, IDBObjectStore& objectStore, const IDBKeyRangeData& range)
+Ref<IDBRequest> IDBTransaction::requestDeleteRecord(ExecState& state, IDBObjectStore& objectStore, const IDBKeyRangeData& range)
 {
     LOG(IndexedDB, "IDBTransaction::requestDeleteRecord");
     ASSERT(isActive());
     ASSERT(!range.isNull);
     ASSERT(currentThread() == m_database->originThreadID());
 
-    RELEASE_ASSERT(scriptExecutionContext());
-    ASSERT_UNUSED(execState, scriptExecutionContext() == scriptExecutionContextFromExecState(&execState));
+    ASSERT_UNUSED(state, scriptExecutionContext() == scriptExecutionContextFromExecState(&state));
 
-    Ref<IDBRequest> request = IDBRequest::create(*scriptExecutionContext(), objectStore, *this);
+    auto request = IDBRequest::create(*scriptExecutionContext(), objectStore, *this);
     addRequest(request.get());
 
     scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didDeleteRecordOnServer, &IDBTransaction::deleteRecordOnServer, range));
@@ -968,21 +952,19 @@ void IDBTransaction::didDeleteRecordOnServer(IDBRequest& request, const IDBResul
     request.requestCompleted(resultData);
 }
 
-Ref<IDBRequest> IDBTransaction::requestClearObjectStore(ExecState& execState, IDBObjectStore& objectStore)
+Ref<IDBRequest> IDBTransaction::requestClearObjectStore(ExecState& state, IDBObjectStore& objectStore)
 {
     LOG(IndexedDB, "IDBTransaction::requestClearObjectStore");
     ASSERT(isActive());
     ASSERT(currentThread() == m_database->originThreadID());
 
-    RELEASE_ASSERT(scriptExecutionContext());
-    ASSERT_UNUSED(execState, scriptExecutionContext() == scriptExecutionContextFromExecState(&execState));
+    ASSERT_UNUSED(state, scriptExecutionContext() == scriptExecutionContextFromExecState(&state));
 
-    Ref<IDBRequest> request = IDBRequest::create(*scriptExecutionContext(), objectStore, *this);
+    auto request = IDBRequest::create(*scriptExecutionContext(), objectStore, *this);
     addRequest(request.get());
 
     uint64_t objectStoreIdentifier = objectStore.info().identifier();
-    auto operation = IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didClearObjectStoreOnServer, &IDBTransaction::clearObjectStoreOnServer, objectStoreIdentifier);
-    scheduleOperation(WTFMove(operation));
+    scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didClearObjectStoreOnServer, &IDBTransaction::clearObjectStoreOnServer, objectStoreIdentifier));
 
     return request;
 }
@@ -1004,7 +986,7 @@ void IDBTransaction::didClearObjectStoreOnServer(IDBRequest& request, const IDBR
     request.requestCompleted(resultData);
 }
 
-Ref<IDBRequest> IDBTransaction::requestPutOrAdd(ExecState& execState, IDBObjectStore& objectStore, IDBKey* key, SerializedScriptValue& value, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
+Ref<IDBRequest> IDBTransaction::requestPutOrAdd(ExecState& state, IDBObjectStore& objectStore, IDBKey* key, SerializedScriptValue& value, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
 {
     LOG(IndexedDB, "IDBTransaction::requestPutOrAdd");
     ASSERT(isActive());
@@ -1012,14 +994,12 @@ Ref<IDBRequest> IDBTransaction::requestPutOrAdd(ExecState& execState, IDBObjectS
     ASSERT(objectStore.info().autoIncrement() || key);
     ASSERT(currentThread() == m_database->originThreadID());
 
-    RELEASE_ASSERT(scriptExecutionContext());
-    ASSERT_UNUSED(execState, scriptExecutionContext() == scriptExecutionContextFromExecState(&execState));
+    ASSERT_UNUSED(state, scriptExecutionContext() == scriptExecutionContextFromExecState(&state));
 
-    Ref<IDBRequest> request = IDBRequest::create(*scriptExecutionContext(), objectStore, *this);
+    auto request = IDBRequest::create(*scriptExecutionContext(), objectStore, *this);
     addRequest(request.get());
 
-    auto operation = IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didPutOrAddOnServer, &IDBTransaction::putOrAddOnServer, key, &value, overwriteMode);
-    scheduleOperation(WTFMove(operation));
+    scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didPutOrAddOnServer, &IDBTransaction::putOrAddOnServer, key, &value, overwriteMode));
 
     return request;
 }
@@ -1093,8 +1073,7 @@ void IDBTransaction::deleteObjectStore(const String& objectStoreName)
     if (auto objectStore = m_referencedObjectStores.take(objectStoreName))
         objectStore->markAsDeleted();
 
-    auto operation = IDBClient::createTransactionOperation(*this, &IDBTransaction::didDeleteObjectStoreOnServer, &IDBTransaction::deleteObjectStoreOnServer, objectStoreName);
-    scheduleOperation(WTFMove(operation));
+    scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didDeleteObjectStoreOnServer, &IDBTransaction::deleteObjectStoreOnServer, objectStoreName));
 }
 
 void IDBTransaction::deleteObjectStoreOnServer(IDBClient::TransactionOperation& operation, const String& objectStoreName)
@@ -1119,8 +1098,7 @@ void IDBTransaction::deleteIndex(uint64_t objectStoreIdentifier, const String& i
     ASSERT(currentThread() == m_database->originThreadID());
     ASSERT(isVersionChange());
 
-    auto operation = IDBClient::createTransactionOperation(*this, &IDBTransaction::didDeleteIndexOnServer, &IDBTransaction::deleteIndexOnServer, objectStoreIdentifier, indexName);
-    scheduleOperation(WTFMove(operation));
+    scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didDeleteIndexOnServer, &IDBTransaction::deleteIndexOnServer, objectStoreIdentifier, indexName));
 }
 
 void IDBTransaction::deleteIndexOnServer(IDBClient::TransactionOperation& operation, const uint64_t& objectStoreIdentifier, const String& indexName)
index 7988b2d..ce58607 100644 (file)
@@ -119,7 +119,7 @@ void IDBConnectionProxy::completeOpenDBRequest(const IDBResultData& resultData)
 
 void IDBConnectionProxy::createObjectStore(TransactionOperation& operation, const IDBObjectStoreInfo& info)
 {
-    const IDBRequestData requestData(operation);
+    const IDBRequestData requestData { operation };
     saveOperation(operation);
 
     callConnectionOnMainThread(&IDBConnectionToServer::createObjectStore, requestData, info);
@@ -127,7 +127,7 @@ void IDBConnectionProxy::createObjectStore(TransactionOperation& operation, cons
 
 void IDBConnectionProxy::renameObjectStore(TransactionOperation& operation, uint64_t objectStoreIdentifier, const String& newName)
 {
-    const IDBRequestData requestData(operation);
+    const IDBRequestData requestData { operation };
     saveOperation(operation);
 
     callConnectionOnMainThread(&IDBConnectionToServer::renameObjectStore, requestData, objectStoreIdentifier, newName);
@@ -135,7 +135,7 @@ void IDBConnectionProxy::renameObjectStore(TransactionOperation& operation, uint
 
 void IDBConnectionProxy::renameIndex(TransactionOperation& operation, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String& newName)
 {
-    const IDBRequestData requestData(operation);
+    const IDBRequestData requestData { operation };
     saveOperation(operation);
 
     callConnectionOnMainThread(&IDBConnectionToServer::renameIndex, requestData, objectStoreIdentifier, indexIdentifier, newName);
@@ -143,7 +143,7 @@ void IDBConnectionProxy::renameIndex(TransactionOperation& operation, uint64_t o
 
 void IDBConnectionProxy::deleteObjectStore(TransactionOperation& operation, const String& objectStoreName)
 {
-    const IDBRequestData requestData(operation);
+    const IDBRequestData requestData { operation };
     saveOperation(operation);
 
     callConnectionOnMainThread(&IDBConnectionToServer::deleteObjectStore, requestData, objectStoreName);
@@ -151,7 +151,7 @@ void IDBConnectionProxy::deleteObjectStore(TransactionOperation& operation, cons
 
 void IDBConnectionProxy::clearObjectStore(TransactionOperation& operation, uint64_t objectStoreIdentifier)
 {
-    const IDBRequestData requestData(operation);
+    const IDBRequestData requestData { operation };
     saveOperation(operation);
 
     callConnectionOnMainThread(&IDBConnectionToServer::clearObjectStore, requestData, objectStoreIdentifier);
@@ -159,7 +159,7 @@ void IDBConnectionProxy::clearObjectStore(TransactionOperation& operation, uint6
 
 void IDBConnectionProxy::createIndex(TransactionOperation& operation, const IDBIndexInfo& info)
 {
-    const IDBRequestData requestData(operation);
+    const IDBRequestData requestData { operation };
     saveOperation(operation);
 
     callConnectionOnMainThread(&IDBConnectionToServer::createIndex, requestData, info);
@@ -167,7 +167,7 @@ void IDBConnectionProxy::createIndex(TransactionOperation& operation, const IDBI
 
 void IDBConnectionProxy::deleteIndex(TransactionOperation& operation, uint64_t objectStoreIdentifier, const String& indexName)
 {
-    const IDBRequestData requestData(operation);
+    const IDBRequestData requestData { operation };
     saveOperation(operation);
 
     callConnectionOnMainThread(&IDBConnectionToServer::deleteIndex, requestData, WTFMove(objectStoreIdentifier), indexName);
@@ -175,7 +175,7 @@ void IDBConnectionProxy::deleteIndex(TransactionOperation& operation, uint64_t o
 
 void IDBConnectionProxy::putOrAdd(TransactionOperation& operation, IDBKeyData&& keyData, const IDBValue& value, const IndexedDB::ObjectStoreOverwriteMode mode)
 {
-    const IDBRequestData requestData(operation);
+    const IDBRequestData requestData { operation };
     saveOperation(operation);
 
     callConnectionOnMainThread(&IDBConnectionToServer::putOrAdd, requestData, keyData, value, mode);
@@ -183,7 +183,7 @@ void IDBConnectionProxy::putOrAdd(TransactionOperation& operation, IDBKeyData&&
 
 void IDBConnectionProxy::getRecord(TransactionOperation& operation, const IDBGetRecordData& getRecordData)
 {
-    const IDBRequestData requestData(operation);
+    const IDBRequestData requestData { operation };
     saveOperation(operation);
 
     callConnectionOnMainThread(&IDBConnectionToServer::getRecord, requestData, getRecordData);
@@ -191,7 +191,7 @@ void IDBConnectionProxy::getRecord(TransactionOperation& operation, const IDBGet
 
 void IDBConnectionProxy::getAllRecords(TransactionOperation& operation, const IDBGetAllRecordsData& getAllRecordsData)
 {
-    const IDBRequestData requestData(operation);
+    const IDBRequestData requestData { operation };
     saveOperation(operation);
 
     callConnectionOnMainThread(&IDBConnectionToServer::getAllRecords, requestData, getAllRecordsData);
@@ -199,7 +199,7 @@ void IDBConnectionProxy::getAllRecords(TransactionOperation& operation, const ID
 
 void IDBConnectionProxy::getCount(TransactionOperation& operation, const IDBKeyRangeData& keyRange)
 {
-    const IDBRequestData requestData(operation);
+    const IDBRequestData requestData { operation };
     saveOperation(operation);
 
     callConnectionOnMainThread(&IDBConnectionToServer::getCount, requestData, keyRange);
@@ -207,7 +207,7 @@ void IDBConnectionProxy::getCount(TransactionOperation& operation, const IDBKeyR
 
 void IDBConnectionProxy::deleteRecord(TransactionOperation& operation, const IDBKeyRangeData& keyRange)
 {
-    const IDBRequestData requestData(operation);
+    const IDBRequestData requestData { operation };
     saveOperation(operation);
 
     callConnectionOnMainThread(&IDBConnectionToServer::deleteRecord, requestData, keyRange);
@@ -215,7 +215,7 @@ void IDBConnectionProxy::deleteRecord(TransactionOperation& operation, const IDB
 
 void IDBConnectionProxy::openCursor(TransactionOperation& operation, const IDBCursorInfo& info)
 {
-    const IDBRequestData requestData(operation);
+    const IDBRequestData requestData { operation };
     saveOperation(operation);
 
     callConnectionOnMainThread(&IDBConnectionToServer::openCursor, requestData, info);
@@ -223,7 +223,7 @@ void IDBConnectionProxy::openCursor(TransactionOperation& operation, const IDBCu
 
 void IDBConnectionProxy::iterateCursor(TransactionOperation& operation, const IDBKeyData& key, unsigned long count)
 {
-    const IDBRequestData requestData(operation);
+    const IDBRequestData requestData { operation };
     saveOperation(operation);
 
     callConnectionOnMainThread(&IDBConnectionToServer::iterateCursor, requestData, key, count);
index d53640b..f94a0f8 100644 (file)
@@ -80,7 +80,7 @@ IDBError MemoryIDBBackingStore::beginTransaction(const IDBTransactionInfo& info)
     LOG(IndexedDB, "MemoryIDBBackingStore::beginTransaction");
 
     if (m_transactions.contains(info.identifier()))
-        return IDBError(IDBDatabaseException::InvalidStateError, "Backing store asked to create transaction it already has a record of");
+        return { IDBDatabaseException::InvalidStateError, "Backing store asked to create transaction it already has a record of" };
 
     auto transaction = MemoryBackingStoreTransaction::create(*this, info);
 
@@ -97,7 +97,7 @@ IDBError MemoryIDBBackingStore::beginTransaction(const IDBTransactionInfo& info)
 
     m_transactions.set(info.identifier(), WTFMove(transaction));
 
-    return IDBError();
+    return { };
 }
 
 IDBError MemoryIDBBackingStore::abortTransaction(const IDBResourceIdentifier& transactionIdentifier)
@@ -106,11 +106,11 @@ IDBError MemoryIDBBackingStore::abortTransaction(const IDBResourceIdentifier& tr
 
     auto transaction = m_transactions.take(transactionIdentifier);
     if (!transaction)
-        return IDBError(IDBDatabaseException::InvalidStateError, "Backing store asked to abort transaction it didn't have record of");
+        return { IDBDatabaseException::InvalidStateError, "Backing store asked to abort transaction it didn't have record of" };
 
     transaction->abort();
 
-    return IDBError();
+    return { };
 }
 
 IDBError MemoryIDBBackingStore::commitTransaction(const IDBResourceIdentifier& transactionIdentifier)
@@ -119,11 +119,11 @@ IDBError MemoryIDBBackingStore::commitTransaction(const IDBResourceIdentifier& t
 
     auto transaction = m_transactions.take(transactionIdentifier);
     if (!transaction)
-        return IDBError(IDBDatabaseException::InvalidStateError, "Backing store asked to commit transaction it didn't have record of");
+        return { IDBDatabaseException::InvalidStateError, "Backing store asked to commit transaction it didn't have record of" };
 
     transaction->commit();
 
-    return IDBError();
+    return { };
 }
 
 IDBError MemoryIDBBackingStore::createObjectStore(const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo& info)
@@ -132,7 +132,7 @@ IDBError MemoryIDBBackingStore::createObjectStore(const IDBResourceIdentifier& t
 
     ASSERT(m_databaseInfo);
     if (m_databaseInfo->hasObjectStore(info.name()))
-        return IDBError(IDBDatabaseException::ConstraintError);
+        return { IDBDatabaseException::ConstraintError };
 
     ASSERT(!m_objectStoresByIdentifier.contains(info.identifier()));
     auto objectStore = MemoryObjectStore::create(info);
@@ -146,7 +146,7 @@ IDBError MemoryIDBBackingStore::createObjectStore(const IDBResourceIdentifier& t
     rawTransaction->addNewObjectStore(objectStore.get());
     registerObjectStore(WTFMove(objectStore));
 
-    return IDBError();
+    return { };
 }
 
 IDBError MemoryIDBBackingStore::deleteObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier)
@@ -155,7 +155,7 @@ IDBError MemoryIDBBackingStore::deleteObjectStore(const IDBResourceIdentifier& t
 
     ASSERT(m_databaseInfo);
     if (!m_databaseInfo->infoForExistingObjectStore(objectStoreIdentifier))
-        return IDBError(IDBDatabaseException::ConstraintError);
+        return { IDBDatabaseException::ConstraintError };
 
     auto transaction = m_transactions.get(transactionIdentifier);
     ASSERT(transaction);
@@ -164,12 +164,12 @@ IDBError MemoryIDBBackingStore::deleteObjectStore(const IDBResourceIdentifier& t
     auto objectStore = takeObjectStoreByIdentifier(objectStoreIdentifier);
     ASSERT(objectStore);
     if (!objectStore)
-        return IDBError(IDBDatabaseException::ConstraintError);
+        return { IDBDatabaseException::ConstraintError };
 
     m_databaseInfo->deleteObjectStore(objectStore->info().name());
     transaction->objectStoreDeleted(*objectStore);
 
-    return IDBError();
+    return { };
 }
 
 IDBError MemoryIDBBackingStore::renameObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const String& newName)
@@ -178,7 +178,7 @@ IDBError MemoryIDBBackingStore::renameObjectStore(const IDBResourceIdentifier& t
 
     ASSERT(m_databaseInfo);
     if (!m_databaseInfo->infoForExistingObjectStore(objectStoreIdentifier))
-        return IDBError(IDBDatabaseException::ConstraintError);
+        return { IDBDatabaseException::ConstraintError };
 
     auto transaction = m_transactions.get(transactionIdentifier);
     ASSERT(transaction);
@@ -187,7 +187,7 @@ IDBError MemoryIDBBackingStore::renameObjectStore(const IDBResourceIdentifier& t
     auto objectStore = m_objectStoresByIdentifier.get(objectStoreIdentifier);
     ASSERT(objectStore);
     if (!objectStore)
-        return IDBError(IDBDatabaseException::ConstraintError);
+        return { IDBDatabaseException::ConstraintError };
 
     String oldName = objectStore->info().name();
     objectStore->rename(newName);
@@ -195,7 +195,7 @@ IDBError MemoryIDBBackingStore::renameObjectStore(const IDBResourceIdentifier& t
 
     m_databaseInfo->renameObjectStore(objectStoreIdentifier, newName);
 
-    return IDBError();
+    return { };
 }
 
 IDBError MemoryIDBBackingStore::clearObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier)
@@ -212,11 +212,11 @@ IDBError MemoryIDBBackingStore::clearObjectStore(const IDBResourceIdentifier& tr
 
     auto objectStore = m_objectStoresByIdentifier.get(objectStoreIdentifier);
     if (!objectStore)
-        return IDBError(IDBDatabaseException::ConstraintError);
+        return { IDBDatabaseException::ConstraintError };
 
     objectStore->clear();
 
-    return IDBError();
+    return { };
 }
 
 IDBError MemoryIDBBackingStore::createIndex(const IDBResourceIdentifier& transactionIdentifier, const IDBIndexInfo& info)
@@ -229,7 +229,7 @@ IDBError MemoryIDBBackingStore::createIndex(const IDBResourceIdentifier& transac
 
     auto* objectStore = m_objectStoresByIdentifier.get(info.objectStoreIdentifier());
     if (!objectStore)
-        return IDBError(IDBDatabaseException::ConstraintError);
+        return { IDBDatabaseException::ConstraintError };
 
     return objectStore->createIndex(*rawTransaction, info);
 }
@@ -244,7 +244,7 @@ IDBError MemoryIDBBackingStore::deleteIndex(const IDBResourceIdentifier& transac
 
     auto* objectStore = m_objectStoresByIdentifier.get(objectStoreIdentifier);
     if (!objectStore)
-        return IDBError(IDBDatabaseException::ConstraintError);
+        return { IDBDatabaseException::ConstraintError };
 
     return objectStore->deleteIndex(*rawTransaction, indexIdentifier);
 }
@@ -256,11 +256,11 @@ IDBError MemoryIDBBackingStore::renameIndex(const IDBResourceIdentifier& transac
     ASSERT(m_databaseInfo);
     auto* objectStoreInfo = m_databaseInfo->infoForExistingObjectStore(objectStoreIdentifier);
     if (!objectStoreInfo)
-        return IDBError(IDBDatabaseException::ConstraintError);
+        return { IDBDatabaseException::ConstraintError };
 
     auto* indexInfo = objectStoreInfo->infoForExistingIndex(indexIdentifier);
     if (!indexInfo)
-        return IDBError(IDBDatabaseException::ConstraintError);
+        return { IDBDatabaseException::ConstraintError };
 
     auto transaction = m_transactions.get(transactionIdentifier);
     ASSERT(transaction);
@@ -269,12 +269,12 @@ IDBError MemoryIDBBackingStore::renameIndex(const IDBResourceIdentifier& transac
     auto objectStore = m_objectStoresByIdentifier.get(objectStoreIdentifier);
     ASSERT(objectStore);
     if (!objectStore)
-        return IDBError(IDBDatabaseException::ConstraintError);
+        return { IDBDatabaseException::ConstraintError };
 
     auto* index = objectStore->indexForIdentifier(indexIdentifier);
     ASSERT(index);
     if (!index)
-        return IDBError(IDBDatabaseException::ConstraintError);
+        return { IDBDatabaseException::ConstraintError };
 
     String oldName = index->info().name();
     objectStore->renameIndex(*index, newName);
@@ -282,7 +282,7 @@ IDBError MemoryIDBBackingStore::renameIndex(const IDBResourceIdentifier& transac
 
     indexInfo->rename(newName);
 
-    return IDBError();
+    return { };
 }
 
 void MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort(MemoryObjectStore& objectStore)
@@ -312,7 +312,7 @@ IDBError MemoryIDBBackingStore::keyExistsInObjectStore(const IDBResourceIdentifi
     RELEASE_ASSERT(objectStore);
 
     keyExists = objectStore->containsRecord(keyData);
-    return IDBError();
+    return { };
 }
 
 IDBError MemoryIDBBackingStore::deleteRange(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData& range)
@@ -322,14 +322,14 @@ IDBError MemoryIDBBackingStore::deleteRange(const IDBResourceIdentifier& transac
     ASSERT(objectStoreIdentifier);
 
     if (!m_transactions.contains(transactionIdentifier))
-        return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found to delete from"));
+        return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found to delete from") };
 
     MemoryObjectStore* objectStore = m_objectStoresByIdentifier.get(objectStoreIdentifier);
     if (!objectStore)
-        return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found"));
+        return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found") };
 
     objectStore->deleteRange(range);
-    return IDBError();
+    return { };
 }
 
 IDBError MemoryIDBBackingStore::addRecord(const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo& objectStoreInfo, const IDBKeyData& keyData, const IDBValue& value)
@@ -340,11 +340,11 @@ IDBError MemoryIDBBackingStore::addRecord(const IDBResourceIdentifier& transacti
 
     auto transaction = m_transactions.get(transactionIdentifier);
     if (!transaction)
-        return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found to put record"));
+        return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found to put record") };
 
     MemoryObjectStore* objectStore = m_objectStoresByIdentifier.get(objectStoreInfo.identifier());
     if (!objectStore)
-        return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found to put record"));
+        return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found to put record") };
 
     return objectStore->addRecord(*transaction, keyData, value);
 }
@@ -356,14 +356,14 @@ IDBError MemoryIDBBackingStore::getRecord(const IDBResourceIdentifier& transacti
     ASSERT(objectStoreIdentifier);
 
     if (!m_transactions.contains(transactionIdentifier))
-        return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found to get record"));
+        return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found to get record") };
 
     MemoryObjectStore* objectStore = m_objectStoresByIdentifier.get(objectStoreIdentifier);
     if (!objectStore)
-        return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found"));
+        return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found") };
 
     outValue = objectStore->valueForKeyRange(range);
-    return IDBError();
+    return { };
 }
 
 IDBError MemoryIDBBackingStore::getAllRecords(const IDBResourceIdentifier& transactionIdentifier, const IDBGetAllRecordsData& getAllRecordsData, IDBGetAllResult& result)
@@ -373,11 +373,11 @@ IDBError MemoryIDBBackingStore::getAllRecords(const IDBResourceIdentifier& trans
     ASSERT(getAllRecordsData.objectStoreIdentifier);
 
     if (!m_transactions.contains(transactionIdentifier))
-        return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found to get all records"));
+        return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found to get all records") };
 
     MemoryObjectStore* objectStore = m_objectStoresByIdentifier.get(getAllRecordsData.objectStoreIdentifier);
     if (!objectStore)
-        return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found"));
+        return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found") };
 
     objectStore->getAllRecords(getAllRecordsData.keyRangeData, getAllRecordsData.count, getAllRecordsData.getAllType, result);
     return { };
@@ -390,14 +390,14 @@ IDBError MemoryIDBBackingStore::getIndexRecord(const IDBResourceIdentifier& tran
     ASSERT(objectStoreIdentifier);
 
     if (!m_transactions.contains(transactionIdentifier))
-        return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found to get record"));
+        return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found to get record") };
 
     MemoryObjectStore* objectStore = m_objectStoresByIdentifier.get(objectStoreIdentifier);
     if (!objectStore)
-        return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found"));
+        return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found") };
 
     outValue = objectStore->indexValueForKeyRange(indexIdentifier, recordType, range);
-    return IDBError();
+    return { };
 }
 
 IDBError MemoryIDBBackingStore::getCount(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData& range, uint64_t& outCount)
@@ -407,15 +407,15 @@ IDBError MemoryIDBBackingStore::getCount(const IDBResourceIdentifier& transactio
     ASSERT(objectStoreIdentifier);
 
     if (!m_transactions.contains(transactionIdentifier))
-        return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found to get count"));
+        return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found to get count") };
 
     MemoryObjectStore* objectStore = m_objectStoresByIdentifier.get(objectStoreIdentifier);
     if (!objectStore)
-        return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found"));
+        return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found") };
 
     outCount = objectStore->countForKeyRange(indexIdentifier, range);
 
-    return IDBError();
+    return { };
 }
 
 IDBError MemoryIDBBackingStore::generateKeyNumber(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t& keyNumber)
@@ -434,7 +434,7 @@ IDBError MemoryIDBBackingStore::generateKeyNumber(const IDBResourceIdentifier& t
 
     objectStore->setKeyGeneratorValue(keyNumber + 1);
 
-    return IDBError();
+    return { };
 }
 
 IDBError MemoryIDBBackingStore::revertGeneratedKeyNumber(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t keyNumber)
@@ -483,17 +483,17 @@ IDBError MemoryIDBBackingStore::openCursor(const IDBResourceIdentifier& transact
     ASSERT(!MemoryCursor::cursorForIdentifier(info.identifier()));
 
     if (!m_transactions.contains(transactionIdentifier))
-        return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found in which to open a cursor"));
+        return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found in which to open a cursor") };
 
     switch (info.cursorSource()) {
     case IndexedDB::CursorSource::ObjectStore: {
         auto* objectStore = m_objectStoresByIdentifier.get(info.sourceIdentifier());
         if (!objectStore)
-            return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found"));
+            return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found") };
 
         MemoryCursor* cursor = objectStore->maybeOpenCursor(info);
         if (!cursor)
-            return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("Could not create object store cursor in backing store"));
+            return { IDBDatabaseException::UnknownError, ASCIILiteral("Could not create object store cursor in backing store") };
 
         cursor->currentData(outData);
         break;
@@ -501,15 +501,15 @@ IDBError MemoryIDBBackingStore::openCursor(const IDBResourceIdentifier& transact
     case IndexedDB::CursorSource::Index:
         auto* objectStore = m_objectStoresByIdentifier.get(info.objectStoreIdentifier());
         if (!objectStore)
-            return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found"));
+            return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found") };
 
         auto* index = objectStore->indexForIdentifier(info.sourceIdentifier());
         if (!index)
-            return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store index found"));
+            return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store index found") };
 
         MemoryCursor* cursor = index->maybeOpenCursor(info);
         if (!cursor)
-            return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("Could not create index cursor in backing store"));
+            return { IDBDatabaseException::UnknownError, ASCIILiteral("Could not create index cursor in backing store") };
 
         cursor->currentData(outData);
         break;
@@ -523,11 +523,11 @@ IDBError MemoryIDBBackingStore::iterateCursor(const IDBResourceIdentifier& trans
     LOG(IndexedDB, "MemoryIDBBackingStore::iterateCursor");
 
     if (!m_transactions.contains(transactionIdentifier))
-        return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found in which to iterate cursor"));
+        return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found in which to iterate cursor") };
 
     auto* cursor = MemoryCursor::cursorForIdentifier(cursorIdentifier);
     if (!cursor)
-        return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store cursor found in which to iterate cursor"));
+        return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store cursor found in which to iterate cursor") };
 
     cursor->iterate(key, count, outData);
 
index a8119dc..6383f10 100644 (file)
@@ -98,7 +98,7 @@ void IDBResultData::isolatedCopy(const IDBResultData& source, IDBResultData& des
 
 IDBResultData IDBResultData::error(const IDBResourceIdentifier& requestIdentifier, const IDBError& error)
 {
-    IDBResultData result(requestIdentifier);
+    IDBResultData result { requestIdentifier };
     result.m_type = IDBResultType::Error;
     result.m_error = error;
     return result;
@@ -106,7 +106,7 @@ IDBResultData IDBResultData::error(const IDBResourceIdentifier& requestIdentifie
 
 IDBResultData IDBResultData::openDatabaseSuccess(const IDBResourceIdentifier& requestIdentifier, IDBServer::UniqueIDBDatabaseConnection& connection)
 {
-    IDBResultData result(requestIdentifier);
+    IDBResultData result { requestIdentifier };
     result.m_type = IDBResultType::OpenDatabaseSuccess;
     result.m_databaseConnectionIdentifier = connection.identifier();
     result.m_databaseInfo = std::make_unique<IDBDatabaseInfo>(connection.database().info());
@@ -116,7 +116,7 @@ IDBResultData IDBResultData::openDatabaseSuccess(const IDBResourceIdentifier& re
 
 IDBResultData IDBResultData::openDatabaseUpgradeNeeded(const IDBResourceIdentifier& requestIdentifier, IDBServer::UniqueIDBDatabaseTransaction& transaction)
 {
-    IDBResultData result(requestIdentifier);
+    IDBResultData result { requestIdentifier };
     result.m_type = IDBResultType::OpenDatabaseUpgradeNeeded;
     result.m_databaseConnectionIdentifier = transaction.databaseConnection().identifier();
     result.m_databaseInfo = std::make_unique<IDBDatabaseInfo>(transaction.databaseConnection().database().info());
@@ -126,7 +126,7 @@ IDBResultData IDBResultData::openDatabaseUpgradeNeeded(const IDBResourceIdentifi
 
 IDBResultData IDBResultData::deleteDatabaseSuccess(const IDBResourceIdentifier& requestIdentifier, const IDBDatabaseInfo& info)
 {
-    IDBResultData result(IDBResultType::DeleteDatabaseSuccess, requestIdentifier);
+    IDBResultData result {IDBResultType::DeleteDatabaseSuccess, requestIdentifier };
     result.m_databaseInfo = std::make_unique<IDBDatabaseInfo>(info);
     return result;
 }
@@ -168,28 +168,28 @@ IDBResultData IDBResultData::renameIndexSuccess(const IDBResourceIdentifier& req
 
 IDBResultData IDBResultData::putOrAddSuccess(const IDBResourceIdentifier& requestIdentifier, const IDBKeyData& resultKey)
 {
-    IDBResultData result(IDBResultType::PutOrAddSuccess, requestIdentifier);
+    IDBResultData result { IDBResultType::PutOrAddSuccess, requestIdentifier };
     result.m_resultKey = std::make_unique<IDBKeyData>(resultKey);
     return result;
 }
 
 IDBResultData IDBResultData::getRecordSuccess(const IDBResourceIdentifier& requestIdentifier, const IDBGetResult& getResult)
 {
-    IDBResultData result(IDBResultType::GetRecordSuccess, requestIdentifier);
+    IDBResultData result { IDBResultType::GetRecordSuccess, requestIdentifier };
     result.m_getResult = std::make_unique<IDBGetResult>(getResult);
     return result;
 }
 
 IDBResultData IDBResultData::getAllRecordsSuccess(const IDBResourceIdentifier& requestIdentifier, const IDBGetAllResult& getAllResult)
 {
-    IDBResultData result(IDBResultType::GetAllRecordsSuccess, requestIdentifier);
+    IDBResultData result { IDBResultType::GetAllRecordsSuccess, requestIdentifier };
     result.m_getAllResult = std::make_unique<IDBGetAllResult>(getAllResult);
     return result;
 }
 
 IDBResultData IDBResultData::getCountSuccess(const IDBResourceIdentifier& requestIdentifier, uint64_t count)
 {
-    IDBResultData result(IDBResultType::GetRecordSuccess, requestIdentifier);
+    IDBResultData result { IDBResultType::GetRecordSuccess, requestIdentifier };
     result.m_resultInteger = count;
     return result;
 }
@@ -201,14 +201,14 @@ IDBResultData IDBResultData::deleteRecordSuccess(const IDBResourceIdentifier& re
 
 IDBResultData IDBResultData::openCursorSuccess(const IDBResourceIdentifier& requestIdentifier, const IDBGetResult& getResult)
 {
-    IDBResultData result(IDBResultType::OpenCursorSuccess, requestIdentifier);
+    IDBResultData result { IDBResultType::OpenCursorSuccess, requestIdentifier };
     result.m_getResult = std::make_unique<IDBGetResult>(getResult);
     return result;
 }
 
 IDBResultData IDBResultData::iterateCursorSuccess(const IDBResourceIdentifier& requestIdentifier, const IDBGetResult& getResult)
 {
-    IDBResultData result(IDBResultType::IterateCursorSuccess, requestIdentifier);
+    IDBResultData result { IDBResultType::IterateCursorSuccess, requestIdentifier };
     result.m_getResult = std::make_unique<IDBGetResult>(getResult);
     return result;
 }