Bug 116359 - Disable SharedWorker when in multiple web process model
Summary: Disable SharedWorker when in multiple web process model
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-05-17 15:33 PDT by Alexey Proskuryakov
Modified: 2017-07-26 09:04 PDT (History)
2 users (show)

See Also:


Attachments
proposed patch (6.70 KB, patch)
2013-05-17 15:45 PDT, Alexey Proskuryakov
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2013-05-17 15:33:38 PDT
Shared workers can not communicate across processes currently, so they should better be disabled.

<rdar://problem/13819878>
Comment 1 Alexey Proskuryakov 2013-05-17 15:45:55 PDT
Created attachment 202167 [details]
proposed patch
Comment 2 Alexey Proskuryakov 2013-05-17 17:04:44 PDT
Committed <http://trac.webkit.org/r150310>.
Comment 3 Ryosuke Niwa 2013-05-17 19:15:39 PDT
This patch caused a whole bunch of tests to fail on WK2 bots:
http://build.webkit.org/results/Apple%20MountainLion%20Release%20WK2%20(Tests)/r150313%20(8978)/results.html
Comment 4 Alexey Proskuryakov 2013-05-17 21:23:46 PDT
Fixed in <http://trac.webkit.org/changeset/150322>.
Comment 5 Takahiro Ichihashi 2017-07-26 03:37:34 PDT
Hello, could you consider/discuss reenabling this feature? 

"The implementation of Shared Web Workers was imposing undesirable constraints on the engine. The feature never gained any adoption and was eventually removed from the engine."
https://webkit.org/status/#feature-shared-web-workers

I understand this, but API itself looks very simple, and easier(-to-use) than service worker.
Comment 6 Ryosuke Niwa 2017-07-26 04:32:53 PDT
(In reply to Takahiro Ichihashi from comment #5)
> Hello, could you consider/discuss reenabling this feature? 
> 
> "The implementation of Shared Web Workers was imposing undesirable
> constraints on the engine. The feature never gained any adoption and was
> eventually removed from the engine."
> https://webkit.org/status/#feature-shared-web-workers
> 
> I understand this, but API itself looks very simple, and easier(-to-use)
> than service worker.

What we need is a compelling evidence that Web developers will use shared workers. Given that people don't even use shared workers in the browsers that support it (Chrome & Firefox), the argument for supporting this feature is rather weak. Also understand that the engineering resources spent to make shared worker work is the engineering resource that can't be spent elsewhere like implementing service workers so there is a huge opportunity cost associated with making this feature work across web content processes.
Comment 7 Takahiro Ichihashi 2017-07-26 09:04:52 PDT
Thanks for your reply.

The reason behind the low adoption rate of the API is probably the immaturity of the developer communities - meaning, it sometimes takes time for new APIs to become mainstream (XHR, formally a vendor-specific Microsoft.XMLHTTP or dynamic <script tag generation technique took 7~8 years to become a core part of web). 

Difficultly I found is that, currently it is a bit tricky to make a script that is shared across windows/tabs; in my case there are persistent connections via websocket / webrtc that provides some information periodically, which I want to make it more efficient by just having a one thread/tab that handles such connection even when there're multiple tabs opening, but at this time a polyfill should be made probably by utilizing localStorage events. 

Service workers will solve this problem (I'm fine with this API given a lower development priority compared to service worker anyway) but personally I feel that service workers have got so many features, and I believe there's a possibility that shared worker would be loved by many developers with specific needs like the above one. But thanks for your quick reply anyway, pls let me know if anything that I can help.