WorkerAgent.enable should return error for the backends that don't support workers. There should be no Preference.exposeWorkersInspection since inspection only depends on the backend capabilities.
I think this bug mixes two problems that should be addressed separately: 1) WorkerAgent.setWorkerInspectionEnabled should be split into WorkerAgent.enable/disable to be aligned with the naming scheme used in other domains. 2) Preference.exposeWorkersInspection is used to check if the front-end on the given platform supports worker inspection. At the moment we cannot create worker inspector front-end window on Mac e.g. Which mechanism should be used to handle this?
(In reply to comment #1) > I think this bug mixes two problems that should be addressed separately: > 1) WorkerAgent.setWorkerInspectionEnabled should be split into WorkerAgent.enable/disable to be aligned with the naming scheme used in other domains. > 2) Preference.exposeWorkersInspection is used to check if the front-end on the given platform supports worker inspection. At the moment we cannot create worker inspector front-end window on Mac e.g. Which mechanism should be used to handle this? It should then be a part of the InspectorFrontendHost. I.e. host tells front-end whether it is capable of opening new windows. I agree that these are two changes, but the first one looks minor.
Created attachment 156671 [details] Patch
Committed r124765: <http://trac.webkit.org/changeset/124765>
(In reply to comment #4) > Committed r124765: <http://trac.webkit.org/changeset/124765> It broke an inspector test: http/tests/inspector-enabled/dedicated-workers-list.html --- /Volumes/Data/slave/lion-release-tests-wk1/build/layout-test-results/http/tests/inspector-enabled/dedicated-workers-list-expected.txt +++ /Volumes/Data/slave/lion-release-tests-wk1/build/layout-test-results/http/tests/inspector-enabled/dedicated-workers-list-actual.txt @@ -2,8 +2,5 @@ CONSOLE MESSAGE: line 20: Received message from worker 2 Tests that dedicated workers created before worker inspection was enabled will be reported to the front-end. Bug 72020 -Worker inspection enabled -Added worker: 1 -Added worker: 2 -Done. +error: Exception during test execution: TypeError: 'undefined' is not a function (evaluating 'WorkerAgent.setWorkerInspectionEnabled(false, didDisableWorkerInspection)') ------ It seems it was a trivial bug, I landed the fix in https://trac.webkit.org/changeset/124781
(In reply to comment #5) > (In reply to comment #4) > > Committed r124765: <http://trac.webkit.org/changeset/124765> > ------ > > It seems it was a trivial bug, I landed the fix in https://trac.webkit.org/changeset/124781 Thanks for fixing that!