Fix API test regression(s):
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Feb 2017 23:08:28 +0000 (23:08 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Feb 2017 23:08:28 +0000 (23:08 +0000)
REGRESSION (r213168): API test WKUserContentController.ScriptMessageHandlerMultipleHandlerRemoval crashing
https://bugs.webkit.org/show_bug.cgi?id=168991

Unreviewed.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebProcessPool.cpp

index 941f4a5..ea88ce3 100644 (file)
@@ -1,3 +1,14 @@
+2017-02-28  Brady Eidson  <beidson@apple.com>
+
+        Fix API test regression(s):
+        REGRESSION (r213168): API test WKUserContentController.ScriptMessageHandlerMultipleHandlerRemoval crashing
+        https://bugs.webkit.org/show_bug.cgi?id=168991
+
+        Unreviewed.
+
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
+
 2017-02-28  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Data interaction should support attachment elements
index ecc718b..82c775c 100644 (file)
@@ -795,7 +795,8 @@ WebProcessProxy& WebProcessPool::createNewWebProcessRespectingProcessCountLimit(
     }
 
     // Choose the process with fewest pages.
-    auto* processes = mustMatchDataStore ? &m_processes : &processesMatchingDataStore;
+    auto* processes = mustMatchDataStore ? &processesMatchingDataStore : &m_processes;
+    ASSERT(!processes->isEmpty());
     auto& process = *std::min_element(processes->begin(), processes->end(), [](const RefPtr<WebProcessProxy>& a, const RefPtr<WebProcessProxy>& b) {
         return a->pageCount() < b->pageCount();
     });