Title: [263271] trunk/Source/WebKit
Revision
263271
Author
cdu...@apple.com
Date
2020-06-19 09:30:08 -0700 (Fri, 19 Jun 2020)

Log Message

Web Inspector: RemoteInspector::singleton() slows down MobileSafari launch
https://bugs.webkit.org/show_bug.cgi?id=213381
<rdar://problem/64533003>

Reviewed by Darin Adler.

RemoteInspector::singleton() is expensive according to traces. It was called in WebProcessPool::initializeNewWebProcess()
which happens on MobileSafari launch because we prewarm a WebProcess. However, there is no reason to initialize remote
Web Inspector at this point. Per associated comment, Remote Web Inspector needs to be initialized once there is a
sub process hosting one of our Web View. As a result, I moved the initialization call to WebPageProxy::initializeWebPage()
which is when we actually send the IPC to the WebProcess to create the WebPage that is backing the UI-side WebView.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeWebPage):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (263270 => 263271)


--- trunk/Source/WebKit/ChangeLog	2020-06-19 16:21:49 UTC (rev 263270)
+++ trunk/Source/WebKit/ChangeLog	2020-06-19 16:30:08 UTC (rev 263271)
@@ -1,5 +1,24 @@
 2020-06-19  Chris Dumez  <cdu...@apple.com>
 
+        Web Inspector: RemoteInspector::singleton() slows down MobileSafari launch
+        https://bugs.webkit.org/show_bug.cgi?id=213381
+        <rdar://problem/64533003>
+
+        Reviewed by Darin Adler.
+
+        RemoteInspector::singleton() is expensive according to traces. It was called in WebProcessPool::initializeNewWebProcess()
+        which happens on MobileSafari launch because we prewarm a WebProcess. However, there is no reason to initialize remote
+        Web Inspector at this point. Per associated comment, Remote Web Inspector needs to be initialized once there is a
+        sub process hosting one of our Web View. As a result, I moved the initialization call to WebPageProxy::initializeWebPage()
+        which is when we actually send the IPC to the WebProcess to create the WebPage that is backing the UI-side WebView.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::initializeWebPage):
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::initializeNewWebProcess):
+
+2020-06-19  Chris Dumez  <cdu...@apple.com>
+
         Move Prefixed WebAudio interfaces behind their own feature flag
         https://bugs.webkit.org/show_bug.cgi?id=213356
 

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (263270 => 263271)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-06-19 16:21:49 UTC (rev 263270)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-06-19 16:30:08 UTC (rev 263271)
@@ -1059,6 +1059,11 @@
     setDrawingArea(pageClient().createDrawingAreaProxy(m_process));
     ASSERT(m_drawingArea);
 
+#if ENABLE(REMOTE_INSPECTOR)
+    // Initialize remote inspector connection now that we have a sub-process that is hosting one of our web views.
+    Inspector::RemoteInspector::singleton();
+#endif
+
     send(Messages::WebProcess::CreateWebPage(m_webPageID, creationParameters(m_process, *m_drawingArea)), 0);
 
     m_process->addVisitedLinkStoreUser(visitedLinkStore(), m_identifier);

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (263270 => 263271)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2020-06-19 16:21:49 UTC (rev 263270)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2020-06-19 16:30:08 UTC (rev 263271)
@@ -1115,11 +1115,6 @@
     process.send(Messages::WebProcess::BacklightLevelDidChange(displayBrightness()), 0);
 #endif
 
-#if ENABLE(REMOTE_INSPECTOR)
-    // Initialize remote inspector connection now that we have a sub-process that is hosting one of our web views.
-    Inspector::RemoteInspector::singleton();
-#endif
-
 #if PLATFORM(MAC)
     registerDisplayConfigurationCallback();
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to