Title: [273575] trunk/Source/WebKit
Revision
273575
Author
pvol...@apple.com
Date
2021-02-26 12:21:36 -0800 (Fri, 26 Feb 2021)

Log Message

[Cocoa] Start WebContent process pre-warming when process is initialized
https://bugs.webkit.org/show_bug.cgi?id=222476

Reviewed by Chris Dumez.

Instead of pre-warming in response to a message, the WebContent process can start pre-warming automatically
if it is of a pre-warmed process type. This saves one IPC message on startup of the WebContent process.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
* WebProcess/WebProcess.messages.in:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (273574 => 273575)


--- trunk/Source/WebKit/ChangeLog	2021-02-26 20:09:23 UTC (rev 273574)
+++ trunk/Source/WebKit/ChangeLog	2021-02-26 20:21:36 UTC (rev 273575)
@@ -1,3 +1,19 @@
+2021-02-26  Per Arne  <pvol...@apple.com>
+
+        [Cocoa] Start WebContent process pre-warming when process is initialized
+        https://bugs.webkit.org/show_bug.cgi?id=222476
+
+        Reviewed by Chris Dumez.
+
+        Instead of pre-warming in response to a message, the WebContent process can start pre-warming automatically
+        if it is of a pre-warmed process type. This saves one IPC message on startup of the WebContent process.
+
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::initializeNewWebProcess):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+        * WebProcess/WebProcess.messages.in:
+
 2021-02-26  Devin Rousso  <drou...@apple.com>
 
         Provide the image URL for accessibility image extraction

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (273574 => 273575)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2021-02-26 20:09:23 UTC (rev 273574)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2021-02-26 20:21:36 UTC (rev 273575)
@@ -865,7 +865,6 @@
     if (isPrewarmed == WebProcessProxy::IsPrewarmed::Yes) {
         ASSERT(!m_prewarmedProcess);
         m_prewarmedProcess = &process;
-        process.send(Messages::WebProcess::PrewarmGlobally(), 0);
     }
 
 #if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (273574 => 273575)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2021-02-26 20:09:23 UTC (rev 273574)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2021-02-26 20:21:36 UTC (rev 273575)
@@ -510,6 +510,11 @@
     WebResourceLoadObserver::setShouldLogUserInteraction(parameters.shouldLogUserInteraction);
 #endif
 
+#if PLATFORM(COCOA)
+    if (m_processType == ProcessType::PrewarmedWebContent)
+        prewarmGlobally();
+#endif
+
     RELEASE_LOG_IF_ALLOWED(Process, "initializeWebProcess: Presenting processPID=%d", WebCore::presentingApplicationPID());
 }
 

Modified: trunk/Source/WebKit/WebProcess/WebProcess.messages.in (273574 => 273575)


--- trunk/Source/WebKit/WebProcess/WebProcess.messages.in	2021-02-26 20:09:23 UTC (rev 273574)
+++ trunk/Source/WebKit/WebProcess/WebProcess.messages.in	2021-02-26 20:21:36 UTC (rev 273575)
@@ -26,7 +26,6 @@
 
     CreateWebPage(WebCore::PageIdentifier newPageID, struct WebKit::WebPageCreationParameters pageCreationParameters)
 
-    PrewarmGlobally();
     PrewarmWithDomainInformation(struct WebCore::PrewarmInformation prewarmInformation)
 
     # Global preferences.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to