StorageManager should stop ref'ing IPC::Connections as this is leak-prone
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Aug 2018 19:09:16 +0000 (19:09 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Aug 2018 19:09:16 +0000 (19:09 +0000)
commiteead86a4074b02adc44105fc010b87fbe218cbd6
treef87cd09088ae32fce318919ef6c3aa894ced6014
parentbadddaaee1666f12dc873255f210d25f92fc2e4b
StorageManager should stop ref'ing IPC::Connections as this is leak-prone
https://bugs.webkit.org/show_bug.cgi?id=188380

Patch by Chris Dumez <cdumez@apple.com> on 2018-08-07
Reviewed by Alex Christensen.

StorageManager should stop ref'ing IPC::Connections as this is leak-prone. Instead, assign a unique identifier
to each IPC::Connection and store this identifier intead of a RefPtr<IPC::Connection>. When the StorageManager
needs an actual IPC::Connection, it can look it up from the identifier.

* Platform/IPC/Connection.cpp:
(IPC::Connection::Connection):
(IPC::Connection::~Connection):
(IPC::Connection::connection):
* Platform/IPC/Connection.h:
(IPC::Connection::uniqueID const):
* UIProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::StorageArea::addListener):
(WebKit::StorageManager::StorageArea::removeListener):
(WebKit::StorageManager::StorageArea::hasListener const):
(WebKit::StorageManager::StorageArea::setItem):
(WebKit::StorageManager::StorageArea::removeItem):
(WebKit::StorageManager::StorageArea::clear):
(WebKit::StorageManager::StorageArea::dispatchEvents const):
(WebKit::StorageManager::SessionStorageNamespace::allowedConnection const):
(WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection):
(WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection):
(WebKit::StorageManager::processDidCloseConnection):
(WebKit::StorageManager::createLocalStorageMap):
(WebKit::StorageManager::createTransientLocalStorageMap):
(WebKit::StorageManager::createSessionStorageMap):
(WebKit::StorageManager::destroyStorageMap):
(WebKit::StorageManager::setItem):
(WebKit::StorageManager::removeItem):
(WebKit::StorageManager::clear):
(WebKit::StorageManager::applicationWillTerminate):
(WebKit::StorageManager::findStorageArea const):
* UIProcess/WebStorage/StorageManager.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/Platform/IPC/Connection.cpp
Source/WebKit/Platform/IPC/Connection.h
Source/WebKit/UIProcess/WebStorage/StorageManager.cpp
Source/WebKit/UIProcess/WebStorage/StorageManager.h