Changeset 196142 in webkit


Ignore:
Timestamp:
Feb 4, 2016 1:02:26 PM (8 years ago)
Author:
commit-queue@webkit.org
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 <Joseph Pecoraro> 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.

Location:
trunk/Source/WebKit2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r196138 r196142  
     12016-02-04  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Give nested inspectors their own process pool
     4        https://bugs.webkit.org/show_bug.cgi?id=153880
     5        <rdar://problem/24508310>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        When inspecting the inspector both inspectors were using the same
     10        Inspector process and sharing the same VM. This meant that profiling
     11        information was confusing (memory and JavaScript sampling) because
     12        it was showing data about both inspectors sharing the same process.
     13
     14        * UIProcess/WebInspectorProxy.cpp:
     15        (WebKit::WebInspectorProxy::inspectorProcessPool):
     16        (WebKit::WebInspectorProxy::isInspectorProcessPool):
     17        Have two process pools. The main inspector process pool (1st level inspectors)
     18        and a nested inspector process pool (inspecting the inspector, only expected
     19        by WebKit developers).
     20
     21        * UIProcess/WebInspectorProxy.h:
     22        * UIProcess/efl/WebInspectorProxyEfl.cpp:
     23        (WebKit::WebInspectorProxy::platformCreateInspectorPage):
     24        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
     25        (WebKit::WebInspectorProxy::platformCreateInspectorPage):
     26        * UIProcess/mac/WebInspectorProxyMac.mm:
     27        (WebKit::WebInspectorProxy::platformCreateInspectorPage):
     28        Pass the inspectionLevel to determine the appropriate pool to use.
     29
    1302016-02-04  Csaba Osztrogonác  <ossy@webkit.org>
    231
  • trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp

    r194552 r196142  
    305305}
    306306
    307 static WebProcessPool* s_processPool;
    308 
    309 WebProcessPool& WebInspectorProxy::inspectorProcessPool()
     307static WebProcessPool* s_mainInspectorProcessPool;
     308static WebProcessPool* s_nestedInspectorProcessPool;
     309
     310WebProcessPool& WebInspectorProxy::inspectorProcessPool(unsigned inspectionLevel)
    310311{
    311312    // Having our own process pool removes us from the main process pool and
    312313    // guarantees no process sharing for our user interface.
    313     if (!s_processPool) {
     314    WebProcessPool*& pool = inspectionLevel == 1 ? s_mainInspectorProcessPool : s_nestedInspectorProcessPool;
     315    if (!pool) {
    314316        auto configuration = API::ProcessPoolConfiguration::createWithLegacyOptions();
    315         s_processPool = &WebProcessPool::create(configuration.get()).leakRef();
    316     };
    317 
    318     return *s_processPool;
     317        pool = &WebProcessPool::create(configuration.get()).leakRef();
     318    }
     319    return *pool;
    319320}
    320321
    321322bool WebInspectorProxy::isInspectorProcessPool(WebProcessPool& processPool)
    322323{
    323     if (!s_processPool)
    324         return false;
    325 
    326     return s_processPool == &processPool;
     324    return (s_mainInspectorProcessPool && s_mainInspectorProcessPool == &processPool)
     325        || (s_nestedInspectorProcessPool && s_nestedInspectorProcessPool == &processPool);
    327326}
    328327
  • trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h

    r194322 r196142  
    154154    explicit WebInspectorProxy(WebPageProxy*);
    155155
    156     static WebProcessPool& inspectorProcessPool();
     156    static WebProcessPool& inspectorProcessPool(unsigned inspectionLevel);
    157157
    158158    void eagerlyCreateInspectorPage();
  • trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp

    r194322 r196142  
    107107        return 0;
    108108
    109     WKContextRef wkContext = toAPI(&inspectorProcessPool());
     109    WKContextRef wkContext = toAPI(&inspectorProcessPool(inspectionLevel()));
    110110    WKRetainPtr<WKStringRef> wkGroupIdentifier = adoptWK(WKStringCreateWithUTF8CString(inspectorPageGroupIdentifier().utf8().data()));
    111111    WKPageGroupRef wkPageGroup = WKPageGroupCreateWithIdentifier(wkGroupIdentifier.get());
  • trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp

    r194322 r196142  
    8181
    8282    auto pageConfiguration = API::PageConfiguration::create();
    83     pageConfiguration->setProcessPool(&inspectorProcessPool());
     83    pageConfiguration->setProcessPool(&inspectorProcessPool(inspectionLevel()));
    8484    pageConfiguration->setPreferences(preferences.get());
    8585    pageConfiguration->setPageGroup(pageGroup.get());
  • trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm

    r195694 r196142  
    376376    }
    377377
    378     [configuration setProcessPool: ::WebKit::wrapper(inspectorProcessPool())];
     378    [configuration setProcessPool: ::WebKit::wrapper(inspectorProcessPool(inspectionLevel()))];
    379379    [configuration _setGroupIdentifier:inspectorPageGroupIdentifier()];
    380380
Note: See TracChangeset for help on using the changeset viewer.