Title: [243379] trunk/Source/WebKit
Revision
243379
Author
cdu...@apple.com
Date
2019-03-22 09:27:14 -0700 (Fri, 22 Mar 2019)

Log Message

REGRESSION (r243094): ePub files do not render or open in Books
https://bugs.webkit.org/show_bug.cgi?id=196119
<rdar://problem/49121686>

Reviewed by Brady Eidson.

Do not delay the WebProcess launch until a load when contructing a web view and the client
may observe when its injected bundle is loaded via WKProcessGroupDelegate's
didCreateConnectionToWebProcessPlugIn.

* UIProcess/API/Cocoa/WKProcessGroup.mm:
(-[WKProcessGroup setDelegate:]):
* UIProcess/WebInspectorUtilities.cpp:
(WebKit::inspectorProcessPool):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createWebPage):
* UIProcess/WebProcessPool.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (243378 => 243379)


--- trunk/Source/WebKit/ChangeLog	2019-03-22 16:03:31 UTC (rev 243378)
+++ trunk/Source/WebKit/ChangeLog	2019-03-22 16:27:14 UTC (rev 243379)
@@ -1,3 +1,23 @@
+2019-03-22  Chris Dumez  <cdu...@apple.com>
+
+        REGRESSION (r243094): ePub files do not render or open in Books
+        https://bugs.webkit.org/show_bug.cgi?id=196119
+        <rdar://problem/49121686>
+
+        Reviewed by Brady Eidson.
+
+        Do not delay the WebProcess launch until a load when contructing a web view and the client
+        may observe when its injected bundle is loaded via WKProcessGroupDelegate's
+        didCreateConnectionToWebProcessPlugIn.
+
+        * UIProcess/API/Cocoa/WKProcessGroup.mm:
+        (-[WKProcessGroup setDelegate:]):
+        * UIProcess/WebInspectorUtilities.cpp:
+        (WebKit::inspectorProcessPool):
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::createWebPage):
+        * UIProcess/WebProcessPool.h:
+
 2019-03-22  Carlos Garcia Campos  <cgar...@igalia.com>
 
         REGRESSION(r243094): Automation: browser crash in WebAutomationSession::exitFullscreenWindowForPage()

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessGroup.mm (243378 => 243379)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessGroup.mm	2019-03-22 16:03:31 UTC (rev 243378)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessGroup.mm	2019-03-22 16:27:14 UTC (rev 243379)
@@ -215,6 +215,11 @@
 - (void)setDelegate:(id <WKProcessGroupDelegate>)delegate
 {
     _delegate = delegate;
+
+    // If the client can observe when the connection to the WebProcess injected bundle is established, then we cannot
+    // safely delay the launch of the WebProcess until something is loaded in the Web view.
+    if ([delegate respondsToSelector:@selector(processGroup:didCreateConnectionToWebProcessPlugIn:)])
+        _processPool->disableDelayedWebProcessLaunch();
 }
 
 @end

Modified: trunk/Source/WebKit/UIProcess/WebInspectorUtilities.cpp (243378 => 243379)


--- trunk/Source/WebKit/UIProcess/WebInspectorUtilities.cpp	2019-03-22 16:03:31 UTC (rev 243378)
+++ trunk/Source/WebKit/UIProcess/WebInspectorUtilities.cpp	2019-03-22 16:27:14 UTC (rev 243379)
@@ -82,6 +82,8 @@
     if (!pool) {
         auto configuration = API::ProcessPoolConfiguration::createWithLegacyOptions();
         pool = &WebProcessPool::create(configuration.get()).leakRef();
+        // Do not delay process launch for inspector pages as inspector pages do not know how to transition from a terminated process.
+        pool->disableDelayedWebProcessLaunch();
     }
     return *pool;
 }

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (243378 => 243379)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2019-03-22 16:03:31 UTC (rev 243378)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2019-03-22 16:27:14 UTC (rev 243379)
@@ -1218,10 +1218,7 @@
         // We do not support several WebsiteDataStores sharing a single process.
         ASSERT(process.get() == m_dummyProcessProxy || &pageConfiguration->websiteDataStore()->websiteDataStore() == &process->websiteDataStore());
         ASSERT(&pageConfiguration->relatedPage()->websiteDataStore() == &pageConfiguration->websiteDataStore()->websiteDataStore());
-    } else if (WebKit::isInspectorProcessPool(*this)) {
-        // Do not delay process launch for inspector pages as inspector pages do not know how to transition from a terminated process.
-        process = &processForRegistrableDomain(pageConfiguration->websiteDataStore()->websiteDataStore(), nullptr, { });
-    } else {
+    } else if (!m_isDelayedWebProcessLaunchDisabled) {
         // In the common case, we delay process launch until something is actually loaded in the page.
         if (!m_dummyProcessProxy) {
             auto dummyProcessProxy = WebProcessProxy::create(*this, WebsiteDataStore::createNonPersistent().get(), WebProcessProxy::IsPrewarmed::No, WebProcessProxy::ShouldLaunchProcess::No);
@@ -1229,7 +1226,9 @@
             m_processes.append(WTFMove(dummyProcessProxy));
         }
         process = m_dummyProcessProxy;
-    }
+    } else
+        process = &processForRegistrableDomain(pageConfiguration->websiteDataStore()->websiteDataStore(), nullptr, { });
+
     ASSERT(process);
 
     auto page = process->createWebPage(pageClient, WTFMove(pageConfiguration));

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.h (243378 => 243379)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.h	2019-03-22 16:03:31 UTC (rev 243378)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.h	2019-03-22 16:27:14 UTC (rev 243379)
@@ -505,6 +505,8 @@
     void setWebProcessHasUploads(WebCore::ProcessIdentifier);
     void clearWebProcessHasUploads(WebCore::ProcessIdentifier);
 
+    void disableDelayedWebProcessLaunch() { m_isDelayedWebProcessLaunchDisabled = true; }
+
 private:
     void platformInitialize();
 
@@ -785,6 +787,7 @@
 
     HashMap<WebCore::ProcessIdentifier, std::unique_ptr<ProcessAssertion>> m_processesWithUploads;
     std::unique_ptr<ProcessAssertion> m_uiProcessUploadAssertion;
+    bool m_isDelayedWebProcessLaunchDisabled { false };
 };
 
 template<typename T>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to