Bug 183913

Summary: Include security origin in the service worker process name
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Service WorkersAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, bfulgham, commit-queue, joepeck, mitz, rniwa, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Chris Dumez 2018-03-22 13:04:21 PDT
Include security origin in the service worker process name to facilitate debugging. This way, we can differentiate which service worker process is used for which origin in activity monitor.
Comment 1 Chris Dumez 2018-03-22 13:06:25 PDT
Created attachment 336298 [details]
Patch
Comment 2 youenn fablet 2018-03-22 13:36:10 PDT
Comment on attachment 336298 [details]
Patch

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

> Source/WebKit/ChangeLog:9
> +        can differentiate which service worker process is used for which origin in activity monitor.

Is there a privacy concern here, like some application running in the device that could easily detect at any time whether the user is browsing to a given origin or not?

> Source/WebCore/English.lproj/Localizable.strings:-120
> -

Do we need all these changes?
Comment 3 Chris Dumez 2018-03-22 13:47:57 PDT
Comment on attachment 336298 [details]
Patch

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

>> Source/WebKit/ChangeLog:9
>> +        can differentiate which service worker process is used for which origin in activity monitor.
> 
> Is there a privacy concern here, like some application running in the device that could easily detect at any time whether the user is browsing to a given origin or not?

We already display the origin for WebProcess so I do not think service workers are any different. That said, I haven't found the code that shows the WebProcess url in activity monitor yet.

>> Source/WebCore/English.lproj/Localizable.strings:-120
>> -
> 
> Do we need all these changes?

I merely ran:
Tools/Scripts/update-webkit-localizable-strings

The file happened to be quite out of date.
Comment 4 Chris Dumez 2018-03-22 13:51:53 PDT
Comment on attachment 336298 [details]
Patch

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

>>> Source/WebKit/ChangeLog:9
>>> +        can differentiate which service worker process is used for which origin in activity monitor.
>> 
>> Is there a privacy concern here, like some application running in the device that could easily detect at any time whether the user is browsing to a given origin or not?
> 
> We already display the origin for WebProcess so I do not think service workers are any different. That said, I haven't found the code that shows the WebProcess url in activity monitor yet.

Looks like it is done slightly differently for WebProcesses via WebProcess::updateActivePages(). I'll see if I can do the same.
Comment 5 Chris Dumez 2018-03-22 14:05:12 PDT
Comment on attachment 336298 [details]
Patch

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

>>>> Source/WebKit/ChangeLog:9
>>>> +        can differentiate which service worker process is used for which origin in activity monitor.
>>> 
>>> Is there a privacy concern here, like some application running in the device that could easily detect at any time whether the user is browsing to a given origin or not?
>> 
>> We already display the origin for WebProcess so I do not think service workers are any different. That said, I haven't found the code that shows the WebProcess url in activity monitor yet.
> 
> Looks like it is done slightly differently for WebProcesses via WebProcess::updateActivePages(). I'll see if I can do the same.

Actually, both seem to call _LSSetApplicationInformationItem(). In the service worker process case, the origin does not change so we can set it right away in initializeProcessName().
Comment 6 WebKit Commit Bot 2018-03-22 18:37:20 PDT
Comment on attachment 336298 [details]
Patch

Clearing flags on attachment: 336298

Committed r229878: <https://trac.webkit.org/changeset/229878>
Comment 7 WebKit Commit Bot 2018-03-22 18:37:21 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2018-03-22 18:38:21 PDT
<rdar://problem/38776833>