Changeset 254414 in webkit


Ignore:
Timestamp:
Jan 12, 2020 11:10:10 AM (4 years ago)
Author:
Darin Adler
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.

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r254410 r254414  
     12019-12-20  Darin Adler  <darin@apple.com>
     2
     3        Remove unneeded MemoryIDBBackingStore::create
     4        https://bugs.webkit.org/show_bug.cgi?id=205512
     5
     6        Reviewed by Youenn Fablet.
     7
     8        * Modules/indexeddb/server/IDBServer.cpp:
     9        (WebCore::IDBServer::IDBServer::createBackingStore): Call makeUnique
     10        instead of MemoryIDBBackingStore::create.
     11
     12        * Modules/indexeddb/server/MemoryCursor.cpp: Removed unneeded include
     13        of MemoryIDBBackingStore.h.
     14
     15        * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: Fixed a comment
     16        and replaced a global variable with a constant.
     17        (WebCore::IDBServer::MemoryIDBBackingStore::create): Deleted.
     18
     19        * Modules/indexeddb/server/MemoryIDBBackingStore.h: Made the class
     20        final, made more of the member functions private, and moved a couple
     21        function members out from in between the data members.
     22
    1232020-01-11  Zalan Bujtas  <zalan@apple.com>
    224
  • trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp

    r253740 r254414  
    129129    auto databaseDirectoryPath = this->databaseDirectoryPathIsolatedCopy();
    130130    if (databaseDirectoryPath.isEmpty())
    131         return MemoryIDBBackingStore::create(m_sessionID, identifier);
     131        return makeUnique<MemoryIDBBackingStore>(m_sessionID, identifier);
    132132
    133133    return makeUnique<SQLiteIDBBackingStore>(m_sessionID, identifier, databaseDirectoryPath);
  • trunk/Source/WebCore/Modules/indexeddb/server/MemoryCursor.cpp

    r192490 r254414  
    3030
    3131#include "IDBResourceIdentifier.h"
    32 #include "MemoryIDBBackingStore.h"
    3332#include <wtf/HashMap.h>
    3433#include <wtf/NeverDestroyed.h>
  • trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp

    r253393 r254414  
    4444namespace IDBServer {
    4545
    46 // The IndexedDB spec states the value you can get from the key generator is 2^53
    47 static uint64_t maxGeneratedKeyValue = 0x20000000000000;
    48 
    49 std::unique_ptr<MemoryIDBBackingStore> MemoryIDBBackingStore::create(PAL::SessionID sessionID, const IDBDatabaseIdentifier& identifier)
    50 {
    51     return makeUnique<MemoryIDBBackingStore>(sessionID, identifier);
    52 }
     46// The IndexedDB spec states the maximum value you can get from the key generator is 2^53.
     47constexpr uint64_t maxGeneratedKeyValue = 0x20000000000000;
    5348
    5449MemoryIDBBackingStore::MemoryIDBBackingStore(PAL::SessionID sessionID, const IDBDatabaseIdentifier& identifier)
  • trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h

    r253377 r254414  
    4040class MemoryObjectStore;
    4141
    42 class MemoryIDBBackingStore : public IDBBackingStore {
     42class MemoryIDBBackingStore final : public IDBBackingStore {
    4343    WTF_MAKE_FAST_ALLOCATED;
    4444public:
    45     static std::unique_ptr<MemoryIDBBackingStore> create(PAL::SessionID, const IDBDatabaseIdentifier&);
    46    
    4745    MemoryIDBBackingStore(PAL::SessionID, const IDBDatabaseIdentifier&);
    48     ~MemoryIDBBackingStore() final;
     46    ~MemoryIDBBackingStore();
    4947
    5048    IDBError getOrEstablishDatabaseInfo(IDBDatabaseInfo&) final;
    5149    void setDatabaseInfo(const IDBDatabaseInfo&);
    5250
     51    void removeObjectStoreForVersionChangeAbort(MemoryObjectStore&);
     52    void restoreObjectStoreForVersionChangeAbort(Ref<MemoryObjectStore>&&);
     53
     54private:
    5355    IDBError beginTransaction(const IDBTransactionInfo&) final;
    5456    IDBError abortTransaction(const IDBResourceIdentifier& transactionIdentifier) final;
     
    8183    bool isEphemeral() final { return true; }
    8284
    83     void removeObjectStoreForVersionChangeAbort(MemoryObjectStore&);
    84     void restoreObjectStoreForVersionChangeAbort(Ref<MemoryObjectStore>&&);
    85 
    8685    bool hasTransaction(const IDBResourceIdentifier& identifier) const final { return m_transactions.contains(identifier); }
    8786
    88 private:
    8987    RefPtr<MemoryObjectStore> takeObjectStoreByIdentifier(uint64_t identifier);
    9088
    9189    void close() final;
     90
     91    void registerObjectStore(Ref<MemoryObjectStore>&&);
     92    void unregisterObjectStore(MemoryObjectStore&);
    9293
    9394    IDBDatabaseIdentifier m_identifier;
     
    9798    HashMap<IDBResourceIdentifier, std::unique_ptr<MemoryBackingStoreTransaction>> m_transactions;
    9899
    99     void registerObjectStore(Ref<MemoryObjectStore>&&);
    100     void unregisterObjectStore(MemoryObjectStore&);
    101100    HashMap<uint64_t, RefPtr<MemoryObjectStore>> m_objectStoresByIdentifier;
    102101    HashMap<String, MemoryObjectStore*> m_objectStoresByName;
Note: See TracChangeset for help on using the changeset viewer.