Title: [196142] trunk/Source/WebKit2
Revision
196142
Author
[email protected]
Date
2016-02-04 13:02:26 -0800 (Thu, 04 Feb 2016)

Log Message

Web Inspector: Give nested inspectors their own process pool
https://bugs.webkit.org/show_bug.cgi?id=153880
<rdar://problem/24508310>

Patch by Joseph Pecoraro <[email protected]> on 2016-02-04
Reviewed by Timothy Hatcher.

When inspecting the inspector both inspectors were using the same
Inspector process and sharing the same VM. This meant that profiling
information was confusing (memory and _javascript_ sampling) because
it was showing data about both inspectors sharing the same process.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::inspectorProcessPool):
(WebKit::WebInspectorProxy::isInspectorProcessPool):
Have two process pools. The main inspector process pool (1st level inspectors)
and a nested inspector process pool (inspecting the inspector, only expected
by WebKit developers).

* UIProcess/WebInspectorProxy.h:
* UIProcess/efl/WebInspectorProxyEfl.cpp:
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
Pass the inspectionLevel to determine the appropriate pool to use.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (196141 => 196142)


--- trunk/Source/WebKit2/ChangeLog	2016-02-04 20:38:23 UTC (rev 196141)
+++ trunk/Source/WebKit2/ChangeLog	2016-02-04 21:02:26 UTC (rev 196142)
@@ -1,3 +1,32 @@
+2016-02-04  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Give nested inspectors their own process pool
+        https://bugs.webkit.org/show_bug.cgi?id=153880
+        <rdar://problem/24508310>
+
+        Reviewed by Timothy Hatcher.
+
+        When inspecting the inspector both inspectors were using the same
+        Inspector process and sharing the same VM. This meant that profiling
+        information was confusing (memory and _javascript_ sampling) because
+        it was showing data about both inspectors sharing the same process.
+
+        * UIProcess/WebInspectorProxy.cpp:
+        (WebKit::WebInspectorProxy::inspectorProcessPool):
+        (WebKit::WebInspectorProxy::isInspectorProcessPool):
+        Have two process pools. The main inspector process pool (1st level inspectors)
+        and a nested inspector process pool (inspecting the inspector, only expected
+        by WebKit developers).
+
+        * UIProcess/WebInspectorProxy.h:
+        * UIProcess/efl/WebInspectorProxyEfl.cpp:
+        (WebKit::WebInspectorProxy::platformCreateInspectorPage):
+        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
+        (WebKit::WebInspectorProxy::platformCreateInspectorPage):
+        * UIProcess/mac/WebInspectorProxyMac.mm:
+        (WebKit::WebInspectorProxy::platformCreateInspectorPage):
+        Pass the inspectionLevel to determine the appropriate pool to use.
+
 2016-02-04  Csaba Osztrogonác  <[email protected]>
 
         Fix the !ENABLE(NETSCAPE_PLUGIN_API) build after r196053

Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp (196141 => 196142)


--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2016-02-04 20:38:23 UTC (rev 196141)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2016-02-04 21:02:26 UTC (rev 196142)
@@ -304,26 +304,25 @@
     m_isProfilingPage = !m_isProfilingPage;
 }
 
-static WebProcessPool* s_processPool;
+static WebProcessPool* s_mainInspectorProcessPool;
+static WebProcessPool* s_nestedInspectorProcessPool;
 
-WebProcessPool& WebInspectorProxy::inspectorProcessPool()
+WebProcessPool& WebInspectorProxy::inspectorProcessPool(unsigned inspectionLevel)
 {
     // Having our own process pool removes us from the main process pool and
     // guarantees no process sharing for our user interface.
-    if (!s_processPool) {
+    WebProcessPool*& pool = inspectionLevel == 1 ? s_mainInspectorProcessPool : s_nestedInspectorProcessPool;
+    if (!pool) {
         auto configuration = API::ProcessPoolConfiguration::createWithLegacyOptions();
-        s_processPool = &WebProcessPool::create(configuration.get()).leakRef();
-    };
-
-    return *s_processPool;
+        pool = &WebProcessPool::create(configuration.get()).leakRef();
+    }
+    return *pool;
 }
 
 bool WebInspectorProxy::isInspectorProcessPool(WebProcessPool& processPool)
 {
-    if (!s_processPool)
-        return false;
-
-    return s_processPool == &processPool;
+    return (s_mainInspectorProcessPool && s_mainInspectorProcessPool == &processPool)
+        || (s_nestedInspectorProcessPool && s_nestedInspectorProcessPool == &processPool);
 }
 
 bool WebInspectorProxy::isInspectorPage(WebPageProxy& webPage)

Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h (196141 => 196142)


--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h	2016-02-04 20:38:23 UTC (rev 196141)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h	2016-02-04 21:02:26 UTC (rev 196142)
@@ -153,7 +153,7 @@
 private:
     explicit WebInspectorProxy(WebPageProxy*);
 
-    static WebProcessPool& inspectorProcessPool();
+    static WebProcessPool& inspectorProcessPool(unsigned inspectionLevel);
 
     void eagerlyCreateInspectorPage();
 

Modified: trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp (196141 => 196142)


--- trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp	2016-02-04 20:38:23 UTC (rev 196141)
+++ trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp	2016-02-04 21:02:26 UTC (rev 196142)
@@ -106,7 +106,7 @@
     if (!m_inspectorWindow)
         return 0;
 
-    WKContextRef wkContext = toAPI(&inspectorProcessPool());
+    WKContextRef wkContext = toAPI(&inspectorProcessPool(inspectionLevel()));
     WKRetainPtr<WKStringRef> wkGroupIdentifier = adoptWK(WKStringCreateWithUTF8CString(inspectorPageGroupIdentifier().utf8().data()));
     WKPageGroupRef wkPageGroup = WKPageGroupCreateWithIdentifier(wkGroupIdentifier.get());
 

Modified: trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp (196141 => 196142)


--- trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp	2016-02-04 20:38:23 UTC (rev 196141)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp	2016-02-04 21:02:26 UTC (rev 196142)
@@ -80,7 +80,7 @@
     RefPtr<WebPageGroup> pageGroup = WebPageGroup::create(inspectorPageGroupIdentifier(), false, false);
 
     auto pageConfiguration = API::PageConfiguration::create();
-    pageConfiguration->setProcessPool(&inspectorProcessPool());
+    pageConfiguration->setProcessPool(&inspectorProcessPool(inspectionLevel()));
     pageConfiguration->setPreferences(preferences.get());
     pageConfiguration->setPageGroup(pageGroup.get());
     m_inspectorView = GTK_WIDGET(webkitWebViewBaseCreate(*pageConfiguration.ptr()));

Modified: trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm (196141 => 196142)


--- trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2016-02-04 20:38:23 UTC (rev 196141)
+++ trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2016-02-04 21:02:26 UTC (rev 196142)
@@ -375,7 +375,7 @@
         preferences._pageVisibilityBasedProcessSuppressionEnabled = NO;
     }
 
-    [configuration setProcessPool: ::WebKit::wrapper(inspectorProcessPool())];
+    [configuration setProcessPool: ::WebKit::wrapper(inspectorProcessPool(inspectionLevel()))];
     [configuration _setGroupIdentifier:inspectorPageGroupIdentifier()];
 
     m_inspectorView = adoptNS([[WKWebInspectorWKWebView alloc] initWithFrame:initialRect configuration:configuration.get()]);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to