Bug 178527 - Service Worker process should not be selected to open WebView on it
Summary: Service Worker process should not be selected to open WebView on it
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks: 178475
  Show dependency treegraph
 
Reported: 2017-10-19 11:55 PDT by youenn fablet
Modified: 2017-11-15 13:02 PST (History)
5 users (show)

See Also:


Attachments
Patch (2.87 KB, patch)
2017-10-19 11:57 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (2.81 KB, patch)
2017-10-19 13:22 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (2.84 KB, patch)
2017-10-19 13:31 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

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