Changeset 248856 in webkit
- Timestamp:
- Aug 19, 2019 10:12:37 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 42 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/PerformanceTests/ChangeLog
r248697 r248856 1 2019-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 1 12 2019-08-14 Keith Rollin <krollin@apple.com> 2 13 -
trunk/PerformanceTests/IndexedDB/large-binary-keys.html
r240767 r248856 7 7 var iterationCount = 20; 8 8 var numberDeleted = 0; 9 10 var quota = 500 * 1024 * 1024; //500MB11 if (window.testRunner)12 testRunner.setIDBPerOriginQuota(quota);13 9 14 10 // Delete all databases for the test ahead of time. -
trunk/PerformanceTests/IndexedDB/large-string-keys.html
r240767 r248856 7 7 var iterationCount = 20; 8 8 var numberDeleted = 0; 9 10 var quota = 500 * 1024 * 1024; //500MB11 if (window.testRunner)12 testRunner.setIDBPerOriginQuota(quota);13 9 14 10 // Delete all databases for the test ahead of time. -
trunk/Source/WebCore/ChangeLog
r248855 r248856 1 2019-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 1 38 2019-08-19 Antoine Quint <graouts@apple.com> 2 39 -
trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h
r248699 r248856 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
r248846 r248856 136 136 return MemoryIDBBackingStore::create(m_sessionID, identifier); 137 137 138 return makeUnique<SQLiteIDBBackingStore>(m_sessionID, identifier, m_databaseDirectoryPath, m_backingStoreTemporaryFileHandler , m_perOriginQuota);138 return makeUnique<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
r248699 r248856 55 55 namespace IDBServer { 56 56 57 const uint64_t defaultPerOriginQuota = 500 * MB;58 59 57 class IDBBackingStoreTemporaryFileHandler; 60 58 … … 116 114 WEBCORE_EXPORT void closeAndDeleteDatabasesForOrigins(const Vector<SecurityOriginData>&, Function<void ()>&& completionHandler); 117 115 118 uint64_t perOriginQuota() const { return m_perOriginQuota; }119 WEBCORE_EXPORT void setPerOriginQuota(uint64_t);120 121 116 void requestSpace(const ClientOrigin&, uint64_t taskSize, CompletionHandler<void(StorageQuotaManager::Decision)>&&); 122 117 void increasePotentialSpaceUsed(const ClientOrigin&, uint64_t taskSize); … … 197 192 IDBBackingStoreTemporaryFileHandler& m_backingStoreTemporaryFileHandler; 198 193 199 uint64_t m_perOriginQuota { defaultPerOriginQuota };200 201 194 HashMap<ClientOrigin, std::unique_ptr<QuotaUser>> m_quotaUsers; 202 195 QuotaManagerGetter m_quotaManagerGetter; -
trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h
r248751 r248856 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
r248846 r248856 230 230 } 231 231 232 SQLiteIDBBackingStore::SQLiteIDBBackingStore(PAL::SessionID sessionID, const IDBDatabaseIdentifier& identifier, const String& databaseRootDirectory, IDBBackingStoreTemporaryFileHandler& fileHandler , uint64_t quota)232 SQLiteIDBBackingStore::SQLiteIDBBackingStore(PAL::SessionID sessionID, const IDBDatabaseIdentifier& identifier, const String& databaseRootDirectory, IDBBackingStoreTemporaryFileHandler& fileHandler) 233 233 : m_sessionID(sessionID) 234 234 , m_identifier(identifier) 235 235 , m_databaseRootDirectory(databaseRootDirectory) 236 236 , m_temporaryFileHandler(fileHandler) 237 , m_quota(quota)238 237 , m_serializationContext(IDBSerializationContext::getOrCreateIDBSerializationContext(sessionID)) 239 238 { … … 846 845 } 847 846 848 uint64_t SQLiteIDBBackingStore::quotaForOrigin() const849 {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 856 847 uint64_t SQLiteIDBBackingStore::databasesSizeForFolder(const String& folder) 857 848 { … … 871 862 } 872 863 873 uint64_t SQLiteIDBBackingStore::maximumSize() const874 {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 891 864 IDBError SQLiteIDBBackingStore::beginTransaction(const IDBTransactionInfo& info) 892 865 { … … 897 870 ASSERT(m_databaseInfo); 898 871 899 m_sqliteDB->setMaximumSize(maximumSize());900 872 auto addResult = m_transactions.add(info.identifier(), nullptr); 901 873 if (!addResult.isNewEntry) { … … 914 886 || sql.bindText(1, String::number(info.newVersion())) != SQLITE_OK 915 887 || 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 }; 920 889 } 921 890 } … … 1000 969 || sql->step() != SQLITE_DONE) { 1001 970 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 };1004 971 return IDBError { UnknownError, "Could not create object store"_s }; 1005 972 } … … 1012 979 || sql->step() != SQLITE_DONE) { 1013 980 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 };1016 981 return IDBError { UnknownError, "Could not seed initial key generator value for object store"_s }; 1017 982 } … … 1137 1102 || sql->step() != SQLITE_DONE) { 1138 1103 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 };1141 1104 return IDBError { UnknownError, "Could not rename object store"_s }; 1142 1105 } … … 1220 1183 || sql->step() != SQLITE_DONE) { 1221 1184 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 };1224 1185 return IDBError { UnknownError, "Unable to create index in database"_s }; 1225 1186 } … … 1370 1331 || sql->step() != SQLITE_DONE) { 1371 1332 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 };1374 1333 return IDBError { UnknownError, "Error putting index record into database"_s }; 1375 1334 } … … 1457 1416 || sql->step() != SQLITE_DONE) { 1458 1417 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 };1461 1418 return IDBError { UnknownError, "Could not rename index"_s }; 1462 1419 } … … 1796 1753 || sql->step() != SQLITE_DONE) { 1797 1754 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 };1800 1755 return IDBError { UnknownError, "Unable to store record in object store"_s }; 1801 1756 } … … 1830 1785 || sql->step() != SQLITE_DONE) { 1831 1786 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 };1834 1787 return IDBError { UnknownError, "Unable to record Blob record in database"_s }; 1835 1788 } … … 1865 1818 || sql->step() != SQLITE_DONE) { 1866 1819 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 };1869 1820 return IDBError { UnknownError, "Unable to record Blob file record in database"_s }; 1870 1821 } … … 2402 2353 || sql->step() != SQLITE_DONE) { 2403 2354 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 };2406 2355 return IDBError { ConstraintError, "Error storing new key generator value in database" }; 2407 2356 } -
trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h
r248751 r248856 50 50 WTF_MAKE_FAST_ALLOCATED; 51 51 public: 52 SQLiteIDBBackingStore(PAL::SessionID, const IDBDatabaseIdentifier&, const String& databaseRootDirectory, IDBBackingStoreTemporaryFileHandler& , uint64_t quota);52 SQLiteIDBBackingStore(PAL::SessionID, const IDBDatabaseIdentifier&, const String& databaseRootDirectory, IDBBackingStoreTemporaryFileHandler&); 53 53 54 54 ~SQLiteIDBBackingStore() final; … … 83 83 void deleteBackingStore() final; 84 84 85 void setQuota(uint64_t quota) final { m_quota = quota; }86 85 uint64_t databasesSizeForOrigin() const final; 87 86 … … 110 109 String fullDatabasePath() const; 111 110 String fullDatabaseDirectoryWithUpgrade(); 112 113 uint64_t quotaForOrigin() const;114 uint64_t maximumSize() const;115 111 116 112 bool ensureValidRecordsTable(); … … 206 202 207 203 IDBBackingStoreTemporaryFileHandler& m_temporaryFileHandler; 208 209 uint64_t m_quota;210 204 211 205 Ref<IDBSerializationContext> m_serializationContext; -
trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp
r248846 r248856 2299 2299 } 2300 2300 2301 void UniqueIDBDatabase::setQuota(uint64_t quota)2302 {2303 if (m_backingStore)2304 m_backingStore->setQuota(quota);2305 }2306 2307 2301 void UniqueIDBDatabase::abortTransactionOnMainThread(UniqueIDBDatabaseTransaction& transaction) 2308 2302 { -
trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h
r248751 r248856 119 119 uint64_t spaceUsed() const; 120 120 121 void setQuota(uint64_t);122 123 121 void finishActiveTransactions(); 124 122 -
trunk/Source/WebKit/ChangeLog
r248854 r248856 1 2019-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 1 22 2019-08-19 Youenn Fablet <youenn@apple.com> 2 23 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp
r248854 r248856 2259 2259 } 2260 2260 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* { 2262 2262 if (!weakThis) 2263 2263 return nullptr; 2264 2264 return &this->storageQuotaManager(sessionID, origin); 2265 2265 }); 2266 server->setPerOriginQuota(m_idbPerOriginQuota);2267 return server;2268 2266 } 2269 2267 … … 2361 2359 } 2362 2360 } 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 }2371 2361 #endif // ENABLE(INDEXED_DATABASE) 2372 2362 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.h
r248854 r248856 282 282 // WebCore::IDBServer::IDBBackingStoreFileHandler. 283 283 void accessToTemporaryFileComplete(const String& path) final; 284 void setIDBPerOriginQuota(uint64_t);285 284 #endif 286 285 … … 529 528 HashMap<PAL::SessionID, String> m_idbDatabasePaths; 530 529 HashMap<PAL::SessionID, RefPtr<WebCore::IDBServer::IDBServer>> m_idbServers; 531 uint64_t m_idbPerOriginQuota { WebCore::IDBServer::defaultPerOriginQuota };532 530 #endif 533 531 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
r248734 r248856 161 161 #endif 162 162 163 #if ENABLE(INDEXED_DATABASE)164 SetIDBPerOriginQuota(uint64_t quota)165 #endif166 167 163 SyncLocalStorage() -> () Synchronous 168 164 ClearLegacyPrivateBrowsingLocalStorage() -
trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp
r248846 r248856 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
r248734 r248856 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
r248846 r248856 1803 1803 } 1804 1804 1805 void WebProcessPool::setIDBPerOriginQuota(uint64_t quota)1806 {1807 #if ENABLE(INDEXED_DATABASE)1808 ensureNetworkProcess().send(Messages::NetworkProcess::SetIDBPerOriginQuota(quota), 0);1809 #endif1810 }1811 1812 1805 void WebProcessPool::syncLocalStorage(CompletionHandler<void()>&& completionHandler) 1813 1806 { -
trunk/Source/WebKit/UIProcess/WebProcessPool.h
r248734 r248856 321 321 void clearLegacyPrivateBrowsingLocalStorage(CompletionHandler<void()>&& callback); 322 322 323 void setIDBPerOriginQuota(uint64_t);324 325 323 void setShouldMakeNextWebProcessLaunchFailForTesting(bool value) { m_shouldMakeNextWebProcessLaunchFailForTesting = value; } 326 324 bool shouldMakeNextWebProcessLaunchFailForTesting() const { return m_shouldMakeNextWebProcessLaunchFailForTesting; } -
trunk/Source/WebKitLegacy/ChangeLog
r248854 r248856 1 2019-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 1 13 2019-08-19 Youenn Fablet <youenn@apple.com> 2 14 -
trunk/Source/WebKitLegacy/Storage/WebDatabaseProvider.cpp
r248854 r248856 57 57 } 58 58 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 67 59 #endif -
trunk/Source/WebKitLegacy/Storage/WebDatabaseProvider.h
r248854 r248856 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<PAL::SessionID, RefPtr<WebCore::InProcessIDBServer>> m_idbServerMap; 58 uint64_t m_idbPerOriginQuota { WebCore::IDBServer::defaultPerOriginQuota };59 56 #endif 60 57 }; -
trunk/Source/WebKitLegacy/mac/ChangeLog
r248846 r248856 1 2019-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 1 13 2019-08-18 Yusuke Suzuki <ysuzuki@apple.com> 2 14 -
trunk/Source/WebKitLegacy/mac/Storage/WebDatabaseManager.mm
r248699 r248856 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
r248699 r248856 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
r248846 r248856 1 2019-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 1 14 2019-08-18 Yusuke Suzuki <ysuzuki@apple.com> 2 15 -
trunk/Source/WebKitLegacy/win/Interfaces/IWebDatabaseManager.idl
r248699 r248856 70 70 { 71 71 HRESULT deleteAllIndexedDatabases(); 72 HRESULT setIDBPerOriginQuota([in] unsigned long long quota);73 72 } -
trunk/Source/WebKitLegacy/win/WebDatabaseManager.cpp
r248762 r248856 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_FAST_ALLOCATED; -
trunk/Source/WebKitLegacy/win/WebDatabaseManager.h
r248699 r248856 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
r248848 r248856 1 2019-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 1 30 2019-08-19 Yusuke Suzuki <ysuzuki@apple.com> 2 31 -
trunk/Tools/DumpRenderTree/TestRunner.cpp
r248846 r248856 892 892 controller->setDatabaseQuota(static_cast<unsigned long long>(quota)); 893 893 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 908 894 return JSValueMakeUndefined(context); 909 895 } … … 2222 2208 { "setHandlesAuthenticationChallenges", setHandlesAuthenticationChallengesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2223 2209 { "setIconDatabaseEnabled", setIconDatabaseEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2224 { "setIDBPerOriginQuota", setIDBPerOriginQuotaCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },2225 2210 { "setAutomaticLinkDetectionEnabled", setAutomaticLinkDetectionEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2226 2211 { "setMainFrameIsFirstResponder", setMainFrameIsFirstResponderCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/Tools/DumpRenderTree/TestRunner.h
r248699 r248856 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
r248846 r248856 2037 2037 2038 2038 gTestRunner->clearAllDatabases(); 2039 gTestRunner->setIDBPerOriginQuota(50 * MB);2040 2039 2041 2040 if (disallowedURLs) -
trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm
r248699 r248856 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
r248699 r248856 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
r248734 r248856 147 147 attribute double databaseDefaultQuota; 148 148 attribute double databaseMaxQuota; 149 150 // IndexedDB API151 void setIDBPerOriginQuota(unsigned long long quota);152 149 153 150 // Application Cache API -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r248846 r248856 376 376 } 377 377 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 385 378 static inline JSValueRef stringArrayToJS(JSContextRef context, WKArrayRef strings) 386 379 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r248734 r248856 176 176 uint64_t domCacheSize(JSStringRef origin); 177 177 void setAllowStorageQuotaIncrease(bool); 178 179 // IndexedDB180 void setIDBPerOriginQuota(uint64_t);181 178 182 179 // Failed load condition testing -
trunk/Tools/WebKitTestRunner/TestController.cpp
r248846 r248856 941 941 WKWebsiteDataStoreClearAllDeviceOrientationPermissions(websiteDataStore); 942 942 943 setIDBPerOriginQuota(50 * MB);944 945 943 clearIndexedDatabases(); 946 944 clearLocalStorage(); … … 3068 3066 } 3069 3067 3070 void TestController::setIDBPerOriginQuota(uint64_t quota)3071 {3072 WKContextSetIDBPerOriginQuota(platformContext(), quota);3073 }3074 3075 3068 struct StorageVoidCallbackContext { 3076 3069 explicit StorageVoidCallbackContext(TestController& controller) -
trunk/Tools/WebKitTestRunner/TestController.h
r248734 r248856 276 276 void setAllowStorageQuotaIncrease(bool); 277 277 278 void setIDBPerOriginQuota(uint64_t);279 280 278 bool didReceiveServerRedirectForProvisionalNavigation() const { return m_didReceiveServerRedirectForProvisionalNavigation; } 281 279 void clearDidReceiveServerRedirectForProvisionalNavigation() { m_didReceiveServerRedirectForProvisionalNavigation = false; } -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r248846 r248856 1515 1515 } 1516 1516 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 1524 1517 if (WKStringIsEqualToUTF8CString(messageName, "InjectUserScript")) { 1525 1518 ASSERT(WKGetTypeID(messageBody) == WKStringGetTypeID());
Note: See TracChangeset
for help on using the changeset viewer.