Changeset 148229 in webkit
- Timestamp:
- Apr 11, 2013 1:14:45 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r148219 r148229 1 2013-04-11 Anders Carlsson <andersca@apple.com> 2 3 Clean up related storage areas when a connection is destroyed 4 https://bugs.webkit.org/show_bug.cgi?id=114459 5 6 Reviewed by Beth Dakin. 7 8 * UIProcess/Storage/StorageManager.cpp: 9 (WebKit::StorageManager::processWillCloseConnection): 10 Dispatch invalidateConnectionInternal on the work queue. 11 12 (WebKit::StorageManager::createStorageMap): 13 (WebKit::StorageManager::destroyStorageMap): 14 Rename m_storageAreas to m_storageAreasByConnection. 15 16 (WebKit::StorageManager::invalidateConnectionInternal): 17 Go over all known storage areas and remove this connection as a listener. 18 19 (WebKit::StorageManager::findStorageArea): 20 Rename m_storageAreas to m_storageAreasByConnection. 21 22 * UIProcess/Storage/StorageManager.h: 23 Rename m_storageAreas to m_storageAreasByConnection. 24 1 25 2013-04-11 Anders Carlsson <andersca@apple.com> 2 26 -
trunk/Source/WebKit2/UIProcess/Storage/StorageManager.cpp
r148215 r148229 207 207 { 208 208 webProcessProxy->connection()->removeWorkQueueMessageReceiver(Messages::StorageManager::messageReceiverName()); 209 210 m_queue->dispatch(bind(&StorageManager::invalidateConnectionInternal, this, RefPtr<CoreIPC::Connection>(webProcessProxy->connection()))); 209 211 } 210 212 … … 216 218 ASSERT((HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> >::isValidKey(connectionAndStorageMapIDPair))); 217 219 218 HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> >::AddResult result = m_storageAreas .add(connectionAndStorageMapIDPair, 0);220 HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> >::AddResult result = m_storageAreasByConnection.add(connectionAndStorageMapIDPair, 0); 219 221 220 222 // FIXME: This should be a message check. … … 246 248 ASSERT((HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> >::isValidKey(connectionAndStorageMapIDPair))); 247 249 248 HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> >::iterator it = m_storageAreas .find(connectionAndStorageMapIDPair);249 250 // FIXME: This should be a message check. 251 ASSERT(it != m_storageAreas .end());250 HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> >::iterator it = m_storageAreasByConnection.find(connectionAndStorageMapIDPair); 251 252 // FIXME: This should be a message check. 253 ASSERT(it != m_storageAreasByConnection.end()); 252 254 253 255 it->value->removeListener(connection, storageMapID); 254 255 m_storageAreas.remove(connectionAndStorageMapIDPair); 256 m_storageAreasByConnection.remove(connectionAndStorageMapIDPair); 256 257 } 257 258 … … 305 306 } 306 307 308 void StorageManager::invalidateConnectionInternal(CoreIPC::Connection* connection) 309 { 310 Vector<std::pair<RefPtr<CoreIPC::Connection>, uint64_t> > connectionAndStorageMapIDPairsToRemove; 311 HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> > storageAreasByConnection = m_storageAreasByConnection; 312 for (HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> >::const_iterator it = storageAreasByConnection.begin(), end = storageAreasByConnection.end(); it != end; ++it) { 313 if (it->key.first != connection) 314 continue; 315 316 it->value->removeListener(it->key.first.get(), it->key.second); 317 connectionAndStorageMapIDPairsToRemove.append(it->key); 318 } 319 320 for (size_t i = 0; i < connectionAndStorageMapIDPairsToRemove.size(); ++i) 321 m_storageAreasByConnection.remove(connectionAndStorageMapIDPairsToRemove[i]); 322 } 323 307 324 StorageManager::StorageArea* StorageManager::findStorageArea(CoreIPC::Connection* connection, uint64_t storageMapID) const 308 325 { … … 311 328 return 0; 312 329 313 return m_storageAreas .get(connectionAndStorageMapIDPair).get();330 return m_storageAreasByConnection.get(connectionAndStorageMapIDPair).get(); 314 331 } 315 332 -
trunk/Source/WebKit2/UIProcess/Storage/StorageManager.h
r148215 r148229 70 70 void cloneSessionStorageNamespaceInternal(uint64_t storageNamespaceID, uint64_t newStorageNamespaceID); 71 71 72 void invalidateConnectionInternal(CoreIPC::Connection*); 73 72 74 class StorageArea; 73 75 StorageArea* findStorageArea(CoreIPC::Connection*, uint64_t) const; … … 78 80 HashMap<uint64_t, RefPtr<SessionStorageNamespace> > m_sessionStorageNamespaces; 79 81 80 HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> > m_storageAreas ;82 HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> > m_storageAreasByConnection; 81 83 }; 82 84
Note: See TracChangeset
for help on using the changeset viewer.