Bug 178527

Summary: Service Worker process should not be selected to open WebView on it
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebCore Misc.Assignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, cdumez, commit-queue, dbates, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 178475    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description youenn fablet 2017-10-19 11:55:09 PDT
Currently service worker process is a web process.
In the future, we might want it to have a dedicated type.
In the meantime, it should not be selected to open WebView on it
Comment 1 youenn fablet 2017-10-19 11:57:49 PDT
Created attachment 324256 [details]
Patch
Comment 2 Chris Dumez 2017-10-19 12:21:52 PDT
Comment on attachment 324256 [details]
Patch

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

r=me with comments.

> Source/WebKit/UIProcess/WebProcessPool.cpp:940
> +    Vector<std::reference_wrapper<WebProcessProxy>> processes;

I think processes is too generic, how about reusableProcesses ?

> Source/WebKit/UIProcess/WebProcessPool.cpp:944
> +        if (isMatchingStore && (process.get() != m_workerContextProcess))

You're going to need to protect the second check behind a #if ENABLE(SERVICE_WORKER)
Comment 3 youenn fablet 2017-10-19 13:22:35 PDT
Created attachment 324271 [details]
Patch
Comment 4 Chris Dumez 2017-10-19 13:28:19 PDT
Comment on attachment 324271 [details]
Patch

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

> Source/WebKit/UIProcess/WebProcessPool.cpp:940
> +    WebProcessProxy* reusableProcess = nullptr;

I would call this processToReuse. LGTM otherwise.
Comment 5 youenn fablet 2017-10-19 13:31:17 PDT
Created attachment 324274 [details]
Patch
Comment 6 WebKit Commit Bot 2017-10-19 14:28:50 PDT
The commit-queue encountered the following flaky tests while processing attachment 324274 [details]:

The commit-queue is continuing to process your patch.
Comment 7 WebKit Commit Bot 2017-10-19 14:29:17 PDT
The commit-queue encountered the following flaky tests while processing attachment 324274 [details]:

http/tests/security/cross-origin-xsl-BLOCKED.html bug 51054 (authors: abarth@webkit.org, jochen@chromium.org, and rniwa@webkit.org)
The commit-queue is continuing to process your patch.
Comment 8 Chris Dumez 2017-10-19 14:31:21 PDT
Comment on attachment 324274 [details]
Patch

Clearing flags on attachment: 324274

Committed r223713: <https://trac.webkit.org/changeset/223713>
Comment 9 Chris Dumez 2017-10-19 14:31:23 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Daniel Bates 2017-10-19 14:36:46 PDT
Comment on attachment 324274 [details]
Patch

Is it possible to write a test for this change?
Comment 11 Chris Dumez 2017-10-19 14:40:07 PDT
(In reply to Daniel Bates from comment #10)
> Comment on attachment 324274 [details]
> Patch
> 
> Is it possible to write a test for this change?

This is a crash fix which was split out of Bug 178475. When Bug 178475 lands, if API tests and layout tests do not crash, then this patch works as intended.
Comment 12 Radar WebKit Bug Importer 2017-11-15 13:02:40 PST
<rdar://problem/35568673>