Bug 143456

Summary: Create the web inspector process pool lazily
Product: WebKit Reporter: Anders Carlsson <andersca>
Component: New BugsAssignee: Anders Carlsson <andersca>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch mark.lam: review+

Description Anders Carlsson 2015-04-06 15:15:40 PDT
Create the web inspector process pool lazily
Comment 1 Anders Carlsson 2015-04-06 15:16:58 PDT
Created attachment 250231 [details]
Patch
Comment 2 Mark Lam 2015-04-06 16:17:45 PDT
Comment on attachment 250231 [details]
Patch

r=me
Comment 3 Mark Lam 2015-04-06 16:29:56 PDT
Comment on attachment 250231 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=250231&action=review

> Source/WebKit2/UIProcess/WebInspectorProxy.cpp:310
> -    static WebProcessPool* processPool = []{
> +    if (!s_processPool) {
>          auto configuration = API::ProcessPoolConfiguration::createWithLegacyOptions();
>          configuration->setProcessModel(ProcessModelMultipleSecondaryProcesses);
> -        return &WebProcessPool::create(configuration.get()).leakRef();
> -    }();
> +        s_processPool = &WebProcessPool::create(configuration.get()).leakRef();
> +    };

One question: does this require initialize once semantics?
Comment 4 Anders Carlsson 2015-04-06 16:44:23 PDT
(In reply to comment #3)
> 
> One question: does this require initialize once semantics?

No, it doesn't require thread safe initialization.
Comment 5 Anders Carlsson 2015-04-06 17:06:21 PDT
Committed r182447: <http://trac.webkit.org/changeset/182447>
Comment 6 Darin Adler 2015-04-06 18:18:10 PDT
Comment on attachment 250231 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=250231&action=review

> Source/WebKit2/UIProcess/WebInspectorProxy.cpp:318
> +    if (!s_processPool)
> +        return false;

I don’t think this code is needed. A null pointer would never be equal to the address of a reference.