Changeset 248856 in webkit


Ignore:
Timestamp:
Aug 19, 2019 10:12:37 AM (5 years ago)
Author:
sihui_liu@apple.com
Message:

Remove IDB-specific quota
https://bugs.webkit.org/show_bug.cgi?id=196545
<rdar://problem/54201783>

Reviewed by Youenn Fablet.

PerformanceTests:

  • IndexedDB/large-binary-keys.html:
  • IndexedDB/large-string-keys.html:

Source/WebCore:

Re-land r248526 with fix for performance tests.

No change of behavior as IDB specific quota is no longer used.
Instead a global quota is used. This quota currently handles IDB and Cache API.

  • Modules/indexeddb/server/IDBBackingStore.h:
  • Modules/indexeddb/server/IDBServer.cpp:

(WebCore::IDBServer::IDBServer::createBackingStore):
(WebCore::IDBServer::IDBServer::setPerOriginQuota): Deleted.

  • Modules/indexeddb/server/IDBServer.h:

(WebCore::IDBServer::IDBServer::perOriginQuota const): Deleted.

  • Modules/indexeddb/server/MemoryIDBBackingStore.h:
  • Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:

(WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const): Deleted.
(WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const): Deleted.

  • Modules/indexeddb/server/SQLiteIDBBackingStore.h:
  • Modules/indexeddb/server/UniqueIDBDatabase.cpp:

(WebCore::IDBServer::UniqueIDBDatabase::setQuota): Deleted.

  • Modules/indexeddb/server/UniqueIDBDatabase.h:

Source/WebKit:

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::createIDBServer):
(WebKit::NetworkProcess::addIndexedDatabaseSession):
(WebKit::NetworkProcess::setIDBPerOriginQuota): Deleted.

  • NetworkProcess/NetworkProcess.h:
  • NetworkProcess/NetworkProcess.messages.in:
  • UIProcess/API/C/WKContext.cpp:

(WKContextSetIDBPerOriginQuota): Deleted.

  • UIProcess/API/C/WKContextPrivate.h:
  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::setIDBPerOriginQuota): Deleted.

  • UIProcess/WebProcessPool.h:

Source/WebKitLegacy:

  • Storage/WebDatabaseProvider.cpp:

(WebDatabaseProvider::setIDBPerOriginQuota): Deleted.

  • Storage/WebDatabaseProvider.h:

Source/WebKitLegacy/mac:

  • Storage/WebDatabaseManager.mm:

(-[WebDatabaseManager setIDBPerOriginQuota:]): Deleted.

  • Storage/WebDatabaseManagerPrivate.h:

Source/WebKitLegacy/win:

  • Interfaces/IWebDatabaseManager.idl:
  • WebDatabaseManager.cpp:

(WebDatabaseManager::setIDBPerOriginQuota): Deleted.

  • WebDatabaseManager.h:

Tools:

  • DumpRenderTree/TestRunner.cpp:

(TestRunner::staticFunctions):
(setIDBPerOriginQuotaCallback): Deleted.

  • DumpRenderTree/TestRunner.h:
  • DumpRenderTree/mac/DumpRenderTree.mm:

(runTest):

  • DumpRenderTree/mac/TestRunnerMac.mm:

(TestRunner::setIDBPerOriginQuota): Deleted.

  • DumpRenderTree/win/TestRunnerWin.cpp:

(TestRunner::setIDBPerOriginQuota): Deleted.

  • WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:

(WTR::TestRunner::setIDBPerOriginQuota): Deleted.

  • WebKitTestRunner/InjectedBundle/TestRunner.h:
  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::setIDBPerOriginQuota): Deleted.

  • WebKitTestRunner/TestController.h:
  • WebKitTestRunner/TestInvocation.cpp:

(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

Location:
trunk
Files:
42 edited

Legend:

Unmodified
Added
Removed
  • trunk/PerformanceTests/ChangeLog

    r248697 r248856  
     12019-08-19  Sihui Liu  <sihui_liu@apple.com>
     2
     3        Remove IDB-specific quota
     4        https://bugs.webkit.org/show_bug.cgi?id=196545
     5        <rdar://problem/54201783>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        * IndexedDB/large-binary-keys.html:
     10        * IndexedDB/large-string-keys.html:
     11
    1122019-08-14  Keith Rollin  <krollin@apple.com>
    213
  • trunk/PerformanceTests/IndexedDB/large-binary-keys.html

    r240767 r248856  
    77var iterationCount = 20;
    88var numberDeleted = 0;
    9 
    10 var quota = 500 * 1024 * 1024; //500MB
    11 if (window.testRunner)
    12     testRunner.setIDBPerOriginQuota(quota);
    139
    1410// Delete all databases for the test ahead of time.
  • trunk/PerformanceTests/IndexedDB/large-string-keys.html

    r240767 r248856  
    77var iterationCount = 20;
    88var numberDeleted = 0;
    9 
    10 var quota = 500 * 1024 * 1024; //500MB
    11 if (window.testRunner)
    12     testRunner.setIDBPerOriginQuota(quota);
    139
    1410// Delete all databases for the test ahead of time.
  • trunk/Source/WebCore/ChangeLog

    r248855 r248856  
     12019-08-19  Sihui Liu  <sihui_liu@apple.com>
     2
     3        Remove IDB-specific quota
     4        https://bugs.webkit.org/show_bug.cgi?id=196545
     5        <rdar://problem/54201783>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        Re-land r248526 with fix for performance tests.
     10
     11        No change of behavior as IDB specific quota is no longer used.
     12        Instead a global quota is used. This quota currently handles IDB and Cache API.
     13
     14        * Modules/indexeddb/server/IDBBackingStore.h:
     15        * Modules/indexeddb/server/IDBServer.cpp:
     16        (WebCore::IDBServer::IDBServer::createBackingStore):
     17        (WebCore::IDBServer::IDBServer::setPerOriginQuota): Deleted.
     18        * Modules/indexeddb/server/IDBServer.h:
     19        (WebCore::IDBServer::IDBServer::perOriginQuota const): Deleted.
     20        * Modules/indexeddb/server/MemoryIDBBackingStore.h:
     21        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
     22        (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
     23        (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
     24        (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
     25        (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
     26        (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
     27        (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
     28        (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
     29        (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
     30        (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
     31        (WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const): Deleted.
     32        (WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const): Deleted.
     33        * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
     34        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
     35        (WebCore::IDBServer::UniqueIDBDatabase::setQuota): Deleted.
     36        * Modules/indexeddb/server/UniqueIDBDatabase.h:
     37
    1382019-08-19  Antoine Quint  <graouts@apple.com>
    239
  • trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h

    r248699 r248856  
    101101
    102102    virtual uint64_t databasesSizeForOrigin() const = 0;
    103     virtual void setQuota(uint64_t) = 0;
    104103
    105104    virtual bool hasTransaction(const IDBResourceIdentifier&) const = 0;
  • trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp

    r248846 r248856  
    136136        return MemoryIDBBackingStore::create(m_sessionID, identifier);
    137137
    138     return makeUnique<SQLiteIDBBackingStore>(m_sessionID, identifier, m_databaseDirectoryPath, m_backingStoreTemporaryFileHandler, m_perOriginQuota);
     138    return makeUnique<SQLiteIDBBackingStore>(m_sessionID, identifier, m_databaseDirectoryPath, m_backingStoreTemporaryFileHandler);
    139139}
    140140
     
    692692}
    693693
    694 void IDBServer::setPerOriginQuota(uint64_t quota)
    695 {
    696     m_perOriginQuota = quota;
    697 
    698     for (auto& database : m_uniqueIDBDatabaseMap.values())
    699         database->setQuota(quota);
    700 }
    701 
    702694IDBServer::QuotaUser::QuotaUser(IDBServer& server, StorageQuotaManager* manager, ClientOrigin&& origin)
    703695    : m_server(server)
  • trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h

    r248699 r248856  
    5555namespace IDBServer {
    5656
    57 const uint64_t defaultPerOriginQuota = 500 * MB;
    58 
    5957class IDBBackingStoreTemporaryFileHandler;
    6058
     
    116114    WEBCORE_EXPORT void closeAndDeleteDatabasesForOrigins(const Vector<SecurityOriginData>&, Function<void ()>&& completionHandler);
    117115
    118     uint64_t perOriginQuota() const { return m_perOriginQuota; }
    119     WEBCORE_EXPORT void setPerOriginQuota(uint64_t);
    120 
    121116    void requestSpace(const ClientOrigin&, uint64_t taskSize, CompletionHandler<void(StorageQuotaManager::Decision)>&&);
    122117    void increasePotentialSpaceUsed(const ClientOrigin&, uint64_t taskSize);
     
    197192    IDBBackingStoreTemporaryFileHandler& m_backingStoreTemporaryFileHandler;
    198193
    199     uint64_t m_perOriginQuota { defaultPerOriginQuota };
    200 
    201194    HashMap<ClientOrigin, std::unique_ptr<QuotaUser>> m_quotaUsers;
    202195    QuotaManagerGetter m_quotaManagerGetter;
  • trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h

    r248751 r248856  
    8080    bool isEphemeral() final { return true; }
    8181
    82     void setQuota(uint64_t quota) final { UNUSED_PARAM(quota); };
    8382    uint64_t databasesSizeForOrigin() const final;
    8483
  • trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp

    r248846 r248856  
    230230}
    231231
    232 SQLiteIDBBackingStore::SQLiteIDBBackingStore(PAL::SessionID sessionID, const IDBDatabaseIdentifier& identifier, const String& databaseRootDirectory, IDBBackingStoreTemporaryFileHandler& fileHandler, uint64_t quota)
     232SQLiteIDBBackingStore::SQLiteIDBBackingStore(PAL::SessionID sessionID, const IDBDatabaseIdentifier& identifier, const String& databaseRootDirectory, IDBBackingStoreTemporaryFileHandler& fileHandler)
    233233    : m_sessionID(sessionID)
    234234    , m_identifier(identifier)
    235235    , m_databaseRootDirectory(databaseRootDirectory)
    236236    , m_temporaryFileHandler(fileHandler)
    237     , m_quota(quota)
    238237    , m_serializationContext(IDBSerializationContext::getOrCreateIDBSerializationContext(sessionID))
    239238{
     
    846845}
    847846
    848 uint64_t SQLiteIDBBackingStore::quotaForOrigin() const
    849 {
    850     ASSERT(!isMainThread());
    851     uint64_t diskFreeSpaceSize = 0;
    852     FileSystem::getVolumeFreeSpace(m_identifier.databaseDirectoryRelativeToRoot(m_databaseRootDirectory), diskFreeSpaceSize);
    853     return std::min(diskFreeSpaceSize / 2, m_quota);
    854 }
    855 
    856847uint64_t SQLiteIDBBackingStore::databasesSizeForFolder(const String& folder)
    857848{
     
    871862}
    872863
    873 uint64_t SQLiteIDBBackingStore::maximumSize() const
    874 {
    875     ASSERT(!isMainThread());
    876 
    877     // The maximum size for one database file is the quota for its origin, minus size of all databases within that origin,
    878     // and plus current size of the database file.
    879     uint64_t databaseFileSize = SQLiteFileSystem::getDatabaseFileSize(fullDatabasePath());
    880     uint64_t quota = quotaForOrigin();
    881 
    882     uint64_t diskUsage = databasesSizeForOrigin();
    883     ASSERT(diskUsage >= databaseFileSize);
    884 
    885     if (quota < diskUsage)
    886         return databaseFileSize;
    887 
    888     return quota - diskUsage + databaseFileSize;
    889 }
    890 
    891864IDBError SQLiteIDBBackingStore::beginTransaction(const IDBTransactionInfo& info)
    892865{
     
    897870    ASSERT(m_databaseInfo);
    898871
    899     m_sqliteDB->setMaximumSize(maximumSize());
    900872    auto addResult = m_transactions.add(info.identifier(), nullptr);
    901873    if (!addResult.isNewEntry) {
     
    914886            || sql.bindText(1, String::number(info.newVersion())) != SQLITE_OK
    915887            || sql.step() != SQLITE_DONE) {
    916             if (m_sqliteDB->lastError() == SQLITE_FULL)
    917                 error = IDBError { QuotaExceededError, "Failed to store new database version in database because no enough space for domain"_s };
    918             else
    919                 error = IDBError { UnknownError, "Failed to store new database version in database"_s };
     888            error = IDBError { UnknownError, "Failed to store new database version in database"_s };
    920889        }
    921890    }
     
    1000969            || sql->step() != SQLITE_DONE) {
    1001970            LOG_ERROR("Could not add object store '%s' to ObjectStoreInfo table (%i) - %s", info.name().utf8().data(), m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
    1002             if (m_sqliteDB->lastError() == SQLITE_FULL)
    1003                 return IDBError { QuotaExceededError, "Could not create object store because no enough space for domain"_s };
    1004971            return IDBError { UnknownError, "Could not create object store"_s };
    1005972        }
     
    1012979            || sql->step() != SQLITE_DONE) {
    1013980            LOG_ERROR("Could not seed initial key generator value for ObjectStoreInfo table (%i) - %s", m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
    1014             if (m_sqliteDB->lastError() == SQLITE_FULL)
    1015                 return IDBError { QuotaExceededError, "Could not seed initial key generator value for object store because no enough space for domain"_s };
    1016981            return IDBError { UnknownError, "Could not seed initial key generator value for object store"_s };
    1017982        }
     
    11371102            || sql->step() != SQLITE_DONE) {
    11381103            LOG_ERROR("Could not update name for object store id %" PRIi64 " in ObjectStoreInfo table (%i) - %s", objectStoreIdentifier, m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
    1139             if (m_sqliteDB->lastError() == SQLITE_FULL)
    1140                 return IDBError { QuotaExceededError, "Could not rename object store because no enough space for domain"_s };
    11411104            return IDBError { UnknownError, "Could not rename object store"_s };
    11421105        }
     
    12201183        || sql->step() != SQLITE_DONE) {
    12211184        LOG_ERROR("Could not add index '%s' to IndexInfo table (%i) - %s", info.name().utf8().data(), m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
    1222         if (m_sqliteDB->lastError() == SQLITE_FULL)
    1223             return IDBError { QuotaExceededError, "Unable to create index in database because no enough space for domain"_s };
    12241185        return IDBError { UnknownError, "Unable to create index in database"_s };
    12251186    }
     
    13701331            || sql->step() != SQLITE_DONE) {
    13711332            LOG_ERROR("Could not put index record for index %" PRIi64 " in object store %" PRIi64 " in Records table (%i) - %s", indexID, objectStoreID, m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
    1372             if (m_sqliteDB->lastError() == SQLITE_FULL)
    1373                 return IDBError { QuotaExceededError, "Error putting index record into database because no enough space for domain"_s };
    13741333            return IDBError { UnknownError, "Error putting index record into database"_s };
    13751334        }
     
    14571416            || sql->step() != SQLITE_DONE) {
    14581417            LOG_ERROR("Could not update name for index id (%" PRIi64 ", %" PRIi64 ") in IndexInfo table (%i) - %s", objectStoreIdentifier, indexIdentifier, m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
    1459             if (m_sqliteDB->lastError() == SQLITE_FULL)
    1460                 return IDBError { QuotaExceededError, "Could not rename index because no enough space for domain"_s };
    14611418            return IDBError { UnknownError, "Could not rename index"_s };
    14621419        }
     
    17961753            || sql->step() != SQLITE_DONE) {
    17971754            LOG_ERROR("Could not put record for object store %" PRIi64 " in Records table (%i) - %s", objectStoreInfo.identifier(), m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
    1798             if (m_sqliteDB->lastError() == SQLITE_FULL)
    1799                 return IDBError { QuotaExceededError, "Unable to store record in object store because no enough space for domain"_s };
    18001755            return IDBError { UnknownError, "Unable to store record in object store"_s };
    18011756        }
     
    18301785                || sql->step() != SQLITE_DONE) {
    18311786                LOG_ERROR("Unable to record Blob record in database");
    1832                 if (m_sqliteDB->lastError() == SQLITE_FULL)
    1833                     return IDBError { QuotaExceededError, "Unable to record Blob record in database because no enough space for domain"_s };
    18341787                return IDBError { UnknownError, "Unable to record Blob record in database"_s };
    18351788            }
     
    18651818                || sql->step() != SQLITE_DONE) {
    18661819                LOG_ERROR("Unable to record Blob file record in database");
    1867                 if (m_sqliteDB->lastError() == SQLITE_FULL)
    1868                     return IDBError { QuotaExceededError, "Unable to record Blob file in database because no enough space for domain"_s };
    18691820                return IDBError { UnknownError, "Unable to record Blob file record in database"_s };
    18701821            }
     
    24022353        || sql->step() != SQLITE_DONE) {
    24032354        LOG_ERROR("Could not update key generator value (%i) - %s", m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
    2404         if (m_sqliteDB->lastError() == SQLITE_FULL)
    2405             return IDBError { QuotaExceededError, "Error storing new key generator value in database because no enough space for domain"_s };
    24062355        return IDBError { ConstraintError, "Error storing new key generator value in database" };
    24072356    }
  • trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h

    r248751 r248856  
    5050    WTF_MAKE_FAST_ALLOCATED;
    5151public:
    52     SQLiteIDBBackingStore(PAL::SessionID, const IDBDatabaseIdentifier&, const String& databaseRootDirectory, IDBBackingStoreTemporaryFileHandler&, uint64_t quota);
     52    SQLiteIDBBackingStore(PAL::SessionID, const IDBDatabaseIdentifier&, const String& databaseRootDirectory, IDBBackingStoreTemporaryFileHandler&);
    5353   
    5454    ~SQLiteIDBBackingStore() final;
     
    8383    void deleteBackingStore() final;
    8484
    85     void setQuota(uint64_t quota) final { m_quota = quota; }
    8685    uint64_t databasesSizeForOrigin() const final;
    8786
     
    110109    String fullDatabasePath() const;
    111110    String fullDatabaseDirectoryWithUpgrade();
    112 
    113     uint64_t quotaForOrigin() const;
    114     uint64_t maximumSize() const;
    115111
    116112    bool ensureValidRecordsTable();
     
    206202
    207203    IDBBackingStoreTemporaryFileHandler& m_temporaryFileHandler;
    208    
    209     uint64_t m_quota;
    210204
    211205    Ref<IDBSerializationContext> m_serializationContext;
  • trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp

    r248846 r248856  
    22992299}
    23002300
    2301 void UniqueIDBDatabase::setQuota(uint64_t quota)
    2302 {
    2303     if (m_backingStore)
    2304         m_backingStore->setQuota(quota);
    2305 }
    2306 
    23072301void UniqueIDBDatabase::abortTransactionOnMainThread(UniqueIDBDatabaseTransaction& transaction)
    23082302{
  • trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h

    r248751 r248856  
    119119    uint64_t spaceUsed() const;
    120120
    121     void setQuota(uint64_t);
    122 
    123121    void finishActiveTransactions();
    124122
  • trunk/Source/WebKit/ChangeLog

    r248854 r248856  
     12019-08-19  Sihui Liu  <sihui_liu@apple.com>
     2
     3        Remove IDB-specific quota
     4        https://bugs.webkit.org/show_bug.cgi?id=196545
     5        <rdar://problem/54201783>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        * NetworkProcess/NetworkProcess.cpp:
     10        (WebKit::NetworkProcess::createIDBServer):
     11        (WebKit::NetworkProcess::addIndexedDatabaseSession):
     12        (WebKit::NetworkProcess::setIDBPerOriginQuota): Deleted.
     13        * NetworkProcess/NetworkProcess.h:
     14        * NetworkProcess/NetworkProcess.messages.in:
     15        * UIProcess/API/C/WKContext.cpp:
     16        (WKContextSetIDBPerOriginQuota): Deleted.
     17        * UIProcess/API/C/WKContextPrivate.h:
     18        * UIProcess/WebProcessPool.cpp:
     19        (WebKit::WebProcessPool::setIDBPerOriginQuota): Deleted.
     20        * UIProcess/WebProcessPool.h:
     21
    1222019-08-19  Youenn Fablet  <youenn@apple.com>
    223
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp

    r248854 r248856  
    22592259    }
    22602260
    2261     auto server = IDBServer::IDBServer::create(sessionID, path, *this, [this, weakThis = makeWeakPtr(this)](PAL::SessionID sessionID, const auto& origin) -> StorageQuotaManager* {
     2261    return IDBServer::IDBServer::create(sessionID, path, *this, [this, weakThis = makeWeakPtr(this)](PAL::SessionID sessionID, const auto& origin) -> StorageQuotaManager* {
    22622262        if (!weakThis)
    22632263            return nullptr;
    22642264        return &this->storageQuotaManager(sessionID, origin);
    22652265    });
    2266     server->setPerOriginQuota(m_idbPerOriginQuota);
    2267     return server;
    22682266}
    22692267
     
    23612359    }
    23622360}
    2363 
    2364 void NetworkProcess::setIDBPerOriginQuota(uint64_t quota)
    2365 {
    2366     m_idbPerOriginQuota = quota;
    2367    
    2368     for (auto& server : m_idbServers.values())
    2369         server->setPerOriginQuota(quota);
    2370 }
    23712361#endif // ENABLE(INDEXED_DATABASE)
    23722362
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.h

    r248854 r248856  
    282282    // WebCore::IDBServer::IDBBackingStoreFileHandler.
    283283    void accessToTemporaryFileComplete(const String& path) final;
    284     void setIDBPerOriginQuota(uint64_t);
    285284#endif
    286285
     
    529528    HashMap<PAL::SessionID, String> m_idbDatabasePaths;
    530529    HashMap<PAL::SessionID, RefPtr<WebCore::IDBServer::IDBServer>> m_idbServers;
    531     uint64_t m_idbPerOriginQuota { WebCore::IDBServer::defaultPerOriginQuota };
    532530#endif
    533531
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in

    r248734 r248856  
    161161#endif
    162162
    163 #if ENABLE(INDEXED_DATABASE)
    164     SetIDBPerOriginQuota(uint64_t quota)
    165 #endif
    166 
    167163    SyncLocalStorage() -> () Synchronous
    168164    ClearLegacyPrivateBrowsingLocalStorage()
  • trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp

    r248846 r248856  
    661661}
    662662
    663 void WKContextSetIDBPerOriginQuota(WKContextRef contextRef, uint64_t quota)
    664 {
    665     WebKit::toImpl(contextRef)->setIDBPerOriginQuota(quota);
    666 }
    667 
    668663void WKContextClearCurrentModifierStateForTesting(WKContextRef contextRef)
    669664{
  • trunk/Source/WebKit/UIProcess/API/C/WKContextPrivate.h

    r248734 r248856  
    117117WK_EXPORT void WKContextClearSupportedPlugins(WKContextRef context);
    118118
    119 WK_EXPORT void WKContextSetIDBPerOriginQuota(WKContextRef context, uint64_t quota);
    120 
    121119WK_EXPORT void WKContextClearCurrentModifierStateForTesting(WKContextRef context);
    122120
  • trunk/Source/WebKit/UIProcess/WebProcessPool.cpp

    r248846 r248856  
    18031803}
    18041804
    1805 void WebProcessPool::setIDBPerOriginQuota(uint64_t quota)
    1806 {
    1807 #if ENABLE(INDEXED_DATABASE)
    1808     ensureNetworkProcess().send(Messages::NetworkProcess::SetIDBPerOriginQuota(quota), 0);
    1809 #endif
    1810 }
    1811 
    18121805void WebProcessPool::syncLocalStorage(CompletionHandler<void()>&& completionHandler)
    18131806{
  • trunk/Source/WebKit/UIProcess/WebProcessPool.h

    r248734 r248856  
    321321    void clearLegacyPrivateBrowsingLocalStorage(CompletionHandler<void()>&& callback);
    322322
    323     void setIDBPerOriginQuota(uint64_t);
    324 
    325323    void setShouldMakeNextWebProcessLaunchFailForTesting(bool value) { m_shouldMakeNextWebProcessLaunchFailForTesting = value; }
    326324    bool shouldMakeNextWebProcessLaunchFailForTesting() const { return m_shouldMakeNextWebProcessLaunchFailForTesting; }
  • trunk/Source/WebKitLegacy/ChangeLog

    r248854 r248856  
     12019-08-19  Sihui Liu  <sihui_liu@apple.com>
     2
     3        Remove IDB-specific quota
     4        https://bugs.webkit.org/show_bug.cgi?id=196545
     5        <rdar://problem/54201783>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        * Storage/WebDatabaseProvider.cpp:
     10        (WebDatabaseProvider::setIDBPerOriginQuota): Deleted.
     11        * Storage/WebDatabaseProvider.h:
     12
    1132019-08-19  Youenn Fablet  <youenn@apple.com>
    214
  • trunk/Source/WebKitLegacy/Storage/WebDatabaseProvider.cpp

    r248854 r248856  
    5757}
    5858
    59 void WebDatabaseProvider::setIDBPerOriginQuota(uint64_t quota)
    60 {
    61     m_idbPerOriginQuota = quota;
    62 
    63     for (auto& server : m_idbServerMap.values())
    64         server->idbServer().setPerOriginQuota(quota);
    65 }
    66 
    6759#endif
  • trunk/Source/WebKitLegacy/Storage/WebDatabaseProvider.h

    r248854 r248856  
    4545
    4646    void deleteAllDatabases();
    47 
    48     void setIDBPerOriginQuota(uint64_t);
    4947#endif
    5048
     
    5654#if ENABLE(INDEXED_DATABASE)
    5755    HashMap<PAL::SessionID, RefPtr<WebCore::InProcessIDBServer>> m_idbServerMap;
    58     uint64_t m_idbPerOriginQuota { WebCore::IDBServer::defaultPerOriginQuota };
    5956#endif
    6057};
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r248846 r248856  
     12019-08-19  Sihui Liu  <sihui_liu@apple.com>
     2
     3        Remove IDB-specific quota
     4        https://bugs.webkit.org/show_bug.cgi?id=196545
     5        <rdar://problem/54201783>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        * Storage/WebDatabaseManager.mm:
     10        (-[WebDatabaseManager setIDBPerOriginQuota:]): Deleted.
     11        * Storage/WebDatabaseManagerPrivate.h:
     12
    1132019-08-18  Yusuke Suzuki  <ysuzuki@apple.com>
    214
  • trunk/Source/WebKitLegacy/mac/Storage/WebDatabaseManager.mm

    r248699 r248856  
    158158}
    159159
    160 - (void)setIDBPerOriginQuota:(uint64_t)quota
    161 {
    162 #if ENABLE(INDEXED_DATABASE)
    163     WebDatabaseProvider::singleton().setIDBPerOriginQuota(quota);
    164 #endif
    165 }
    166 
    167160#if PLATFORM(IOS_FAMILY)
    168161
  • trunk/Source/WebKitLegacy/mac/Storage/WebDatabaseManagerPrivate.h

    r248699 r248856  
    7171// For DumpRenderTree support only
    7272- (void)deleteAllIndexedDatabases;
    73 - (void)setIDBPerOriginQuota:(uint64_t)quota;
    7473
    7574#if TARGET_OS_IPHONE
  • trunk/Source/WebKitLegacy/win/ChangeLog

    r248846 r248856  
     12019-08-19  Sihui Liu  <sihui_liu@apple.com>
     2
     3        Remove IDB-specific quota
     4        https://bugs.webkit.org/show_bug.cgi?id=196545
     5        <rdar://problem/54201783>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        * Interfaces/IWebDatabaseManager.idl:
     10        * WebDatabaseManager.cpp:
     11        (WebDatabaseManager::setIDBPerOriginQuota): Deleted.
     12        * WebDatabaseManager.h:
     13
    1142019-08-18  Yusuke Suzuki  <ysuzuki@apple.com>
    215
  • trunk/Source/WebKitLegacy/win/Interfaces/IWebDatabaseManager.idl

    r248699 r248856  
    7070{
    7171    HRESULT deleteAllIndexedDatabases();
    72     HRESULT setIDBPerOriginQuota([in] unsigned long long quota);
    7372}
  • trunk/Source/WebKitLegacy/win/WebDatabaseManager.cpp

    r248762 r248856  
    347347}
    348348
    349 HRESULT WebDatabaseManager::setIDBPerOriginQuota(unsigned long long quota)
    350 {
    351 #if ENABLE(INDEXED_DATABASE)
    352     WebDatabaseProvider::singleton().setIDBPerOriginQuota(quota);
    353 #endif
    354     return S_OK;
    355 }
    356 
    357349class DidModifyOriginData {
    358350    WTF_MAKE_FAST_ALLOCATED;
  • trunk/Source/WebKitLegacy/win/WebDatabaseManager.h

    r248699 r248856  
    5757    // IWebDatabaseManager2
    5858    virtual HRESULT STDMETHODCALLTYPE deleteAllIndexedDatabases();
    59     virtual HRESULT STDMETHODCALLTYPE setIDBPerOriginQuota(unsigned long long);
    6059
    6160    // DatabaseManagerClient
  • trunk/Tools/ChangeLog

    r248848 r248856  
     12019-08-19  Sihui Liu  <sihui_liu@apple.com>
     2
     3        Remove IDB-specific quota
     4        https://bugs.webkit.org/show_bug.cgi?id=196545
     5        <rdar://problem/54201783>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        * DumpRenderTree/TestRunner.cpp:
     10        (TestRunner::staticFunctions):
     11        (setIDBPerOriginQuotaCallback): Deleted.
     12        * DumpRenderTree/TestRunner.h:
     13        * DumpRenderTree/mac/DumpRenderTree.mm:
     14        (runTest):
     15        * DumpRenderTree/mac/TestRunnerMac.mm:
     16        (TestRunner::setIDBPerOriginQuota): Deleted.
     17        * DumpRenderTree/win/TestRunnerWin.cpp:
     18        (TestRunner::setIDBPerOriginQuota): Deleted.
     19        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
     20        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
     21        (WTR::TestRunner::setIDBPerOriginQuota): Deleted.
     22        * WebKitTestRunner/InjectedBundle/TestRunner.h:
     23        * WebKitTestRunner/TestController.cpp:
     24        (WTR::TestController::resetStateToConsistentValues):
     25        (WTR::TestController::setIDBPerOriginQuota): Deleted.
     26        * WebKitTestRunner/TestController.h:
     27        * WebKitTestRunner/TestInvocation.cpp:
     28        (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
     29
    1302019-08-19  Yusuke Suzuki  <ysuzuki@apple.com>
    231
  • trunk/Tools/DumpRenderTree/TestRunner.cpp

    r248846 r248856  
    892892        controller->setDatabaseQuota(static_cast<unsigned long long>(quota));
    893893       
    894     return JSValueMakeUndefined(context);
    895 }
    896 
    897 static JSValueRef setIDBPerOriginQuotaCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
    898 {
    899     if (argumentCount < 1)
    900         return JSValueMakeUndefined(context);
    901    
    902     auto* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
    903    
    904     double quota = JSValueToNumber(context, arguments[0], nullptr);
    905     if (!std::isnan(quota))
    906         controller->setIDBPerOriginQuota(static_cast<uint64_t>(quota));
    907    
    908894    return JSValueMakeUndefined(context);
    909895}
     
    22222208        { "setHandlesAuthenticationChallenges", setHandlesAuthenticationChallengesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    22232209        { "setIconDatabaseEnabled", setIconDatabaseEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    2224         { "setIDBPerOriginQuota", setIDBPerOriginQuotaCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    22252210        { "setAutomaticLinkDetectionEnabled", setAutomaticLinkDetectionEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    22262211        { "setMainFrameIsFirstResponder", setMainFrameIsFirstResponderCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
  • trunk/Tools/DumpRenderTree/TestRunner.h

    r248699 r248856  
    107107    void setDefersLoading(bool);
    108108    void setIconDatabaseEnabled(bool);
    109     void setIDBPerOriginQuota(uint64_t);
    110109    void setJavaScriptCanAccessClipboard(bool flag);
    111110    void setAutomaticLinkDetectionEnabled(bool flag);
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r248846 r248856  
    20372037
    20382038    gTestRunner->clearAllDatabases();
    2039     gTestRunner->setIDBPerOriginQuota(50 * MB);
    20402039
    20412040    if (disallowedURLs)
  • trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm

    r248699 r248856  
    440440}
    441441
    442 void TestRunner::setIDBPerOriginQuota(uint64_t quota)
    443 {
    444     [[WebDatabaseManager sharedWebDatabaseManager] setIDBPerOriginQuota:quota];
    445 }
    446 
    447442void TestRunner::goBack()
    448443{
  • trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp

    r248699 r248856  
    173173}
    174174
    175 void TestRunner::setIDBPerOriginQuota(uint64_t quota)
    176 {
    177     COMPtr<IWebDatabaseManager> databaseManager;
    178     COMPtr<IWebDatabaseManager> tmpDatabaseManager;
    179     if (FAILED(WebKitCreateInstance(CLSID_WebDatabaseManager, 0, IID_IWebDatabaseManager, (void**)&tmpDatabaseManager)))
    180         return;
    181     if (FAILED(tmpDatabaseManager->sharedWebDatabaseManager(&databaseManager)))
    182         return;
    183 
    184     COMPtr<IWebDatabaseManager2> databaseManager2;
    185     if (FAILED(databaseManager->QueryInterface(&databaseManager2)))
    186         return;
    187 
    188     databaseManager2->setIDBPerOriginQuota(quota);
    189 }
    190 
    191175void TestRunner::setStorageDatabaseIdleInterval(double)
    192176{
  • trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl

    r248734 r248856  
    147147    attribute double databaseDefaultQuota;
    148148    attribute double databaseMaxQuota;
    149 
    150     // IndexedDB API
    151     void setIDBPerOriginQuota(unsigned long long quota);
    152149
    153150    // Application Cache API
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp

    r248846 r248856  
    376376}
    377377
    378 void TestRunner::setIDBPerOriginQuota(uint64_t quota)
    379 {
    380     WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetIDBPerOriginQuota"));
    381     WKRetainPtr<WKUInt64Ref> messageBody = adoptWK(WKUInt64Create(quota));
    382     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    383 }
    384 
    385378static inline JSValueRef stringArrayToJS(JSContextRef context, WKArrayRef strings)
    386379{
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h

    r248734 r248856  
    176176    uint64_t domCacheSize(JSStringRef origin);
    177177    void setAllowStorageQuotaIncrease(bool);
    178 
    179     // IndexedDB
    180     void setIDBPerOriginQuota(uint64_t);
    181178
    182179    // Failed load condition testing
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r248846 r248856  
    941941    WKWebsiteDataStoreClearAllDeviceOrientationPermissions(websiteDataStore);
    942942
    943     setIDBPerOriginQuota(50 * MB);
    944 
    945943    clearIndexedDatabases();
    946944    clearLocalStorage();
     
    30683066}
    30693067
    3070 void TestController::setIDBPerOriginQuota(uint64_t quota)
    3071 {
    3072     WKContextSetIDBPerOriginQuota(platformContext(), quota);
    3073 }
    3074 
    30753068struct StorageVoidCallbackContext {
    30763069    explicit StorageVoidCallbackContext(TestController& controller)
  • trunk/Tools/WebKitTestRunner/TestController.h

    r248734 r248856  
    276276    void setAllowStorageQuotaIncrease(bool);
    277277
    278     void setIDBPerOriginQuota(uint64_t);
    279 
    280278    bool didReceiveServerRedirectForProvisionalNavigation() const { return m_didReceiveServerRedirectForProvisionalNavigation; }
    281279    void clearDidReceiveServerRedirectForProvisionalNavigation() { m_didReceiveServerRedirectForProvisionalNavigation = false; }
  • trunk/Tools/WebKitTestRunner/TestInvocation.cpp

    r248846 r248856  
    15151515    }
    15161516
    1517     if (WKStringIsEqualToUTF8CString(messageName, "SetIDBPerOriginQuota")) {
    1518         ASSERT(WKGetTypeID(messageBody) == WKUInt64GetTypeID());
    1519         WKUInt64Ref quota = static_cast<WKUInt64Ref>(messageBody);
    1520         TestController::singleton().setIDBPerOriginQuota(WKUInt64GetValue(quota));
    1521         return nullptr;
    1522     }
    1523 
    15241517    if (WKStringIsEqualToUTF8CString(messageName, "InjectUserScript")) {
    15251518        ASSERT(WKGetTypeID(messageBody) == WKStringGetTypeID());
Note: See TracChangeset for help on using the changeset viewer.