Intermittent crash when typing in Address Bar
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 May 2013 18:09:09 +0000 (18:09 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 May 2013 18:09:09 +0000 (18:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=116728
<rdar://problem/13976781>

Reviewed by Sam Weinig.

If a web process connection has been removed from the storage manager because we disconnected it
since there were no more active pages associated with the web process, we'll fail to find it here
so just return early instead of crashing.

* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::destroyStorageMap):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150648 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/Storage/StorageManager.cpp

index 1dfe5b7..aab7c0f 100644 (file)
@@ -1,3 +1,18 @@
+2013-05-24  Anders Carlsson  <andersca@apple.com>
+
+        Intermittent crash when typing in Address Bar
+        https://bugs.webkit.org/show_bug.cgi?id=116728
+        <rdar://problem/13976781>
+
+        Reviewed by Sam Weinig.
+
+        If a web process connection has been removed from the storage manager because we disconnected it
+        since there were no more active pages associated with the web process, we'll fail to find it here
+        so just return early instead of crashing.
+
+        * UIProcess/Storage/StorageManager.cpp:
+        (WebKit::StorageManager::destroyStorageMap):
+
 2013-05-24  Andreas Kling  <akling@apple.com>
 
         Typing in Safari's unified field causes unnecessary web content repaints.
index 7082380..2f77c30 100644 (file)
@@ -496,9 +496,10 @@ void StorageManager::destroyStorageMap(CoreIPC::Connection* connection, uint64_t
     ASSERT((HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea>>::isValidKey(connectionAndStorageMapIDPair)));
 
     HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea>>::iterator it = m_storageAreasByConnection.find(connectionAndStorageMapIDPair);
-
-    // FIXME: This should be a message check.
-    ASSERT(it != m_storageAreasByConnection.end());
+    if (it == m_storageAreasByConnection.end()) {
+        // The connection has been removed because the last page was closed.
+        return;
+    }
 
     it->value->removeListener(connection, storageMapID);
     m_storageAreasByConnection.remove(connectionAndStorageMapIDPair);