Diff
Modified: trunk/Source/WebCore/ChangeLog (244076 => 244077)
--- trunk/Source/WebCore/ChangeLog 2019-04-09 15:43:00 UTC (rev 244076)
+++ trunk/Source/WebCore/ChangeLog 2019-04-09 15:56:45 UTC (rev 244077)
@@ -1,3 +1,29 @@
+2019-04-09 Sihui Liu <sihui_...@apple.com>
+
+ Remove unnecessary network process assertion for IDB close
+ https://bugs.webkit.org/show_bug.cgi?id=196693
+
+ Reviewed by Geoffrey Garen.
+
+ We already took assertion at WebCore::SQLiteDatabase::close.
+
+ * Modules/indexeddb/server/IDBServer.cpp:
+ (WebCore::IDBServer::IDBServer::create):
+ (WebCore::IDBServer::IDBServer::IDBServer):
+ (WebCore::IDBServer::m_quotaManagerGetter): Deleted.
+ (WebCore::IDBServer::IDBServer::closeDatabase): Deleted.
+ (WebCore::IDBServer::IDBServer::didCloseDatabase): Deleted.
+ * Modules/indexeddb/server/IDBServer.h:
+ (WebCore::IDBServer::IDBServer::create): Deleted.
+ * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+ (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
+ (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
+ (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
+ (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
+ (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
+ (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose): Deleted.
+ * Modules/indexeddb/server/UniqueIDBDatabase.h:
+
2019-04-09 Eike Rathke <er...@redhat.com>
Initialize trackTypeAsString for call to GST_INFO_OBJECT() in TrackType::Text
Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp (244076 => 244077)
--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp 2019-04-09 15:43:00 UTC (rev 244076)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp 2019-04-09 15:56:45 UTC (rev 244077)
@@ -45,33 +45,29 @@
namespace WebCore {
namespace IDBServer {
-Ref<IDBServer> IDBServer::create(PAL::SessionID sessionID, IDBBackingStoreTemporaryFileHandler& fileHandler, QuotaManagerGetter&& quotaManagerGetter, WTF::Function<void(bool)>&& isClosingDatabaseCallback)
+Ref<IDBServer> IDBServer::create(PAL::SessionID sessionID, IDBBackingStoreTemporaryFileHandler& fileHandler, QuotaManagerGetter&& quotaManagerGetter)
{
- return adoptRef(*new IDBServer(sessionID, fileHandler, WTFMove(quotaManagerGetter), WTFMove(isClosingDatabaseCallback)));
+ return adoptRef(*new IDBServer(sessionID, fileHandler, WTFMove(quotaManagerGetter)));
}
-Ref<IDBServer> IDBServer::create(PAL::SessionID sessionID, const String& databaseDirectoryPath, IDBBackingStoreTemporaryFileHandler& fileHandler, QuotaManagerGetter&& quotaManagerGetter, WTF::Function<void(bool)>&& isClosingDatabaseCallback)
+Ref<IDBServer> IDBServer::create(PAL::SessionID sessionID, const String& databaseDirectoryPath, IDBBackingStoreTemporaryFileHandler& fileHandler, QuotaManagerGetter&& quotaManagerGetter)
{
- return adoptRef(*new IDBServer(sessionID, databaseDirectoryPath, fileHandler, WTFMove(quotaManagerGetter), WTFMove(isClosingDatabaseCallback)));
+ return adoptRef(*new IDBServer(sessionID, databaseDirectoryPath, fileHandler, WTFMove(quotaManagerGetter)));
}
-IDBServer::IDBServer(PAL::SessionID sessionID, IDBBackingStoreTemporaryFileHandler& fileHandler, QuotaManagerGetter&& quotaManagerGetter, WTF::Function<void(bool)>&& isClosingDatabaseCallback)
+IDBServer::IDBServer(PAL::SessionID sessionID, IDBBackingStoreTemporaryFileHandler& fileHandler, QuotaManagerGetter&& quotaManagerGetter)
: CrossThreadTaskHandler("IndexedDatabase Server")
, m_sessionID(sessionID)
, m_backingStoreTemporaryFileHandler(fileHandler)
- , m_isClosingDatabaseCallback(WTFMove(isClosingDatabaseCallback))
- , m_isClosingDatabaseHysteresis([&](PAL::HysteresisState state) { m_isClosingDatabaseCallback(state == PAL::HysteresisState::Started); })
, m_quotaManagerGetter(WTFMove(quotaManagerGetter))
{
}
-IDBServer::IDBServer(PAL::SessionID sessionID, const String& databaseDirectoryPath, IDBBackingStoreTemporaryFileHandler& fileHandler, QuotaManagerGetter&& quotaManagerGetter, WTF::Function<void(bool)>&& isClosingDatabaseCallback)
+IDBServer::IDBServer(PAL::SessionID sessionID, const String& databaseDirectoryPath, IDBBackingStoreTemporaryFileHandler& fileHandler, QuotaManagerGetter&& quotaManagerGetter)
: CrossThreadTaskHandler("IndexedDatabase Server")
, m_sessionID(sessionID)
, m_databaseDirectoryPath(databaseDirectoryPath)
, m_backingStoreTemporaryFileHandler(fileHandler)
- , m_isClosingDatabaseCallback(WTFMove(isClosingDatabaseCallback))
- , m_isClosingDatabaseHysteresis([&](PAL::HysteresisState state) { m_isClosingDatabaseCallback(state == PAL::HysteresisState::Started); })
, m_quotaManagerGetter(WTFMove(quotaManagerGetter))
{
LOG(IndexedDB, "IDBServer created at path %s", databaseDirectoryPath.utf8().data());
@@ -702,29 +698,6 @@
database->setQuota(quota);
}
-void IDBServer::closeDatabase(UniqueIDBDatabase* database)
-{
- ASSERT(isMainThread());
- if (m_databaseDirectoryPath.isEmpty())
- return;
-
- auto addResult = m_uniqueIDBDatabasesInClose.add(database);
- if (addResult.isNewEntry && m_uniqueIDBDatabasesInClose.size() == 1)
- m_isClosingDatabaseHysteresis.start();
-}
-
-void IDBServer::didCloseDatabase(UniqueIDBDatabase* database)
-{
- ASSERT(isMainThread());
- if (m_databaseDirectoryPath.isEmpty())
- return;
-
- if (m_uniqueIDBDatabasesInClose.remove(database)) {
- if (m_uniqueIDBDatabasesInClose.isEmpty())
- m_isClosingDatabaseHysteresis.stop();
- }
-}
-
IDBServer::QuotaUser::QuotaUser(IDBServer& server, StorageQuotaManager* manager, ClientOrigin&& origin)
: m_server(server)
, m_manager(makeWeakPtr(manager))
Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h (244076 => 244077)
--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h 2019-04-09 15:43:00 UTC (rev 244076)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h 2019-04-09 15:56:45 UTC (rev 244077)
@@ -61,8 +61,8 @@
class IDBServer : public RefCounted<IDBServer>, public CrossThreadTaskHandler, public CanMakeWeakPtr<IDBServer> {
public:
using QuotaManagerGetter = WTF::Function<StorageQuotaManager*(PAL::SessionID, const ClientOrigin&)>;
- static Ref<IDBServer> create(PAL::SessionID, IDBBackingStoreTemporaryFileHandler&, QuotaManagerGetter&&, WTF::Function<void(bool)>&& isClosingDatabaseCallback = [](bool) { });
- WEBCORE_EXPORT static Ref<IDBServer> create(PAL::SessionID, const String& databaseDirectoryPath, IDBBackingStoreTemporaryFileHandler&, QuotaManagerGetter&&, WTF::Function<void(bool)>&& isClosingDatabaseCallback = [](bool) { });
+ static Ref<IDBServer> create(PAL::SessionID, IDBBackingStoreTemporaryFileHandler&, QuotaManagerGetter&&);
+ WEBCORE_EXPORT static Ref<IDBServer> create(PAL::SessionID, const String& databaseDirectoryPath, IDBBackingStoreTemporaryFileHandler&, QuotaManagerGetter&&);
WEBCORE_EXPORT void registerConnection(IDBConnectionToClient&);
WEBCORE_EXPORT void unregisterConnection(IDBConnectionToClient&);
@@ -116,10 +116,6 @@
uint64_t perOriginQuota() const { return m_perOriginQuota; }
WEBCORE_EXPORT void setPerOriginQuota(uint64_t);
- void closeDatabase(UniqueIDBDatabase*);
- void didCloseDatabase(UniqueIDBDatabase*);
- void hysteresisUpdated(PAL::HysteresisState);
-
void requestSpace(const ClientOrigin&, uint64_t taskSize, CompletionHandler<void(StorageQuotaManager::Decision)>&&);
void increasePotentialSpaceUsed(const ClientOrigin&, uint64_t taskSize);
void decreasePotentialSpaceUsed(const ClientOrigin&, uint64_t taskSize);
@@ -129,8 +125,8 @@
void initializeQuotaUser(const ClientOrigin& origin) { ensureQuotaUser(origin); }
private:
- IDBServer(PAL::SessionID, IDBBackingStoreTemporaryFileHandler&, QuotaManagerGetter&&, WTF::Function<void(bool)>&&);
- IDBServer(PAL::SessionID, const String& databaseDirectoryPath, IDBBackingStoreTemporaryFileHandler&, QuotaManagerGetter&&, WTF::Function<void(bool)>&&);
+ IDBServer(PAL::SessionID, IDBBackingStoreTemporaryFileHandler&, QuotaManagerGetter&&);
+ IDBServer(PAL::SessionID, const String& databaseDirectoryPath, IDBBackingStoreTemporaryFileHandler&, QuotaManagerGetter&&);
UniqueIDBDatabase& getOrCreateUniqueIDBDatabase(const IDBDatabaseIdentifier&);
@@ -186,7 +182,6 @@
PAL::SessionID m_sessionID;
HashMap<uint64_t, RefPtr<IDBConnectionToClient>> m_connectionMap;
HashMap<IDBDatabaseIdentifier, std::unique_ptr<UniqueIDBDatabase>> m_uniqueIDBDatabaseMap;
- HashSet<UniqueIDBDatabase*> m_uniqueIDBDatabasesInClose;
HashMap<uint64_t, UniqueIDBDatabaseConnection*> m_databaseConnections;
HashMap<IDBResourceIdentifier, UniqueIDBDatabaseTransaction*> m_transactions;
@@ -198,9 +193,6 @@
uint64_t m_perOriginQuota { defaultPerOriginQuota };
- WTF::Function<void(bool)> m_isClosingDatabaseCallback;
- PAL::HysteresisActivity m_isClosingDatabaseHysteresis;
-
HashMap<ClientOrigin, std::unique_ptr<QuotaUser>> m_quotaUsers;
QuotaManagerGetter m_quotaManagerGetter;
};
Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (244076 => 244077)
--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp 2019-04-09 15:43:00 UTC (rev 244076)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp 2019-04-09 15:56:45 UTC (rev 244077)
@@ -330,7 +330,6 @@
didDeleteBackingStore(0);
else {
m_deleteBackingStoreInProgress = true;
- notifyServerAboutClose(CloseState::Start);
postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::deleteBackingStore, m_identifier));
}
}
@@ -383,7 +382,6 @@
RELEASE_ASSERT(!m_owningPointerForClose);
m_owningPointerForClose = m_server->closeAndTakeUniqueIDBDatabase(*this);
- notifyServerAboutClose(CloseState::Start);
postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::shutdownForClose));
}
@@ -411,7 +409,6 @@
{
ASSERT(m_databaseReplyQueue.isEmpty());
m_databaseReplyQueue.kill();
- notifyServerAboutClose(CloseState::Done);
}
void UniqueIDBDatabase::didDeleteBackingStore(uint64_t deletedVersion)
@@ -447,7 +444,6 @@
if (m_hardClosedForUserDelete)
return;
- notifyServerAboutClose(CloseState::Done);
invokeOperationAndTransactionTimer();
}
@@ -2221,7 +2217,6 @@
if (m_owningPointerForClose)
return;
- notifyServerAboutClose(CloseState::Start);
// Otherwise, this database is still potentially active.
// So we'll have it own itself and then perform a clean unconditional delete on the background thread.
m_owningPointerForClose = m_server->closeAndTakeUniqueIDBDatabase(*this);
@@ -2314,19 +2309,6 @@
m_backingStore->setQuota(quota);
}
-void UniqueIDBDatabase::notifyServerAboutClose(CloseState state)
-{
- ASSERT(isMainThread());
-#if PLATFORM(IOS_FAMILY)
- if (state == CloseState::Start)
- m_server->closeDatabase(this);
- else
- m_server->didCloseDatabase(this);
-#else
- UNUSED_PARAM(state);
-#endif
-}
-
} // namespace IDBServer
} // namespace WebCore
Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h (244076 => 244077)
--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h 2019-04-09 15:43:00 UTC (rev 244076)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h 2019-04-09 15:56:45 UTC (rev 244077)
@@ -128,8 +128,6 @@
void setQuota(uint64_t);
private:
- enum class CloseState { Start, Done };
-
void handleDatabaseOperations();
void handleCurrentOperation();
void performCurrentOpenOperation();
@@ -251,8 +249,6 @@
void maybeFinishHardClose();
bool isDoneWithHardClose();
- void notifyServerAboutClose(CloseState);
-
void requestSpace(uint64_t taskSize, const char* errorMessage, CompletionHandler<void(Optional<IDBError>&&)>&&);
void waitForRequestSpaceCompletion(CompletionHandler<void(Optional<IDBError>&&)>&&);
void updateSpaceUsedIfNeeded(uint64_t callbackIdentifier);
Modified: trunk/Source/WebKit/ChangeLog (244076 => 244077)
--- trunk/Source/WebKit/ChangeLog 2019-04-09 15:43:00 UTC (rev 244076)
+++ trunk/Source/WebKit/ChangeLog 2019-04-09 15:56:45 UTC (rev 244077)
@@ -1,3 +1,20 @@
+2019-04-09 Sihui Liu <sihui_...@apple.com>
+
+ Remove unnecessary network process assertion for IDB close
+ https://bugs.webkit.org/show_bug.cgi?id=196693
+
+ Reviewed by Geoffrey Garen.
+
+ * NetworkProcess/NetworkProcess.cpp:
+ (WebKit::NetworkProcess::createIDBServer):
+ (WebKit::NetworkProcess::notifyHoldingLockedFiles): Deleted.
+ * NetworkProcess/NetworkProcess.h:
+ * UIProcess/Network/NetworkProcessProxy.cpp:
+ (WebKit::NetworkProcessProxy::didClose):
+ (WebKit::NetworkProcessProxy::setIsIDBDatabaseHoldingLockedFiles): Deleted.
+ * UIProcess/Network/NetworkProcessProxy.h:
+ * UIProcess/Network/NetworkProcessProxy.messages.in:
+
2019-04-09 Chris Dumez <cdu...@apple.com>
Loads using loadHTMLString() cause flashing when process-swapping
Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (244076 => 244077)
--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2019-04-09 15:43:00 UTC (rev 244076)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2019-04-09 15:56:45 UTC (rev 244077)
@@ -2122,10 +2122,6 @@
if (!weakThis)
return nullptr;
return &this->storageQuotaManager(sessionID, origin);
- }, [this, weakThis = makeWeakPtr(this)](bool isHoldingLockedFiles) {
- if (!weakThis)
- return;
- this->notifyHoldingLockedFiles(isHoldingLockedFiles);
});
server->setPerOriginQuota(m_idbPerOriginQuota);
return server;
@@ -2503,9 +2499,4 @@
completionHandler();
}
-void NetworkProcess::notifyHoldingLockedFiles(bool isIDBDatabaseHoldingLockedFiles)
-{
- parentProcessConnection()->send(Messages::NetworkProcessProxy::SetIsIDBDatabaseHoldingLockedFiles(isIDBDatabaseHoldingLockedFiles), 0);
-}
-
} // namespace WebKit
Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.h (244076 => 244077)
--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.h 2019-04-09 15:43:00 UTC (rev 244076)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.h 2019-04-09 15:56:45 UTC (rev 244077)
@@ -407,7 +407,6 @@
void syncAllCookies();
void didSyncAllCookies();
- void notifyHoldingLockedFiles(bool isIDBDatabaseHoldingLockedFiles);
#if USE(SOUP)
void setIgnoreTLSErrors(bool);
void userPreferredLanguagesChanged(const Vector<String>&);
Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (244076 => 244077)
--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp 2019-04-09 15:43:00 UTC (rev 244076)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp 2019-04-09 15:56:45 UTC (rev 244077)
@@ -279,7 +279,6 @@
#endif
m_tokenForHoldingLockedFiles = nullptr;
- m_tokenForIDBDatabaseHoldingLockedFiles = nullptr;
m_syncAllCookiesToken = nullptr;
m_syncAllCookiesCounter = 0;
@@ -1058,19 +1057,6 @@
}
}
-void NetworkProcessProxy::setIsIDBDatabaseHoldingLockedFiles(bool isIDBDatabaseHoldingLockedFiles)
-{
- if (!isIDBDatabaseHoldingLockedFiles) {
- RELEASE_LOG(ProcessSuspension, "UIProcess is releasing a background assertion because the Network process is no longer holding locked files for IDBDatabase");
- m_tokenForIDBDatabaseHoldingLockedFiles = nullptr;
- return;
- }
- if (!m_tokenForIDBDatabaseHoldingLockedFiles) {
- RELEASE_LOG(ProcessSuspension, "UIProcess is taking a background assertion because the Network process is holding locked files for IDBDatabase");
- m_tokenForIDBDatabaseHoldingLockedFiles = m_throttler.backgroundActivityToken();
- }
-}
-
void NetworkProcessProxy::syncAllCookies()
{
send(Messages::NetworkProcess::SyncAllCookies(), 0);
Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (244076 => 244077)
--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h 2019-04-09 15:43:00 UTC (rev 244076)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h 2019-04-09 15:56:45 UTC (rev 244077)
@@ -159,7 +159,6 @@
void synthesizeAppIsBackground(bool background);
void setIsHoldingLockedFiles(bool);
- void setIsIDBDatabaseHoldingLockedFiles(bool);
void syncAllCookies();
void didSyncAllCookies();
@@ -261,7 +260,6 @@
#endif
ProcessThrottler m_throttler;
ProcessThrottler::BackgroundActivityToken m_tokenForHoldingLockedFiles;
- ProcessThrottler::BackgroundActivityToken m_tokenForIDBDatabaseHoldingLockedFiles;
ProcessThrottler::BackgroundActivityToken m_syncAllCookiesToken;
unsigned m_syncAllCookiesCounter { 0 };
Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in (244076 => 244077)
--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in 2019-04-09 15:43:00 UTC (rev 244076)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in 2019-04-09 15:56:45 UTC (rev 244077)
@@ -33,7 +33,6 @@
ProcessReadyToSuspend()
SetIsHoldingLockedFiles(bool isHoldingLockedFiles)
- SetIsIDBDatabaseHoldingLockedFiles(bool isIDBDatabaseHoldingLockedFiles)
# Diagnostic messages logging
LogDiagnosticMessage(uint64_t pageID, String message, String description, enum:bool WebCore::ShouldSample shouldSample)