Changeset 234664 in webkit


Ignore:
Timestamp:
Aug 7, 2018 12:09:16 PM (6 years ago)
Author:
achristensen@apple.com
Message:

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 <Chris Dumez> 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:
Location:
trunk/Source/WebKit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r234662 r234664  
     12018-08-07  Chris Dumez  <cdumez@apple.com>
     2
     3        StorageManager should stop ref'ing IPC::Connections as this is leak-prone
     4        https://bugs.webkit.org/show_bug.cgi?id=188380
     5
     6        Reviewed by Alex Christensen.
     7
     8        StorageManager should stop ref'ing IPC::Connections as this is leak-prone. Instead, assign a unique identifier
     9        to each IPC::Connection and store this identifier intead of a RefPtr<IPC::Connection>. When the StorageManager
     10        needs an actual IPC::Connection, it can look it up from the identifier.
     11
     12        * Platform/IPC/Connection.cpp:
     13        (IPC::Connection::Connection):
     14        (IPC::Connection::~Connection):
     15        (IPC::Connection::connection):
     16        * Platform/IPC/Connection.h:
     17        (IPC::Connection::uniqueID const):
     18        * UIProcess/WebStorage/StorageManager.cpp:
     19        (WebKit::StorageManager::StorageArea::addListener):
     20        (WebKit::StorageManager::StorageArea::removeListener):
     21        (WebKit::StorageManager::StorageArea::hasListener const):
     22        (WebKit::StorageManager::StorageArea::setItem):
     23        (WebKit::StorageManager::StorageArea::removeItem):
     24        (WebKit::StorageManager::StorageArea::clear):
     25        (WebKit::StorageManager::StorageArea::dispatchEvents const):
     26        (WebKit::StorageManager::SessionStorageNamespace::allowedConnection const):
     27        (WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection):
     28        (WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection):
     29        (WebKit::StorageManager::processDidCloseConnection):
     30        (WebKit::StorageManager::createLocalStorageMap):
     31        (WebKit::StorageManager::createTransientLocalStorageMap):
     32        (WebKit::StorageManager::createSessionStorageMap):
     33        (WebKit::StorageManager::destroyStorageMap):
     34        (WebKit::StorageManager::setItem):
     35        (WebKit::StorageManager::removeItem):
     36        (WebKit::StorageManager::clear):
     37        (WebKit::StorageManager::applicationWillTerminate):
     38        (WebKit::StorageManager::findStorageArea const):
     39        * UIProcess/WebStorage/StorageManager.h:
     40
    1412018-08-07  Eric Carlson  <eric.carlson@apple.com>
    242
  • trunk/Source/WebKit/Platform/IPC/Connection.cpp

    r233808 r234664  
    232232}
    233233
     234static HashMap<IPC::Connection::UniqueID, Connection*>& allConnections()
     235{
     236    static NeverDestroyed<HashMap<IPC::Connection::UniqueID, Connection*>> map;
     237    return map;
     238}
     239
    234240Connection::Connection(Identifier identifier, bool isServer, Client& client)
    235241    : m_client(client)
     242    , m_uniqueID(generateObjectIdentifier<UniqueIDType>())
    236243    , m_isServer(isServer)
    237244    , m_syncRequestID(0)
     
    249256{
    250257    ASSERT(RunLoop::isMain());
     258    allConnections().add(m_uniqueID, this);
    251259
    252260    platformInitialize(identifier);
     
    260268Connection::~Connection()
    261269{
     270    ASSERT(RunLoop::isMain());
    262271    ASSERT(!isValid());
     272
     273    allConnections().remove(m_uniqueID);
     274}
     275
     276Connection* Connection::connection(UniqueID uniqueID)
     277{
     278    ASSERT(RunLoop::isMain());
     279    return allConnections().get(uniqueID);
    263280}
    264281
  • trunk/Source/WebKit/Platform/IPC/Connection.h

    r233111 r234664  
    4040#include <wtf/HashMap.h>
    4141#include <wtf/Lock.h>
     42#include <wtf/ObjectIdentifier.h>
    4243#include <wtf/OptionSet.h>
    4344#include <wtf/RunLoop.h>
     
    8788class UnixMessage;
    8889
    89 class Connection : public ThreadSafeRefCounted<Connection> {
     90class Connection : public ThreadSafeRefCounted<Connection, WTF::DestructionThread::Main> {
    9091public:
    9192    class Client : public MessageReceiver {
     
    151152
    152153    Client& client() const { return m_client; }
     154
     155    enum UniqueIDType { };
     156    using UniqueID = ObjectIdentifier<UniqueIDType>;
     157
     158    static Connection* connection(UniqueID);
     159    UniqueID uniqueID() const { return m_uniqueID; }
    153160
    154161    void setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(bool);
     
    272279
    273280    Client& m_client;
     281    UniqueID m_uniqueID;
    274282    bool m_isServer;
    275283    std::atomic<bool> m_isValid { true };
  • trunk/Source/WebKit/UIProcess/WebStorage/StorageManager.cpp

    r234611 r234664  
    5050    const WebCore::SecurityOriginData& securityOrigin() const { return m_securityOrigin; }
    5151
    52     void addListener(IPC::Connection&, uint64_t storageMapID);
    53     void removeListener(IPC::Connection&, uint64_t storageMapID);
    54     bool hasListener(IPC::Connection&, uint64_t storageMapID) const;
     52    void addListener(IPC::Connection::UniqueID, uint64_t storageMapID);
     53    void removeListener(IPC::Connection::UniqueID, uint64_t storageMapID);
     54    bool hasListener(IPC::Connection::UniqueID, uint64_t storageMapID) const;
    5555
    5656    Ref<StorageArea> clone() const;
    5757
    58     void setItem(IPC::Connection* sourceConnection, uint64_t sourceStorageAreaID, const String& key, const String& value, const String& urlString, bool& quotaException);
    59     void removeItem(IPC::Connection* sourceConnection, uint64_t sourceStorageAreaID, const String& key, const String& urlString);
    60     void clear(IPC::Connection* sourceConnection, uint64_t sourceStorageAreaID, const String& urlString);
     58    void setItem(IPC::Connection::UniqueID sourceConnection, uint64_t sourceStorageAreaID, const String& key, const String& value, const String& urlString, bool& quotaException);
     59    void removeItem(IPC::Connection::UniqueID sourceConnection, uint64_t sourceStorageAreaID, const String& key, const String& urlString);
     60    void clear(IPC::Connection::UniqueID sourceConnection, uint64_t sourceStorageAreaID, const String& urlString);
    6161
    6262    const HashMap<String, String>& items() const;
     
    7070    void openDatabaseAndImportItemsIfNeeded() const;
    7171
    72     void dispatchEvents(IPC::Connection* sourceConnection, uint64_t sourceStorageAreaID, const String& key, const String& oldValue, const String& newValue, const String& urlString) const;
     72    void dispatchEvents(IPC::Connection::UniqueID sourceConnection, uint64_t sourceStorageAreaID, const String& key, const String& oldValue, const String& newValue, const String& urlString) const;
    7373
    7474    // Will be null if the storage area belongs to a session storage namespace.
     
    8181
    8282    RefPtr<StorageMap> m_storageMap;
    83     HashSet<std::pair<RefPtr<IPC::Connection>, uint64_t>> m_eventListeners;
     83    HashSet<std::pair<IPC::Connection::UniqueID, uint64_t>> m_eventListeners;
    8484};
    8585
     
    186186}
    187187
    188 void StorageManager::StorageArea::addListener(IPC::Connection& connection, uint64_t storageMapID)
    189 {
    190     ASSERT(!m_eventListeners.contains(std::make_pair(&connection, storageMapID)));
    191     m_eventListeners.add(std::make_pair(&connection, storageMapID));
    192 }
    193 
    194 void StorageManager::StorageArea::removeListener(IPC::Connection& connection, uint64_t storageMapID)
    195 {
    196     ASSERT(isSessionStorage() || m_eventListeners.contains(std::make_pair(&connection, storageMapID)));
    197     m_eventListeners.remove(std::make_pair(&connection, storageMapID));
    198 }
    199 
    200 bool StorageManager::StorageArea::hasListener(IPC::Connection& connection, uint64_t storageMapID) const
    201 {
    202     return m_eventListeners.contains(std::make_pair(&connection, storageMapID));
     188void StorageManager::StorageArea::addListener(IPC::Connection::UniqueID connectionID, uint64_t storageMapID)
     189{
     190    ASSERT(!m_eventListeners.contains(std::make_pair(connectionID, storageMapID)));
     191    m_eventListeners.add(std::make_pair(connectionID, storageMapID));
     192}
     193
     194void StorageManager::StorageArea::removeListener(IPC::Connection::UniqueID connectionID, uint64_t storageMapID)
     195{
     196    ASSERT(isSessionStorage() || m_eventListeners.contains(std::make_pair(connectionID, storageMapID)));
     197    m_eventListeners.remove(std::make_pair(connectionID, storageMapID));
     198}
     199
     200bool StorageManager::StorageArea::hasListener(IPC::Connection::UniqueID connectionID, uint64_t storageMapID) const
     201{
     202    return m_eventListeners.contains(std::make_pair(connectionID, storageMapID));
    203203}
    204204
     
    213213}
    214214
    215 void StorageManager::StorageArea::setItem(IPC::Connection* sourceConnection, uint64_t sourceStorageAreaID, const String& key, const String& value, const String& urlString, bool& quotaException)
     215void StorageManager::StorageArea::setItem(IPC::Connection::UniqueID sourceConnection, uint64_t sourceStorageAreaID, const String& key, const String& value, const String& urlString, bool& quotaException)
    216216{
    217217    openDatabaseAndImportItemsIfNeeded();
     
    232232}
    233233
    234 void StorageManager::StorageArea::removeItem(IPC::Connection* sourceConnection, uint64_t sourceStorageAreaID, const String& key, const String& urlString)
     234void StorageManager::StorageArea::removeItem(IPC::Connection::UniqueID sourceConnection, uint64_t sourceStorageAreaID, const String& key, const String& urlString)
    235235{
    236236    openDatabaseAndImportItemsIfNeeded();
     
    250250}
    251251
    252 void StorageManager::StorageArea::clear(IPC::Connection* sourceConnection, uint64_t sourceStorageAreaID, const String& urlString)
     252void StorageManager::StorageArea::clear(IPC::Connection::UniqueID sourceConnection, uint64_t sourceStorageAreaID, const String& urlString)
    253253{
    254254    openDatabaseAndImportItemsIfNeeded();
     
    281281    }
    282282
    283     for (auto it = m_eventListeners.begin(), end = m_eventListeners.end(); it != end; ++it)
    284         it->first->send(Messages::StorageAreaMap::ClearCache(), it->second);
     283    for (auto it = m_eventListeners.begin(), end = m_eventListeners.end(); it != end; ++it) {
     284        RunLoop::main().dispatch([connectionID = it->first, destinationStorageAreaID = it->second] {
     285            if (auto* connection = IPC::Connection::connection(connectionID))
     286                connection->send(Messages::StorageAreaMap::ClearCache(), destinationStorageAreaID);
     287        });
     288    }
    285289}
    286290
     
    301305}
    302306
    303 void StorageManager::StorageArea::dispatchEvents(IPC::Connection* sourceConnection, uint64_t sourceStorageAreaID, const String& key, const String& oldValue, const String& newValue, const String& urlString) const
    304 {
    305     for (HashSet<std::pair<RefPtr<IPC::Connection>, uint64_t>>::const_iterator it = m_eventListeners.begin(), end = m_eventListeners.end(); it != end; ++it) {
    306         uint64_t storageAreaID = it->first == sourceConnection ? sourceStorageAreaID : 0;
    307 
    308         it->first->send(Messages::StorageAreaMap::DispatchStorageEvent(storageAreaID, key, oldValue, newValue, urlString), it->second);
     307void StorageManager::StorageArea::dispatchEvents(IPC::Connection::UniqueID sourceConnection, uint64_t sourceStorageAreaID, const String& key, const String& oldValue, const String& newValue, const String& urlString) const
     308{
     309    for (auto it = m_eventListeners.begin(), end = m_eventListeners.end(); it != end; ++it) {
     310        sourceStorageAreaID = it->first == sourceConnection ? sourceStorageAreaID : 0;
     311
     312        RunLoop::main().dispatch([connectionID = it->first, sourceStorageAreaID, destinationStorageAreaID = it->second, key = key.isolatedCopy(), oldValue = oldValue.isolatedCopy(), newValue = newValue.isolatedCopy(), urlString = urlString.isolatedCopy()] {
     313            if (auto* connection = IPC::Connection::connection(connectionID))
     314                connection->send(Messages::StorageAreaMap::DispatchStorageEvent(sourceStorageAreaID, key, oldValue, newValue, urlString), destinationStorageAreaID);
     315        });
    309316    }
    310317}
     
    374381    bool isEmpty() const { return m_storageAreaMap.isEmpty(); }
    375382
    376     IPC::Connection* allowedConnection() const { return m_allowedConnection.get(); }
    377     void setAllowedConnection(IPC::Connection*);
     383    IPC::Connection::UniqueID allowedConnection() const { return m_allowedConnection; }
     384    void setAllowedConnection(IPC::Connection::UniqueID);
    378385
    379386    Ref<StorageArea> getOrCreateStorageArea(SecurityOriginData&&);
     
    410417    explicit SessionStorageNamespace(unsigned quotaInBytes);
    411418
    412     RefPtr<IPC::Connection> m_allowedConnection;
     419    IPC::Connection::UniqueID m_allowedConnection;
    413420    unsigned m_quotaInBytes;
    414421
     
    430437}
    431438
    432 void StorageManager::SessionStorageNamespace::setAllowedConnection(IPC::Connection* allowedConnection)
     439void StorageManager::SessionStorageNamespace::setAllowedConnection(IPC::Connection::UniqueID allowedConnection)
    433440{
    434441    m_allowedConnection = allowedConnection;
     
    486493void StorageManager::setAllowedSessionStorageNamespaceConnection(uint64_t storageNamespaceID, IPC::Connection* allowedConnection)
    487494{
    488     m_queue->dispatch([this, protectedThis = makeRef(*this), connection = RefPtr<IPC::Connection>(allowedConnection), storageNamespaceID]() mutable {
     495    auto allowedConnectionID = allowedConnection ? allowedConnection->uniqueID() : IPC::Connection::UniqueID { };
     496    m_queue->dispatch([this, protectedThis = makeRef(*this), allowedConnectionID, storageNamespaceID]() mutable {
    489497        ASSERT(m_sessionStorageNamespaces.contains(storageNamespaceID));
    490498
    491         m_sessionStorageNamespaces.get(storageNamespaceID)->setAllowedConnection(connection.get());
     499        m_sessionStorageNamespaces.get(storageNamespaceID)->setAllowedConnection(allowedConnectionID);
    492500    });
    493501}
     
    520528    connection.removeWorkQueueMessageReceiver(Messages::StorageManager::messageReceiverName());
    521529
    522     m_queue->dispatch([this, protectedThis = makeRef(*this), connection = Ref<IPC::Connection>(connection)]() mutable {
    523         Vector<std::pair<RefPtr<IPC::Connection>, uint64_t>> connectionAndStorageMapIDPairsToRemove;
     530    m_queue->dispatch([this, protectedThis = makeRef(*this), connectionID = connection.uniqueID()]() mutable {
     531        Vector<std::pair<IPC::Connection::UniqueID, uint64_t>> connectionAndStorageMapIDPairsToRemove;
    524532        for (auto& storageArea : m_storageAreasByConnection) {
    525             if (storageArea.key.first != connection.ptr())
     533            if (storageArea.key.first != connectionID)
    526534                continue;
    527535
    528             storageArea.value->removeListener(*storageArea.key.first, storageArea.key.second);
     536            storageArea.value->removeListener(storageArea.key.first, storageArea.key.second);
    529537            connectionAndStorageMapIDPairsToRemove.append(storageArea.key);
    530538        }
     
    666674void StorageManager::createLocalStorageMap(IPC::Connection& connection, uint64_t storageMapID, uint64_t storageNamespaceID, SecurityOriginData&& securityOriginData)
    667675{
    668     std::pair<RefPtr<IPC::Connection>, uint64_t> connectionAndStorageMapIDPair(&connection, storageMapID);
     676    std::pair<IPC::Connection::UniqueID, uint64_t> connectionAndStorageMapIDPair(connection.uniqueID(), storageMapID);
    669677
    670678    // FIXME: This should be a message check.
    671     ASSERT((HashMap<std::pair<RefPtr<IPC::Connection>, uint64_t>, RefPtr<StorageArea>>::isValidKey(connectionAndStorageMapIDPair)));
    672 
    673     HashMap<std::pair<RefPtr<IPC::Connection>, uint64_t>, RefPtr<StorageArea>>::AddResult result = m_storageAreasByConnection.add(connectionAndStorageMapIDPair, nullptr);
     679    ASSERT((HashMap<std::pair<IPC::Connection::UniqueID, uint64_t>, RefPtr<StorageArea>>::isValidKey(connectionAndStorageMapIDPair)));
     680
     681    auto result = m_storageAreasByConnection.add(connectionAndStorageMapIDPair, nullptr);
    674682
    675683    // FIXME: These should be a message checks.
     
    683691
    684692    auto storageArea = localStorageNamespace->getOrCreateStorageArea(WTFMove(securityOriginData));
    685     storageArea->addListener(connection, storageMapID);
     693    storageArea->addListener(connection.uniqueID(), storageMapID);
    686694
    687695    result.iterator->value = WTFMove(storageArea);
     
    691699{
    692700    // FIXME: This should be a message check.
    693     ASSERT(m_storageAreasByConnection.isValidKey({ &connection, storageMapID }));
     701    ASSERT(m_storageAreasByConnection.isValidKey({ connection.uniqueID(), storageMapID }));
    694702
    695703    // See if we already have session storage for this connection/origin combo.
    696704    // If so, update the map with the new ID, otherwise keep on trucking.
    697705    for (auto it = m_storageAreasByConnection.begin(), end = m_storageAreasByConnection.end(); it != end; ++it) {
    698         if (it->key.first != &connection)
     706        if (it->key.first != connection.uniqueID())
    699707            continue;
    700708        Ref<StorageArea> area = *it->value;
     
    703711        if (!origin.securityOrigin()->isSameSchemeHostPort(area->securityOrigin().securityOrigin().get()))
    704712            continue;
    705         area->addListener(connection, storageMapID);
     713        area->addListener(connection.uniqueID(), storageMapID);
    706714        // If the storageMapID used as key in m_storageAreasByConnection is no longer one of the StorageArea's listeners, then this means
    707715        // that destroyStorageMap() was already called for that storageMapID but it decided not to remove it from m_storageAreasByConnection
    708716        // so that we could reuse it later on for the same connection/origin combo. In this case, it is safe to remove the previous
    709717        // storageMapID from m_storageAreasByConnection.
    710         if (!area->hasListener(connection, it->key.second))
     718        if (!area->hasListener(connection.uniqueID(), it->key.second))
    711719            m_storageAreasByConnection.remove(it);
    712         m_storageAreasByConnection.add({ &connection, storageMapID }, WTFMove(area));
    713         return;
    714     }
    715 
    716     auto& slot = m_storageAreasByConnection.add({ &connection, storageMapID }, nullptr).iterator->value;
     720        m_storageAreasByConnection.add({ connection.uniqueID(), storageMapID }, WTFMove(area));
     721        return;
     722    }
     723
     724    auto& slot = m_storageAreasByConnection.add({ connection.uniqueID(), storageMapID }, nullptr).iterator->value;
    717725
    718726    // FIXME: This should be a message check.
     
    722730
    723731    auto storageArea = transientLocalStorageNamespace->getOrCreateStorageArea(WTFMove(origin));
    724     storageArea->addListener(connection, storageMapID);
     732    storageArea->addListener(connection.uniqueID(), storageMapID);
    725733
    726734    slot = WTFMove(storageArea);
     
    740748
    741749    // FIXME: This should be a message check.
    742     ASSERT(m_storageAreasByConnection.isValidKey({ &connection, storageMapID }));
    743 
    744     auto& slot = m_storageAreasByConnection.add({ &connection, storageMapID }, nullptr).iterator->value;
     750    ASSERT(m_storageAreasByConnection.isValidKey({ connection.uniqueID(), storageMapID }));
     751
     752    auto& slot = m_storageAreasByConnection.add({ connection.uniqueID(), storageMapID }, nullptr).iterator->value;
    745753
    746754    // FIXME: This should be a message check.
     
    748756
    749757    // FIXME: This should be a message check.
    750     ASSERT(&connection == sessionStorageNamespace->allowedConnection());
     758    ASSERT(connection.uniqueID() == sessionStorageNamespace->allowedConnection());
    751759
    752760    auto storageArea = sessionStorageNamespace->getOrCreateStorageArea(WTFMove(securityOriginData));
    753     storageArea->addListener(connection, storageMapID);
     761    storageArea->addListener(connection.uniqueID(), storageMapID);
    754762
    755763    slot = WTFMove(storageArea);
     
    758766void StorageManager::destroyStorageMap(IPC::Connection& connection, uint64_t storageMapID)
    759767{
    760     std::pair<RefPtr<IPC::Connection>, uint64_t> connectionAndStorageMapIDPair(&connection, storageMapID);
     768    std::pair<IPC::Connection::UniqueID, uint64_t> connectionAndStorageMapIDPair(connection.uniqueID(), storageMapID);
    761769
    762770    // FIXME: This should be a message check.
     
    769777    }
    770778
    771     it->value->removeListener(connection, storageMapID);
     779    it->value->removeListener(connection.uniqueID(), storageMapID);
    772780
    773781    // Don't remove session storage maps. The web process may reconnect and expect the data to still be around.
     
    799807
    800808    bool quotaError;
    801     storageArea->setItem(&connection, sourceStorageAreaID, key, value, urlString, quotaError);
     809    storageArea->setItem(connection.uniqueID(), sourceStorageAreaID, key, value, urlString, quotaError);
    802810    connection.send(Messages::StorageAreaMap::DidSetItem(storageMapSeed, key, quotaError), storageMapID);
    803811}
     
    811819    }
    812820
    813     storageArea->removeItem(&connection, sourceStorageAreaID, key, urlString);
     821    storageArea->removeItem(connection.uniqueID(), sourceStorageAreaID, key, urlString);
    814822    connection.send(Messages::StorageAreaMap::DidRemoveItem(storageMapSeed, key), storageMapID);
    815823}
     
    823831    }
    824832
    825     storageArea->clear(&connection, sourceStorageAreaID, urlString);
     833    storageArea->clear(connection.uniqueID(), sourceStorageAreaID, urlString);
    826834    connection.send(Messages::StorageAreaMap::DidClear(storageMapSeed), storageMapID);
    827835}
     
    831839    BinarySemaphore semaphore;
    832840    m_queue->dispatch([this, &semaphore] {
    833         Vector<std::pair<RefPtr<IPC::Connection>, uint64_t>> connectionAndStorageMapIDPairsToRemove;
     841        Vector<std::pair<IPC::Connection::UniqueID, uint64_t>> connectionAndStorageMapIDPairsToRemove;
    834842        for (auto& connectionStorageAreaPair : m_storageAreasByConnection) {
    835             connectionStorageAreaPair.value->removeListener(*connectionStorageAreaPair.key.first, connectionStorageAreaPair.key.second);
     843            connectionStorageAreaPair.value->removeListener(connectionStorageAreaPair.key.first, connectionStorageAreaPair.key.second);
    836844            connectionAndStorageMapIDPairsToRemove.append(connectionStorageAreaPair.key);
    837845        }
     
    847855StorageManager::StorageArea* StorageManager::findStorageArea(IPC::Connection& connection, uint64_t storageMapID) const
    848856{
    849     std::pair<IPC::Connection*, uint64_t> connectionAndStorageMapIDPair(&connection, storageMapID);
     857    std::pair<IPC::Connection::UniqueID, uint64_t> connectionAndStorageMapIDPair(connection.uniqueID(), storageMapID);
    850858
    851859    if (!m_storageAreasByConnection.isValidKey(connectionAndStorageMapIDPair))
  • trunk/Source/WebKit/UIProcess/WebStorage/StorageManager.h

    r232410 r234664  
    106106    HashMap<uint64_t, RefPtr<SessionStorageNamespace>> m_sessionStorageNamespaces;
    107107
    108     HashMap<std::pair<RefPtr<IPC::Connection>, uint64_t>, RefPtr<StorageArea>> m_storageAreasByConnection;
     108    HashMap<std::pair<IPC::Connection::UniqueID, uint64_t>, RefPtr<StorageArea>> m_storageAreasByConnection;
    109109};
    110110
Note: See TracChangeset for help on using the changeset viewer.