Diff
Modified: branches/safari-609-branch/Source/WTF/ChangeLog (259836 => 259837)
--- branches/safari-609-branch/Source/WTF/ChangeLog 2020-04-09 22:56:34 UTC (rev 259836)
+++ branches/safari-609-branch/Source/WTF/ChangeLog 2020-04-09 23:19:24 UTC (rev 259837)
@@ -1,3 +1,7 @@
+2020-04-09 Alan Coon <[email protected]>
+
+ Revert r259689. rdar://problem/61269751
+
2020-04-07 Russell Epstein <[email protected]>
Cherry-pick r259316. rdar://problem/61269751
Modified: branches/safari-609-branch/Source/WTF/wtf/CrossThreadTaskHandler.cpp (259836 => 259837)
--- branches/safari-609-branch/Source/WTF/wtf/CrossThreadTaskHandler.cpp 2020-04-09 22:56:34 UTC (rev 259836)
+++ branches/safari-609-branch/Source/WTF/wtf/CrossThreadTaskHandler.cpp 2020-04-09 23:19:24 UTC (rev 259837)
@@ -37,9 +37,6 @@
Locker<Lock> locker(m_taskThreadCreationLock);
Thread::create(threadName, [this] {
taskRunLoop();
-
- if (m_completionCallback)
- m_completionCallback();
})->detach();
}
@@ -135,15 +132,4 @@
}
}
-void CrossThreadTaskHandler::setCompletionCallback(Function<void ()>&& completionCallback)
-{
- m_completionCallback = WTFMove(completionCallback);
-}
-
-void CrossThreadTaskHandler::kill()
-{
- m_taskQueue.kill();
- m_taskReplyQueue.kill();
-}
-
} // namespace WTF
Modified: branches/safari-609-branch/Source/WTF/wtf/CrossThreadTaskHandler.h (259836 => 259837)
--- branches/safari-609-branch/Source/WTF/wtf/CrossThreadTaskHandler.h 2020-04-09 22:56:34 UTC (rev 259836)
+++ branches/safari-609-branch/Source/WTF/wtf/CrossThreadTaskHandler.h 2020-04-09 23:19:24 UTC (rev 259837)
@@ -48,9 +48,6 @@
WTF_EXPORT_PRIVATE void suspendAndWait();
WTF_EXPORT_PRIVATE void resume();
- WTF_EXPORT_PRIVATE void kill();
- WTF_EXPORT_PRIVATE void setCompletionCallback(Function<void ()>&&);
-
private:
void handleTaskRepliesOnMainThread();
void taskRunLoop();
@@ -71,8 +68,6 @@
CrossThreadQueue<CrossThreadTask> m_taskQueue;
CrossThreadQueue<CrossThreadTask> m_taskReplyQueue;
-
- Function<void ()> m_completionCallback;
};
} // namespace WTF
Modified: branches/safari-609-branch/Source/WebCore/ChangeLog (259836 => 259837)
--- branches/safari-609-branch/Source/WebCore/ChangeLog 2020-04-09 22:56:34 UTC (rev 259836)
+++ branches/safari-609-branch/Source/WebCore/ChangeLog 2020-04-09 23:19:24 UTC (rev 259837)
@@ -1,3 +1,7 @@
+2020-04-09 Alan Coon <[email protected]>
+
+ Revert r259689. rdar://problem/61269751
+
2020-04-07 Russell Epstein <[email protected]>
Cherry-pick r259388. rdar://problem/61269730
Modified: branches/safari-609-branch/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp (259836 => 259837)
--- branches/safari-609-branch/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp 2020-04-09 22:56:34 UTC (rev 259836)
+++ branches/safari-609-branch/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp 2020-04-09 23:19:24 UTC (rev 259837)
@@ -60,9 +60,6 @@
IDBServer::~IDBServer()
{
ASSERT(!isMainThread());
-
- for (auto& database : m_uniqueIDBDatabaseMap.values())
- database->immediateClose();
}
void IDBServer::registerConnection(IDBConnectionToClient& connection)
@@ -537,7 +534,7 @@
HashSet<UniqueIDBDatabase*> openDatabases;
for (auto& database : m_uniqueIDBDatabaseMap.values())
- database->immediateClose();
+ database->immediateCloseForUserDelete();
m_uniqueIDBDatabaseMap.clear();
@@ -564,7 +561,7 @@
}
for (auto& database : openDatabases) {
- database->immediateClose();
+ database->immediateCloseForUserDelete();
m_uniqueIDBDatabaseMap.remove(database->identifier());
}
Modified: branches/safari-609-branch/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (259836 => 259837)
--- branches/safari-609-branch/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp 2020-04-09 22:56:34 UTC (rev 259836)
+++ branches/safari-609-branch/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp 2020-04-09 23:19:24 UTC (rev 259837)
@@ -1147,9 +1147,9 @@
request.connection().didDeleteDatabase(result);
}
-void UniqueIDBDatabase::immediateClose()
+void UniqueIDBDatabase::immediateCloseForUserDelete()
{
- LOG(IndexedDB, "UniqueIDBDatabase::immediateClose");
+ LOG(IndexedDB, "UniqueIDBDatabase::immediateCloseForUserDelete");
// Error out all transactions.
// Pending transactions must be cleared before in-progress transactions,
Modified: branches/safari-609-branch/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h (259836 => 259837)
--- branches/safari-609-branch/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h 2020-04-09 22:56:34 UTC (rev 259836)
+++ branches/safari-609-branch/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h 2020-04-09 23:19:24 UTC (rev 259837)
@@ -107,7 +107,7 @@
void enqueueTransaction(Ref<UniqueIDBDatabaseTransaction>&&);
void handleDelete(IDBConnectionToClient&, const IDBRequestData&);
- void immediateClose();
+ void immediateCloseForUserDelete();
void abortActiveTransactions();
Modified: branches/safari-609-branch/Source/WebKit/ChangeLog (259836 => 259837)
--- branches/safari-609-branch/Source/WebKit/ChangeLog 2020-04-09 22:56:34 UTC (rev 259836)
+++ branches/safari-609-branch/Source/WebKit/ChangeLog 2020-04-09 23:19:24 UTC (rev 259837)
@@ -1,3 +1,7 @@
+2020-04-09 Alan Coon <[email protected]>
+
+ Revert r259689. rdar://problem/61269751
+
2020-04-07 Russell Epstein <[email protected]>
Cherry-pick r259338. rdar://problem/61269727
Modified: branches/safari-609-branch/Source/WebKit/NetworkProcess/IndexedDB/WebIDBServer.cpp (259836 => 259837)
--- branches/safari-609-branch/Source/WebKit/NetworkProcess/IndexedDB/WebIDBServer.cpp 2020-04-09 22:56:34 UTC (rev 259836)
+++ branches/safari-609-branch/Source/WebKit/NetworkProcess/IndexedDB/WebIDBServer.cpp 2020-04-09 23:19:24 UTC (rev 259837)
@@ -53,12 +53,7 @@
});
semaphore.wait();
}
-
-WebIDBServer::~WebIDBServer()
-{
- ASSERT(RunLoop::isMain());
-}
-
+
void WebIDBServer::closeAndDeleteDatabasesModifiedSince(WallTime modificationTime, CompletionHandler<void()>&& callback)
{
ASSERT(RunLoop::isMain());
@@ -340,7 +335,6 @@
LockHolder locker(m_server->lock());
m_server->registerConnection(iter->value->connectionToClient());
});
- m_connections.add(&connection);
connection.addThreadMessageReceiver(Messages::WebIDBServer::messageReceiverName(), this);
}
@@ -348,7 +342,6 @@
{
ASSERT(RunLoop::isMain());
- m_connections.remove(&connection);
connection.removeThreadMessageReceiver(Messages::WebIDBServer::messageReceiverName());
postTask([this, protectedThis = makeRef(*this), connectionID = connection.uniqueID()] {
auto connection = m_connectionMap.take(connectionID);
@@ -372,26 +365,5 @@
CrossThreadTaskHandler::postTask(CrossThreadTask(WTFMove(task)));
}
-void WebIDBServer::close()
-{
- ASSERT(RunLoop::isMain());
-
- // Remove the references held by IPC::Connection.
- for (auto* connection : m_connections)
- connection->removeThreadMessageReceiver(Messages::WebIDBServer::messageReceiverName());
-
- CrossThreadTaskHandler::setCompletionCallback([protectedThis = makeRef(*this)]() mutable {
- ASSERT(!RunLoop::isMain());
- callOnMainRunLoop([protectedThis = WTFMove(protectedThis)]() mutable { });
- });
-
- postTask([this]() mutable {
- m_connectionMap.clear();
- m_server = nullptr;
-
- CrossThreadTaskHandler::kill();
- });
-}
-
} // namespace WebKit
#endif
Modified: branches/safari-609-branch/Source/WebKit/NetworkProcess/IndexedDB/WebIDBServer.h (259836 => 259837)
--- branches/safari-609-branch/Source/WebKit/NetworkProcess/IndexedDB/WebIDBServer.h 2020-04-09 22:56:34 UTC (rev 259836)
+++ branches/safari-609-branch/Source/WebKit/NetworkProcess/IndexedDB/WebIDBServer.h 2020-04-09 23:19:24 UTC (rev 259837)
@@ -87,11 +87,9 @@
void didReceiveMessage(IPC::Connection&, IPC::Decoder&);
void dispatchToThread(WTF::Function<void()>&&);
- void close();
private:
WebIDBServer(PAL::SessionID, const String& directory, WebCore::IDBServer::IDBServer::StorageQuotaManagerSpaceRequester&&);
- ~WebIDBServer();
void postTask(WTF::Function<void()>&&);
@@ -99,7 +97,6 @@
bool m_isSuspended { false };
HashMap<IPC::Connection::UniqueID, std::unique_ptr<WebIDBConnectionToClient>> m_connectionMap;
- HashSet<IPC::Connection*> m_connections;
};
} // namespace WebKit
Modified: branches/safari-609-branch/Source/WebKit/NetworkProcess/NetworkProcess.cpp (259836 => 259837)
--- branches/safari-609-branch/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2020-04-09 22:56:34 UTC (rev 259836)
+++ branches/safari-609-branch/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2020-04-09 23:19:24 UTC (rev 259837)
@@ -578,8 +578,6 @@
#endif
m_storageManagerSet->remove(sessionID);
- if (auto webIDBServer = m_webIDBServers.take(sessionID))
- webIDBServer->close();
}
#if ENABLE(RESOURCE_LOAD_STATISTICS)
@@ -2546,8 +2544,7 @@
void NetworkProcess::connectionToWebProcessClosed(IPC::Connection& connection, PAL::SessionID sessionID)
{
m_storageManagerSet->removeConnection(connection);
- if (auto* webIDBServer = m_webIDBServers.get(sessionID))
- webIDBServer->removeConnection(connection);
+ webIDBServer(sessionID).removeConnection(connection);
}
NetworkConnectionToWebProcess* NetworkProcess::webProcessConnection(ProcessIdentifier identifier) const