Changeset 182447 in webkit


Ignore:
Timestamp:
Apr 6, 2015 5:05:28 PM (9 years ago)
Author:
andersca@apple.com
Message:

Create the web inspector process pool lazily
https://bugs.webkit.org/show_bug.cgi?id=143456
rdar://problem/20146520

Reviewed by Mark Lam.

Add and implement WebInspectorProxy::isInspectorProcessPool instead of always creating the inspector process pool
when trying to determine if a given process pool is the inspector process pool.

This should speed up initialization somewhat and avoid creating a storage manager for example.

  • UIProcess/WebInspectorProxy.cpp:

(WebKit::WebInspectorProxy::inspectorProcessPool):
(WebKit::WebInspectorProxy::isInspectorProcessPool):

  • UIProcess/WebInspectorProxy.h:
  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::getLaunchOptions):

Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r182442 r182447  
     12015-04-06  Anders Carlsson  <andersca@apple.com>
     2
     3        Create the web inspector process pool lazily
     4        https://bugs.webkit.org/show_bug.cgi?id=143456
     5        rdar://problem/20146520
     6
     7        Reviewed by Mark Lam.
     8
     9        Add and implement WebInspectorProxy::isInspectorProcessPool instead of always creating the inspector process pool
     10        when trying to determine if a given process pool is the inspector process pool.
     11
     12        This should speed up initialization somewhat and avoid creating a storage manager for example.
     13
     14        * UIProcess/WebInspectorProxy.cpp:
     15        (WebKit::WebInspectorProxy::inspectorProcessPool):
     16        (WebKit::WebInspectorProxy::isInspectorProcessPool):
     17        * UIProcess/WebInspectorProxy.h:
     18        * UIProcess/WebProcessProxy.cpp:
     19        (WebKit::WebProcessProxy::getLaunchOptions):
     20
    1212015-04-06  Brady Eidson  <beidson@apple.com>
    222
  • trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp

    r181881 r182447  
    298298}
    299299
     300static WebProcessPool* s_processPool;
     301
    300302WebProcessPool& WebInspectorProxy::inspectorProcessPool()
    301303{
    302304    // Having our own process pool removes us from the main process pool and
    303305    // guarantees no process sharing for our user interface.
    304     static WebProcessPool* processPool = []{
     306    if (!s_processPool) {
    305307        auto configuration = API::ProcessPoolConfiguration::createWithLegacyOptions();
    306308        configuration->setProcessModel(ProcessModelMultipleSecondaryProcesses);
    307         return &WebProcessPool::create(configuration.get()).leakRef();
    308     }();
    309 
    310     return *processPool;
     309        s_processPool = &WebProcessPool::create(configuration.get()).leakRef();
     310    };
     311
     312    return *s_processPool;
     313}
     314
     315bool WebInspectorProxy::isInspectorProcessPool(WebProcessPool& processPool)
     316{
     317    if (!s_processPool)
     318        return false;
     319
     320    return s_processPool == &processPool;
    311321}
    312322
  • trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h

    r181885 r182447  
    135135    void togglePageProfiling();
    136136
    137     static WebProcessPool& inspectorProcessPool();
     137    static bool isInspectorProcessPool(WebProcessPool&);
    138138    static bool isInspectorPage(WebPageProxy&);
    139139
     
    153153private:
    154154    explicit WebInspectorProxy(WebPageProxy*);
     155
     156    static WebProcessPool& inspectorProcessPool();
    155157
    156158    void eagerlyCreateInspectorPage();
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp

    r182285 r182447  
    129129{
    130130    launchOptions.processType = ProcessLauncher::WebProcess;
    131     if (&m_processPool.get() == &WebInspectorProxy::inspectorProcessPool())
     131    if (WebInspectorProxy::isInspectorProcessPool(m_processPool))
    132132        launchOptions.extraInitializationData.add(ASCIILiteral("inspector-process"), ASCIILiteral("1"));
    133133    platformGetLaunchOptions(launchOptions);
Note: See TracChangeset for help on using the changeset viewer.