Title: [254414] trunk/Source/WebCore
- Revision
- 254414
- Author
- [email protected]
- Date
- 2020-01-12 11:10:10 -0800 (Sun, 12 Jan 2020)
Log Message
Remove unneeded MemoryIDBBackingStore::create
https://bugs.webkit.org/show_bug.cgi?id=205512
Reviewed by Youenn Fablet.
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::createBackingStore): Call makeUnique
instead of MemoryIDBBackingStore::create.
* Modules/indexeddb/server/MemoryCursor.cpp: Removed unneeded include
of MemoryIDBBackingStore.h.
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp: Fixed a comment
and replaced a global variable with a constant.
(WebCore::IDBServer::MemoryIDBBackingStore::create): Deleted.
* Modules/indexeddb/server/MemoryIDBBackingStore.h: Made the class
final, made more of the member functions private, and moved a couple
function members out from in between the data members.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (254413 => 254414)
--- trunk/Source/WebCore/ChangeLog 2020-01-12 07:44:15 UTC (rev 254413)
+++ trunk/Source/WebCore/ChangeLog 2020-01-12 19:10:10 UTC (rev 254414)
@@ -1,3 +1,25 @@
+2019-12-20 Darin Adler <[email protected]>
+
+ Remove unneeded MemoryIDBBackingStore::create
+ https://bugs.webkit.org/show_bug.cgi?id=205512
+
+ Reviewed by Youenn Fablet.
+
+ * Modules/indexeddb/server/IDBServer.cpp:
+ (WebCore::IDBServer::IDBServer::createBackingStore): Call makeUnique
+ instead of MemoryIDBBackingStore::create.
+
+ * Modules/indexeddb/server/MemoryCursor.cpp: Removed unneeded include
+ of MemoryIDBBackingStore.h.
+
+ * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: Fixed a comment
+ and replaced a global variable with a constant.
+ (WebCore::IDBServer::MemoryIDBBackingStore::create): Deleted.
+
+ * Modules/indexeddb/server/MemoryIDBBackingStore.h: Made the class
+ final, made more of the member functions private, and moved a couple
+ function members out from in between the data members.
+
2020-01-11 Zalan Bujtas <[email protected]>
[LFC] Introduce the concept of independent formatting context
Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp (254413 => 254414)
--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp 2020-01-12 07:44:15 UTC (rev 254413)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp 2020-01-12 19:10:10 UTC (rev 254414)
@@ -128,7 +128,7 @@
auto databaseDirectoryPath = this->databaseDirectoryPathIsolatedCopy();
if (databaseDirectoryPath.isEmpty())
- return MemoryIDBBackingStore::create(m_sessionID, identifier);
+ return makeUnique<MemoryIDBBackingStore>(m_sessionID, identifier);
return makeUnique<SQLiteIDBBackingStore>(m_sessionID, identifier, databaseDirectoryPath);
}
Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryCursor.cpp (254413 => 254414)
--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryCursor.cpp 2020-01-12 07:44:15 UTC (rev 254413)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryCursor.cpp 2020-01-12 19:10:10 UTC (rev 254414)
@@ -29,7 +29,6 @@
#if ENABLE(INDEXED_DATABASE)
#include "IDBResourceIdentifier.h"
-#include "MemoryIDBBackingStore.h"
#include <wtf/HashMap.h>
#include <wtf/NeverDestroyed.h>
Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp (254413 => 254414)
--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp 2020-01-12 07:44:15 UTC (rev 254413)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp 2020-01-12 19:10:10 UTC (rev 254414)
@@ -43,14 +43,9 @@
namespace WebCore {
namespace IDBServer {
-// The IndexedDB spec states the value you can get from the key generator is 2^53
-static uint64_t maxGeneratedKeyValue = 0x20000000000000;
+// The IndexedDB spec states the maximum value you can get from the key generator is 2^53.
+constexpr uint64_t maxGeneratedKeyValue = 0x20000000000000;
-std::unique_ptr<MemoryIDBBackingStore> MemoryIDBBackingStore::create(PAL::SessionID sessionID, const IDBDatabaseIdentifier& identifier)
-{
- return makeUnique<MemoryIDBBackingStore>(sessionID, identifier);
-}
-
MemoryIDBBackingStore::MemoryIDBBackingStore(PAL::SessionID sessionID, const IDBDatabaseIdentifier& identifier)
: m_identifier(identifier)
, m_sessionID(sessionID)
Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h (254413 => 254414)
--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h 2020-01-12 07:44:15 UTC (rev 254413)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h 2020-01-12 19:10:10 UTC (rev 254414)
@@ -39,17 +39,19 @@
class MemoryObjectStore;
-class MemoryIDBBackingStore : public IDBBackingStore {
+class MemoryIDBBackingStore final : public IDBBackingStore {
WTF_MAKE_FAST_ALLOCATED;
public:
- static std::unique_ptr<MemoryIDBBackingStore> create(PAL::SessionID, const IDBDatabaseIdentifier&);
-
MemoryIDBBackingStore(PAL::SessionID, const IDBDatabaseIdentifier&);
- ~MemoryIDBBackingStore() final;
+ ~MemoryIDBBackingStore();
IDBError getOrEstablishDatabaseInfo(IDBDatabaseInfo&) final;
void setDatabaseInfo(const IDBDatabaseInfo&);
+ void removeObjectStoreForVersionChangeAbort(MemoryObjectStore&);
+ void restoreObjectStoreForVersionChangeAbort(Ref<MemoryObjectStore>&&);
+
+private:
IDBError beginTransaction(const IDBTransactionInfo&) final;
IDBError abortTransaction(const IDBResourceIdentifier& transactionIdentifier) final;
IDBError commitTransaction(const IDBResourceIdentifier& transactionIdentifier) final;
@@ -80,16 +82,15 @@
bool supportsSimultaneousTransactions() final { return true; }
bool isEphemeral() final { return true; }
- void removeObjectStoreForVersionChangeAbort(MemoryObjectStore&);
- void restoreObjectStoreForVersionChangeAbort(Ref<MemoryObjectStore>&&);
-
bool hasTransaction(const IDBResourceIdentifier& identifier) const final { return m_transactions.contains(identifier); }
-private:
RefPtr<MemoryObjectStore> takeObjectStoreByIdentifier(uint64_t identifier);
void close() final;
+ void registerObjectStore(Ref<MemoryObjectStore>&&);
+ void unregisterObjectStore(MemoryObjectStore&);
+
IDBDatabaseIdentifier m_identifier;
PAL::SessionID m_sessionID;
std::unique_ptr<IDBDatabaseInfo> m_databaseInfo;
@@ -96,8 +97,6 @@
HashMap<IDBResourceIdentifier, std::unique_ptr<MemoryBackingStoreTransaction>> m_transactions;
- void registerObjectStore(Ref<MemoryObjectStore>&&);
- void unregisterObjectStore(MemoryObjectStore&);
HashMap<uint64_t, RefPtr<MemoryObjectStore>> m_objectStoresByIdentifier;
HashMap<String, MemoryObjectStore*> m_objectStoresByName;
};
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes