Changeset 248526 in webkit
- Timestamp:
- Aug 12, 2019 3:07:29 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r248521 r248526 1 2019-08-12 Youenn Fablet <youenn@apple.com> 2 3 Remove IDB-specific quota 4 https://bugs.webkit.org/show_bug.cgi?id=196545 5 6 Reviewed by Alex Christensen. 7 8 No change of behavior as IDB specific quota is no longer used. 9 Instead a global quota is used. This quota currently handles IDB and Cache API. 10 11 * Modules/indexeddb/server/IDBBackingStore.h: 12 * Modules/indexeddb/server/IDBServer.cpp: 13 (WebCore::IDBServer::IDBServer::createBackingStore): 14 (WebCore::IDBServer::IDBServer::setPerOriginQuota): Deleted. 15 * Modules/indexeddb/server/IDBServer.h: 16 (WebCore::IDBServer::IDBServer::perOriginQuota const): Deleted. 17 * Modules/indexeddb/server/MemoryIDBBackingStore.h: 18 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: 19 (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore): 20 (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction): 21 (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore): 22 (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore): 23 (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex): 24 (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord): 25 (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex): 26 (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): 27 (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue): 28 (WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const): Deleted. 29 (WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const): Deleted. 30 * Modules/indexeddb/server/SQLiteIDBBackingStore.h: 31 * Modules/indexeddb/server/UniqueIDBDatabase.cpp: 32 (WebCore::IDBServer::UniqueIDBDatabase::setQuota): Deleted. 33 * Modules/indexeddb/server/UniqueIDBDatabase.h: 34 1 35 2019-08-11 Alicia Boya García <aboya@igalia.com> 2 36 -
trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h
r244687 r248526 101 101 102 102 virtual uint64_t databasesSizeForOrigin() const = 0; 103 virtual void setQuota(uint64_t) = 0;104 103 105 104 virtual bool hasTransaction(const IDBResourceIdentifier&) const = 0; -
trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp
r248377 r248526 136 136 return MemoryIDBBackingStore::create(identifier); 137 137 138 return std::make_unique<SQLiteIDBBackingStore>(m_sessionID, identifier, m_databaseDirectoryPath, m_backingStoreTemporaryFileHandler , m_perOriginQuota);138 return std::make_unique<SQLiteIDBBackingStore>(m_sessionID, identifier, m_databaseDirectoryPath, m_backingStoreTemporaryFileHandler); 139 139 } 140 140 … … 692 692 } 693 693 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 702 694 IDBServer::QuotaUser::QuotaUser(IDBServer& server, StorageQuotaManager* manager, ClientOrigin&& origin) 703 695 : m_server(server) -
trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h
r244687 r248526 116 116 WEBCORE_EXPORT void closeAndDeleteDatabasesForOrigins(const Vector<SecurityOriginData>&, Function<void ()>&& completionHandler); 117 117 118 uint64_t perOriginQuota() const { return m_perOriginQuota; }119 WEBCORE_EXPORT void setPerOriginQuota(uint64_t);120 121 118 void requestSpace(const ClientOrigin&, uint64_t taskSize, CompletionHandler<void(StorageQuotaManager::Decision)>&&); 122 119 void increasePotentialSpaceUsed(const ClientOrigin&, uint64_t taskSize); … … 197 194 IDBBackingStoreTemporaryFileHandler& m_backingStoreTemporaryFileHandler; 198 195 199 uint64_t m_perOriginQuota { defaultPerOriginQuota };200 201 196 HashMap<ClientOrigin, std::unique_ptr<QuotaUser>> m_quotaUsers; 202 197 QuotaManagerGetter m_quotaManagerGetter; -
trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h
r244687 r248526 80 80 bool isEphemeral() final { return true; } 81 81 82 void setQuota(uint64_t quota) final { UNUSED_PARAM(quota); };83 82 uint64_t databasesSizeForOrigin() const final; 84 83 -
trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp
r248377 r248526 229 229 } 230 230 231 SQLiteIDBBackingStore::SQLiteIDBBackingStore(PAL::SessionID sessionID, const IDBDatabaseIdentifier& identifier, const String& databaseRootDirectory, IDBBackingStoreTemporaryFileHandler& fileHandler , uint64_t quota)231 SQLiteIDBBackingStore::SQLiteIDBBackingStore(PAL::SessionID sessionID, const IDBDatabaseIdentifier& identifier, const String& databaseRootDirectory, IDBBackingStoreTemporaryFileHandler& fileHandler) 232 232 : m_sessionID(sessionID) 233 233 , m_identifier(identifier) 234 234 , m_databaseRootDirectory(databaseRootDirectory) 235 235 , m_temporaryFileHandler(fileHandler) 236 , m_quota(quota)237 236 { 238 237 m_databaseDirectory = fullDatabaseDirectoryWithUpgrade(); … … 874 873 } 875 874 876 uint64_t SQLiteIDBBackingStore::quotaForOrigin() const877 {878 ASSERT(!isMainThread());879 uint64_t diskFreeSpaceSize = 0;880 FileSystem::getVolumeFreeSpace(m_identifier.databaseDirectoryRelativeToRoot(m_databaseRootDirectory), diskFreeSpaceSize);881 return std::min(diskFreeSpaceSize / 2, m_quota);882 }883 884 875 uint64_t SQLiteIDBBackingStore::databasesSizeForFolder(const String& folder) 885 876 { … … 899 890 } 900 891 901 uint64_t SQLiteIDBBackingStore::maximumSize() const902 {903 ASSERT(!isMainThread());904 905 // The maximum size for one database file is the quota for its origin, minus size of all databases within that origin,906 // and plus current size of the database file.907 uint64_t databaseFileSize = SQLiteFileSystem::getDatabaseFileSize(fullDatabasePath());908 uint64_t quota = quotaForOrigin();909 910 uint64_t diskUsage = databasesSizeForOrigin();911 ASSERT(diskUsage >= databaseFileSize);912 913 if (quota < diskUsage)914 return databaseFileSize;915 916 return quota - diskUsage + databaseFileSize;917 }918 919 892 IDBError SQLiteIDBBackingStore::beginTransaction(const IDBTransactionInfo& info) 920 893 { … … 925 898 ASSERT(m_databaseInfo); 926 899 927 m_sqliteDB->setMaximumSize(maximumSize());928 900 auto addResult = m_transactions.add(info.identifier(), nullptr); 929 901 if (!addResult.isNewEntry) { … … 942 914 || sql.bindText(1, String::number(info.newVersion())) != SQLITE_OK 943 915 || sql.step() != SQLITE_DONE) { 944 if (m_sqliteDB->lastError() == SQLITE_FULL) 945 error = IDBError { QuotaExceededError, "Failed to store new database version in database because no enough space for domain"_s }; 946 else 947 error = IDBError { UnknownError, "Failed to store new database version in database"_s }; 916 error = IDBError { UnknownError, "Failed to store new database version in database"_s }; 948 917 } 949 918 } … … 1028 997 || sql->step() != SQLITE_DONE) { 1029 998 LOG_ERROR("Could not add object store '%s' to ObjectStoreInfo table (%i) - %s", info.name().utf8().data(), m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg()); 1030 if (m_sqliteDB->lastError() == SQLITE_FULL)1031 return IDBError { QuotaExceededError, "Could not create object store because no enough space for domain"_s };1032 999 return IDBError { UnknownError, "Could not create object store"_s }; 1033 1000 } … … 1040 1007 || sql->step() != SQLITE_DONE) { 1041 1008 LOG_ERROR("Could not seed initial key generator value for ObjectStoreInfo table (%i) - %s", m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg()); 1042 if (m_sqliteDB->lastError() == SQLITE_FULL)1043 return IDBError { QuotaExceededError, "Could not seed initial key generator value for object store because no enough space for domain"_s };1044 1009 return IDBError { UnknownError, "Could not seed initial key generator value for object store"_s }; 1045 1010 } … … 1165 1130 || sql->step() != SQLITE_DONE) { 1166 1131 LOG_ERROR("Could not update name for object store id %" PRIi64 " in ObjectStoreInfo table (%i) - %s", objectStoreIdentifier, m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg()); 1167 if (m_sqliteDB->lastError() == SQLITE_FULL)1168 return IDBError { QuotaExceededError, "Could not rename object store because no enough space for domain"_s };1169 1132 return IDBError { UnknownError, "Could not rename object store"_s }; 1170 1133 } … … 1248 1211 || sql->step() != SQLITE_DONE) { 1249 1212 LOG_ERROR("Could not add index '%s' to IndexInfo table (%i) - %s", info.name().utf8().data(), m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg()); 1250 if (m_sqliteDB->lastError() == SQLITE_FULL)1251 return IDBError { QuotaExceededError, "Unable to create index in database because no enough space for domain"_s };1252 1213 return IDBError { UnknownError, "Unable to create index in database"_s }; 1253 1214 } … … 1398 1359 || sql->step() != SQLITE_DONE) { 1399 1360 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()); 1400 if (m_sqliteDB->lastError() == SQLITE_FULL)1401 return IDBError { QuotaExceededError, "Error putting index record into database because no enough space for domain"_s };1402 1361 return IDBError { UnknownError, "Error putting index record into database"_s }; 1403 1362 } … … 1485 1444 || sql->step() != SQLITE_DONE) { 1486 1445 LOG_ERROR("Could not update name for index id (%" PRIi64 ", %" PRIi64 ") in IndexInfo table (%i) - %s", objectStoreIdentifier, indexIdentifier, m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg()); 1487 if (m_sqliteDB->lastError() == SQLITE_FULL)1488 return IDBError { QuotaExceededError, "Could not rename index because no enough space for domain"_s };1489 1446 return IDBError { UnknownError, "Could not rename index"_s }; 1490 1447 } … … 1824 1781 || sql->step() != SQLITE_DONE) { 1825 1782 LOG_ERROR("Could not put record for object store %" PRIi64 " in Records table (%i) - %s", objectStoreInfo.identifier(), m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg()); 1826 if (m_sqliteDB->lastError() == SQLITE_FULL)1827 return IDBError { QuotaExceededError, "Unable to store record in object store because no enough space for domain"_s };1828 1783 return IDBError { UnknownError, "Unable to store record in object store"_s }; 1829 1784 } … … 1858 1813 || sql->step() != SQLITE_DONE) { 1859 1814 LOG_ERROR("Unable to record Blob record in database"); 1860 if (m_sqliteDB->lastError() == SQLITE_FULL)1861 return IDBError { QuotaExceededError, "Unable to record Blob record in database because no enough space for domain"_s };1862 1815 return IDBError { UnknownError, "Unable to record Blob record in database"_s }; 1863 1816 } … … 1893 1846 || sql->step() != SQLITE_DONE) { 1894 1847 LOG_ERROR("Unable to record Blob file record in database"); 1895 if (m_sqliteDB->lastError() == SQLITE_FULL)1896 return IDBError { QuotaExceededError, "Unable to record Blob file in database because no enough space for domain"_s };1897 1848 return IDBError { UnknownError, "Unable to record Blob file record in database"_s }; 1898 1849 } … … 2430 2381 || sql->step() != SQLITE_DONE) { 2431 2382 LOG_ERROR("Could not update key generator value (%i) - %s", m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg()); 2432 if (m_sqliteDB->lastError() == SQLITE_FULL)2433 return IDBError { QuotaExceededError, "Error storing new key generator value in database because no enough space for domain"_s };2434 2383 return IDBError { ConstraintError, "Error storing new key generator value in database" }; 2435 2384 } -
trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h
r248377 r248526 49 49 WTF_MAKE_FAST_ALLOCATED; 50 50 public: 51 SQLiteIDBBackingStore(PAL::SessionID, const IDBDatabaseIdentifier&, const String& databaseRootDirectory, IDBBackingStoreTemporaryFileHandler& , uint64_t quota);51 SQLiteIDBBackingStore(PAL::SessionID, const IDBDatabaseIdentifier&, const String& databaseRootDirectory, IDBBackingStoreTemporaryFileHandler&); 52 52 53 53 ~SQLiteIDBBackingStore() final; … … 82 82 void deleteBackingStore() final; 83 83 84 void setQuota(uint64_t quota) final { m_quota = quota; }85 84 uint64_t databasesSizeForOrigin() const final; 86 85 … … 109 108 String fullDatabasePath() const; 110 109 String fullDatabaseDirectoryWithUpgrade(); 111 112 uint64_t quotaForOrigin() const;113 uint64_t maximumSize() const;114 110 115 111 bool ensureValidRecordsTable(); … … 212 208 213 209 IDBBackingStoreTemporaryFileHandler& m_temporaryFileHandler; 214 215 uint64_t m_quota;216 210 }; 217 211 -
trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp
r247649 r248526 2317 2317 } 2318 2318 2319 void UniqueIDBDatabase::setQuota(uint64_t quota)2320 {2321 if (m_backingStore)2322 m_backingStore->setQuota(quota);2323 }2324 2325 2319 void UniqueIDBDatabase::abortTransactionOnMainThread(UniqueIDBDatabaseTransaction& transaction) 2326 2320 { -
trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h
r247649 r248526 127 127 uint64_t spaceUsed() const; 128 128 129 void setQuota(uint64_t);130 131 129 void finishActiveTransactions(); 132 130 -
trunk/Source/WebKit/ChangeLog
r248525 r248526 1 2019-08-12 Youenn Fablet <youenn@apple.com> 2 3 Remove IDB-specific quota 4 https://bugs.webkit.org/show_bug.cgi?id=196545 5 6 Reviewed by Alex Christensen. 7 8 * NetworkProcess/NetworkProcess.cpp: 9 (WebKit::NetworkProcess::createIDBServer): 10 (WebKit::NetworkProcess::addIndexedDatabaseSession): 11 (WebKit::NetworkProcess::setIDBPerOriginQuota): Deleted. 12 * NetworkProcess/NetworkProcess.h: 13 * NetworkProcess/NetworkProcess.messages.in: 14 * UIProcess/API/C/WKContext.cpp: 15 (WKContextSetIDBPerOriginQuota): Deleted. 16 * UIProcess/API/C/WKContextPrivate.h: 17 * UIProcess/WebProcessPool.cpp: 18 (WebKit::WebProcessPool::setIDBPerOriginQuota): Deleted. 19 * UIProcess/WebProcessPool.h: 20 1 21 2019-08-11 Chris Dumez <cdumez@apple.com> 2 22 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp
r248181 r248526 2270 2270 } 2271 2271 2272 auto server =IDBServer::IDBServer::create(sessionID, path, *this, [this, weakThis = makeWeakPtr(this)](PAL::SessionID sessionID, const auto& origin) -> StorageQuotaManager* {2272 return IDBServer::IDBServer::create(sessionID, path, *this, [this, weakThis = makeWeakPtr(this)](PAL::SessionID sessionID, const auto& origin) -> StorageQuotaManager* { 2273 2273 if (!weakThis) 2274 2274 return nullptr; 2275 2275 return &this->storageQuotaManager(sessionID, origin); 2276 2276 }); 2277 server->setPerOriginQuota(m_idbPerOriginQuota);2278 return server;2279 2277 } 2280 2278 … … 2372 2370 } 2373 2371 } 2374 2375 void NetworkProcess::setIDBPerOriginQuota(uint64_t quota)2376 {2377 m_idbPerOriginQuota = quota;2378 2379 for (auto& server : m_idbServers.values())2380 server->setPerOriginQuota(quota);2381 }2382 2372 #endif // ENABLE(INDEXED_DATABASE) 2383 2373 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.h
r248181 r248526 285 285 // WebCore::IDBServer::IDBBackingStoreFileHandler. 286 286 void accessToTemporaryFileComplete(const String& path) final; 287 void setIDBPerOriginQuota(uint64_t);288 287 #endif 289 288 void updateQuotaBasedOnSpaceUsageForTesting(PAL::SessionID, const WebCore::ClientOrigin&); … … 527 526 HashMap<PAL::SessionID, String> m_idbDatabasePaths; 528 527 HashMap<PAL::SessionID, RefPtr<WebCore::IDBServer::IDBServer>> m_idbServers; 529 uint64_t m_idbPerOriginQuota { WebCore::IDBServer::defaultPerOriginQuota };530 528 #endif 531 529 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
r248181 r248526 160 160 #endif 161 161 162 #if ENABLE(INDEXED_DATABASE)163 SetIDBPerOriginQuota(uint64_t quota)164 #endif165 162 UpdateQuotaBasedOnSpaceUsageForTesting(PAL::SessionID sessionID, struct WebCore::ClientOrigin origin) 166 163 -
trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp
r247705 r248526 661 661 } 662 662 663 void WKContextSetIDBPerOriginQuota(WKContextRef contextRef, uint64_t quota)664 {665 WebKit::toImpl(contextRef)->setIDBPerOriginQuota(quota);666 }667 668 663 void WKContextClearCurrentModifierStateForTesting(WKContextRef contextRef) 669 664 { -
trunk/Source/WebKit/UIProcess/API/C/WKContextPrivate.h
r239277 r248526 117 117 WK_EXPORT void WKContextClearSupportedPlugins(WKContextRef context); 118 118 119 WK_EXPORT void WKContextSetIDBPerOriginQuota(WKContextRef context, uint64_t quota);120 121 119 WK_EXPORT void WKContextClearCurrentModifierStateForTesting(WKContextRef context); 122 120 -
trunk/Source/WebKit/UIProcess/WebProcessPool.cpp
r248181 r248526 1805 1805 } 1806 1806 1807 void WebProcessPool::setIDBPerOriginQuota(uint64_t quota)1808 {1809 #if ENABLE(INDEXED_DATABASE)1810 ensureNetworkProcess().send(Messages::NetworkProcess::SetIDBPerOriginQuota(quota), 0);1811 #endif1812 }1813 1814 1807 void WebProcessPool::allowSpecificHTTPSCertificateForHost(const WebCertificateInfo* certificate, const String& host) 1815 1808 { -
trunk/Source/WebKit/UIProcess/WebProcessPool.h
r248181 r248526 319 319 void syncNetworkProcessCookies(); 320 320 321 void setIDBPerOriginQuota(uint64_t);322 323 321 void setShouldMakeNextWebProcessLaunchFailForTesting(bool value) { m_shouldMakeNextWebProcessLaunchFailForTesting = value; } 324 322 bool shouldMakeNextWebProcessLaunchFailForTesting() const { return m_shouldMakeNextWebProcessLaunchFailForTesting; } -
trunk/Source/WebKitLegacy/ChangeLog
r248498 r248526 1 2019-08-12 Youenn Fablet <youenn@apple.com> 2 3 Remove IDB-specific quota 4 https://bugs.webkit.org/show_bug.cgi?id=196545 5 6 Reviewed by Alex Christensen. 7 8 * Storage/WebDatabaseProvider.cpp: 9 (WebDatabaseProvider::idbConnectionToServerForSession): 10 (WebDatabaseProvider::deleteAllDatabases): 11 (WebDatabaseProvider::setIDBPerOriginQuota): Deleted. 12 * Storage/WebDatabaseProvider.h: 13 1 14 2019-08-10 Tim Horton <timothy_horton@apple.com> 2 15 -
trunk/Source/WebKitLegacy/Storage/WebDatabaseProvider.cpp
r242911 r248526 46 46 WebCore::IDBClient::IDBConnectionToServer& WebDatabaseProvider::idbConnectionToServerForSession(const PAL::SessionID& sessionID) 47 47 { 48 auto result = m_idbServerMap.add(sessionID.sessionID(), nullptr); 49 if (result.isNewEntry) { 50 if (sessionID.isEphemeral()) 51 result.iterator->value = WebCore::InProcessIDBServer::create(sessionID); 52 else 53 result.iterator->value = WebCore::InProcessIDBServer::create(sessionID, indexedDatabaseDirectoryPath()); 54 } 55 56 result.iterator->value->idbServer().setPerOriginQuota(m_idbPerOriginQuota); 57 58 return result.iterator->value->connectionToServer(); 48 return m_idbServerMap.ensure(sessionID.sessionID(), [&sessionID] { 49 return sessionID.isEphemeral() ? WebCore::InProcessIDBServer::create(sessionID) : WebCore::InProcessIDBServer::create(sessionID, indexedDatabaseDirectoryPath()); 50 }).iterator->value->connectionToServer(); 59 51 } 60 52 … … 64 56 server->idbServer().closeAndDeleteDatabasesModifiedSince(-WallTime::infinity(), [] { }); 65 57 } 66 67 void WebDatabaseProvider::setIDBPerOriginQuota(uint64_t quota)68 {69 m_idbPerOriginQuota = quota;70 71 for (auto& server : m_idbServerMap.values())72 server->idbServer().setPerOriginQuota(quota);73 }74 75 58 #endif -
trunk/Source/WebKitLegacy/Storage/WebDatabaseProvider.h
r237700 r248526 45 45 46 46 void deleteAllDatabases(); 47 48 void setIDBPerOriginQuota(uint64_t);49 47 #endif 50 48 … … 56 54 #if ENABLE(INDEXED_DATABASE) 57 55 HashMap<uint64_t, RefPtr<WebCore::InProcessIDBServer>> m_idbServerMap; 58 uint64_t m_idbPerOriginQuota { WebCore::IDBServer::defaultPerOriginQuota };59 56 #endif 60 57 }; -
trunk/Source/WebKitLegacy/mac/ChangeLog
r248525 r248526 1 2019-08-12 Youenn Fablet <youenn@apple.com> 2 3 Remove IDB-specific quota 4 https://bugs.webkit.org/show_bug.cgi?id=196545 5 6 Reviewed by Alex Christensen. 7 8 * Storage/WebDatabaseManager.mm: 9 (-[WebDatabaseManager setIDBPerOriginQuota:]): Deleted. 10 * Storage/WebDatabaseManagerPrivate.h: 11 1 12 2019-08-11 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/Source/WebKitLegacy/mac/Storage/WebDatabaseManager.mm
r237700 r248526 158 158 } 159 159 160 - (void)setIDBPerOriginQuota:(uint64_t)quota161 {162 #if ENABLE(INDEXED_DATABASE)163 WebDatabaseProvider::singleton().setIDBPerOriginQuota(quota);164 #endif165 }166 167 160 #if PLATFORM(IOS_FAMILY) 168 161 -
trunk/Source/WebKitLegacy/mac/Storage/WebDatabaseManagerPrivate.h
r237700 r248526 71 71 // For DumpRenderTree support only 72 72 - (void)deleteAllIndexedDatabases; 73 - (void)setIDBPerOriginQuota:(uint64_t)quota;74 73 75 74 #if TARGET_OS_IPHONE -
trunk/Source/WebKitLegacy/win/ChangeLog
r248472 r248526 1 2019-08-12 Youenn Fablet <youenn@apple.com> 2 3 Remove IDB-specific quota 4 https://bugs.webkit.org/show_bug.cgi?id=196545 5 6 Reviewed by Alex Christensen. 7 8 * Interfaces/IWebDatabaseManager.idl: 9 * WebDatabaseManager.cpp: 10 (WebDatabaseManager::setIDBPerOriginQuota): Deleted. 11 * WebDatabaseManager.h: 12 1 13 2019-08-09 Per Arne Vollan <pvollan@apple.com> 2 14 -
trunk/Source/WebKitLegacy/win/Interfaces/IWebDatabaseManager.idl
r237700 r248526 70 70 { 71 71 HRESULT deleteAllIndexedDatabases(); 72 HRESULT setIDBPerOriginQuota([in] unsigned long long quota);73 72 } -
trunk/Source/WebKitLegacy/win/WebDatabaseManager.cpp
r248444 r248526 347 347 } 348 348 349 HRESULT WebDatabaseManager::setIDBPerOriginQuota(unsigned long long quota)350 {351 #if ENABLE(INDEXED_DATABASE)352 WebDatabaseProvider::singleton().setIDBPerOriginQuota(quota);353 #endif354 return S_OK;355 }356 357 349 class DidModifyOriginData { 358 350 WTF_MAKE_NONCOPYABLE(DidModifyOriginData); -
trunk/Source/WebKitLegacy/win/WebDatabaseManager.h
r239151 r248526 57 57 // IWebDatabaseManager2 58 58 virtual HRESULT STDMETHODCALLTYPE deleteAllIndexedDatabases(); 59 virtual HRESULT STDMETHODCALLTYPE setIDBPerOriginQuota(unsigned long long);60 59 61 60 // DatabaseManagerClient -
trunk/Tools/ChangeLog
r248515 r248526 1 2019-08-12 Youenn Fablet <youenn@apple.com> 2 3 Remove IDB-specific quota 4 https://bugs.webkit.org/show_bug.cgi?id=196545 5 6 Reviewed by Alex Christensen. 7 8 * DumpRenderTree/TestRunner.cpp: 9 (TestRunner::staticFunctions): 10 (setIDBPerOriginQuotaCallback): Deleted. 11 * DumpRenderTree/TestRunner.h: 12 * DumpRenderTree/mac/DumpRenderTree.mm: 13 (runTest): 14 * DumpRenderTree/mac/TestRunnerMac.mm: 15 (TestRunner::setIDBPerOriginQuota): Deleted. 16 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: 17 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 18 (WTR::TestRunner::setIDBPerOriginQuota): Deleted. 19 * WebKitTestRunner/InjectedBundle/TestRunner.h: 20 * WebKitTestRunner/TestController.cpp: 21 (WTR::TestController::resetStateToConsistentValues): 22 (WTR::TestController::setIDBPerOriginQuota): Deleted. 23 * WebKitTestRunner/TestController.h: 24 * WebKitTestRunner/TestInvocation.cpp: 25 (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): 26 1 27 2019-08-10 Alexey Proskuryakov <ap@apple.com> 2 28 -
trunk/Tools/DumpRenderTree/TestRunner.cpp
r246285 r248526 891 891 controller->setDatabaseQuota(static_cast<unsigned long long>(quota)); 892 892 893 return JSValueMakeUndefined(context);894 }895 896 static JSValueRef setIDBPerOriginQuotaCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)897 {898 if (argumentCount < 1)899 return JSValueMakeUndefined(context);900 901 auto* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));902 903 double quota = JSValueToNumber(context, arguments[0], nullptr);904 if (!std::isnan(quota))905 controller->setIDBPerOriginQuota(static_cast<uint64_t>(quota));906 907 893 return JSValueMakeUndefined(context); 908 894 } … … 2221 2207 { "setHandlesAuthenticationChallenges", setHandlesAuthenticationChallengesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2222 2208 { "setIconDatabaseEnabled", setIconDatabaseEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2223 { "setIDBPerOriginQuota", setIDBPerOriginQuotaCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },2224 2209 { "setAutomaticLinkDetectionEnabled", setAutomaticLinkDetectionEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2225 2210 { "setMainFrameIsFirstResponder", setMainFrameIsFirstResponderCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/Tools/DumpRenderTree/TestRunner.h
r246285 r248526 107 107 void setDefersLoading(bool); 108 108 void setIconDatabaseEnabled(bool); 109 void setIDBPerOriginQuota(uint64_t);110 109 void setJavaScriptCanAccessClipboard(bool flag); 111 110 void setAutomaticLinkDetectionEnabled(bool flag); -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r248409 r248526 2036 2036 2037 2037 gTestRunner->clearAllDatabases(); 2038 gTestRunner->setIDBPerOriginQuota(50 * MB);2039 2038 2040 2039 if (disallowedURLs) -
trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm
r246285 r248526 440 440 } 441 441 442 void TestRunner::setIDBPerOriginQuota(uint64_t quota)443 {444 [[WebDatabaseManager sharedWebDatabaseManager] setIDBPerOriginQuota:quota];445 }446 447 442 void TestRunner::goBack() 448 443 { -
trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp
r246285 r248526 173 173 } 174 174 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 191 175 void TestRunner::setStorageDatabaseIdleInterval(double) 192 176 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r246285 r248526 146 146 attribute double databaseDefaultQuota; 147 147 attribute double databaseMaxQuota; 148 149 // IndexedDB API150 void setIDBPerOriginQuota(unsigned long long quota);151 148 152 149 // Application Cache API -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r246285 r248526 368 368 } 369 369 370 void TestRunner::setIDBPerOriginQuota(uint64_t quota)371 {372 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetIDBPerOriginQuota"));373 WKRetainPtr<WKUInt64Ref> messageBody = adoptWK(WKUInt64Create(quota));374 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);375 }376 377 370 static inline JSValueRef stringArrayToJS(JSContextRef context, WKArrayRef strings) 378 371 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r246285 r248526 175 175 uint64_t domCacheSize(JSStringRef origin); 176 176 void setAllowStorageQuotaIncrease(bool); 177 178 // IndexedDB179 void setIDBPerOriginQuota(uint64_t);180 177 181 178 // Failed load condition testing -
trunk/Tools/WebKitTestRunner/TestController.cpp
r248409 r248526 941 941 942 942 ClearIndexedDatabases(); 943 setIDBPerOriginQuota(50 * MB);944 943 945 944 clearServiceWorkerRegistrations(); … … 3065 3064 } 3066 3065 3067 void TestController::setIDBPerOriginQuota(uint64_t quota)3068 {3069 WKContextSetIDBPerOriginQuota(platformContext(), quota);3070 }3071 3072 3066 struct RemoveAllIndexedDatabasesCallbackContext { 3073 3067 explicit RemoveAllIndexedDatabasesCallbackContext(TestController& controller) -
trunk/Tools/WebKitTestRunner/TestController.h
r246856 r248526 273 273 void setAllowStorageQuotaIncrease(bool); 274 274 275 void setIDBPerOriginQuota(uint64_t);276 277 275 bool didReceiveServerRedirectForProvisionalNavigation() const { return m_didReceiveServerRedirectForProvisionalNavigation; } 278 276 void clearDidReceiveServerRedirectForProvisionalNavigation() { m_didReceiveServerRedirectForProvisionalNavigation = false; } -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r248404 r248526 1506 1506 } 1507 1507 1508 if (WKStringIsEqualToUTF8CString(messageName, "SetIDBPerOriginQuota")) {1509 ASSERT(WKGetTypeID(messageBody) == WKUInt64GetTypeID());1510 WKUInt64Ref quota = static_cast<WKUInt64Ref>(messageBody);1511 TestController::singleton().setIDBPerOriginQuota(WKUInt64GetValue(quota));1512 return nullptr;1513 }1514 1515 1508 if (WKStringIsEqualToUTF8CString(messageName, "InjectUserScript")) { 1516 1509 ASSERT(WKGetTypeID(messageBody) == WKStringGetTypeID());
Note: See TracChangeset
for help on using the changeset viewer.