Bug 92545 - Web Inspector: rename WorkerAgent.setWorkerInspectionEnabled to WorkerAgent.enable and make it return error
Summary: Web Inspector: rename WorkerAgent.setWorkerInspectionEnabled to WorkerAgent.e...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Yury Semikhatsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-27 13:54 PDT by Pavel Feldman
Modified: 2012-08-07 00:18 PDT (History)
14 users (show)

See Also:


Attachments
Patch (13.31 KB, patch)
2012-08-06 05:42 PDT, Yury Semikhatsky
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2012-07-27 13:54:37 PDT
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.
Comment 1 Yury Semikhatsky 2012-07-30 01:26:01 PDT
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?
Comment 2 Pavel Feldman 2012-07-30 06:44:02 PDT
(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.
Comment 3 Yury Semikhatsky 2012-08-06 05:42:33 PDT
Created attachment 156671 [details]
Patch
Comment 4 Yury Semikhatsky 2012-08-06 06:52:07 PDT
Committed r124765: <http://trac.webkit.org/changeset/124765>
Comment 5 Csaba Osztrogonác 2012-08-06 10:38:47 PDT
(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
Comment 6 Yury Semikhatsky 2012-08-07 00:18:10 PDT
(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!