Hello Tim,

The about:serviceworker <about:serviceworker> panel in Settings was conceived 
as a temporary workaround until we have a proper set of devtools for service 
workers (probably via WebIDE as Ben suggested). So I would not spend much time 
there.

Anyway, I guess you refer to this thread [1]. If you check the implementation 
of about:sw <about:sw> you'll see that most of the issues that you listed there 
do not apply well in this case. For example (quoting two of the issues you 
mentioned):

"3.1) mozChromeEvent poses a performance problem, since a lot of 
components in System app need to listen to it, we ended up having 30x 
event listeners installed and only one of these callbacks will 
actually act on it. "

We are not using "mozChromeEvent" but "mozAboutServiceWorkersChromeEvent" [2]. 
And there's a single event listener [3] that in fact is only set while we are 
waiting for a response from the chrome side.

"3.2) Spaghetti in shell.js is in no way testable other than Gaia 
integration tests, but in fact they are part of APIs that should have 
been testable in dom/*/mochitests/ "

The only addition done to shell.js was [4]. And we have some tests [5]. They 
can be improved significantly though. But now that we have chrome tests, that 
task is even easier.

Hope it helps. Cheers,

/ Fernando

[1] https://groups.google.com/d/msg/mozilla.dev.b2g/_43txDra_NY/BZ_wYoYAnE4J 
<https://groups.google.com/d/msg/mozilla.dev.b2g/_43txDra_NY/BZ_wYoYAnE4J>
[2] 
https://mxr.mozilla.org/mozilla-central/source/b2g/components/AboutServiceWorkers.jsm#68
 
<https://mxr.mozilla.org/mozilla-central/source/b2g/components/AboutServiceWorkers.jsm#68>
[3] 
https://mxr.mozilla.org/gaia/source/apps/system/js/about_service_workers_proxy.js#99
 
<https://mxr.mozilla.org/gaia/source/apps/system/js/about_service_workers_proxy.js#99>
[4] 
https://mxr.mozilla.org/mozilla-central/source/b2g/chrome/content/shell.js#37 
<https://mxr.mozilla.org/mozilla-central/source/b2g/chrome/content/shell.js#37>
[5] 
https://mxr.mozilla.org/mozilla-central/source/b2g/components/test/unit/test_aboutserviceworkers.js
 
<https://mxr.mozilla.org/mozilla-central/source/b2g/components/test/unit/test_aboutserviceworkers.js>

> On Nov 10, 2015, at 8:32 AM, Tim Guan-tin Chien <[email protected]> wrote:
> 
> Somehow it was decided about:serviceworker in Settings app should be 
> engineered with a chrome/content event to System app and an IAC channel to 
> Settings app:
> 
> https://github.com/mozilla-b2g/gaia/blob/3180bbe2f2e94809c1fcef0e92a01da99cdfb530/apps/system/js/about_service_workers_proxy.js#L21-L29
>  
> <https://github.com/mozilla-b2g/gaia/blob/3180bbe2f2e94809c1fcef0e92a01da99cdfb530/apps/system/js/about_service_workers_proxy.js#L21-L29>
> 
> When, per previous threads, we should just implement a ServiceWorkerManager 
> API accessible from Settings app.
> 
> Unless there are counter-arguments unknown to me, I would like to organize 
> work and do this conversion.
> 
> Thoughts? Thanks.
> 
> 
> Tim

_______________________________________________
dev-fxos mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-fxos

Reply via email to