Bug 143456 - Create the web inspector process pool lazily
Summary: Create the web inspector process pool lazily
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-06 15:15 PDT by Anders Carlsson
Modified: 2015-04-06 18:18 PDT (History)
0 users

See Also:


Attachments
Patch (4.17 KB, patch)
2015-04-06 15:16 PDT, Anders Carlsson
mark.lam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.