Closed Bug 1340671 Opened 7 years ago Closed 7 years ago

[webext] Fix race in getDevToolsTargetForContext utility method

Categories

(WebExtensions :: Developer Tools, defect, P1)

defect

Tracking

(firefox54 fixed)

RESOLVED FIXED
mozilla54
Iteration:
54.3 - Mar 6
Tracking Status
firefox54 --- fixed

People

(Reporter: rpl, Assigned: rpl)

References

Details

(Whiteboard: [devtools] triaged)

Attachments

(1 file)

`getDevToolsTargetForContext` returns a promise that is supposed to be resolved once the returned "cloned DevTools target" has been connected.

Currently, if a devtools API method that use `getDevToolsTargetForContext` utility method (e.g. `inspectedWindow.eval/reload` and `network.onNavigated`) is called while the cloned target (shared between the devtools API called from the same context) is still connecting, the second call can receive the clonedTarget before it is ready to be used (while it should wait for the `target.makeRemote()` promise to be resolved, http://searchfox.org/mozilla-central/rev/ea31c4b64f34a29415a69fb768f8051495547315/devtools/client/framework/target.js#381).

I'm going to attach to this issue a patch to fix the race.
Assignee: nobody → lgreco
Status: NEW → ASSIGNED
Iteration: --- → 54.3 - Mar 6
Priority: -- → P1
Whiteboard: [devtools] triaged
Blocks: 1211859
Comment on attachment 8838726 [details]
Bug 1340671 - [webext] Fix race in getDevToolsTargetForContext utility method.

https://reviewboard.mozilla.org/r/113534/#review118888
Attachment #8838726 - Flags: review?(kmaglione+bmo) → review+
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/be448fec2032
[webext] Fix race in getDevToolsTargetForContext utility method. r=kmag
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/be448fec2032
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: