[Presentation WebAPI] Fix timing issue in PresentationRequestUIGlue

RESOLVED FIXED in Firefox 43

Status

Firefox OS
General
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: seanlin, Assigned: seanlin)

Tracking

(Blocks: 1 bug)

unspecified
FxOS-S6 (04Sep)
ARM
Gonk (Firefox OS)

Firefox Tracking Flags

(firefox43 fixed)

Details

(Whiteboard: [ft:conndevices])

Attachments

(1 attachment, 1 obsolete attachment)

PresentationRequestUIGlue sends mozPresentationChromeEvents [1] and uses the session ID as a key to map the promise resolver [2]. Then it listens to mozPresentationContentEvent [3] and uses the session ID to resolve the correspondent promise [4]. However, the chrome event may get sent out earlier before the mapping between session ID and promise resolver is stored (i.e. a time gap between [1] and [2]). And if the corresponding content event happens right in this time gap, then the promise would keep pending since the correspondent resolver couldn't be found [4].

[1] https://dxr.mozilla.org/mozilla-central/source/b2g/components/PresentationRequestUIGlue.js#47
[2] https://dxr.mozilla.org/mozilla-central/source/b2g/components/PresentationRequestUIGlue.js#53
[3] https://dxr.mozilla.org/mozilla-central/source/b2g/components/PresentationRequestUIGlue.js#26
[4] https://dxr.mozilla.org/mozilla-central/source/b2g/components/PresentationRequestUIGlue.js#34-37
Assignee: nobody → selin
Blocks: 1184073
Whiteboard: [ft:conndevices]
Created attachment 8655859 [details] [diff] [review]
Patch, v1

Send the chrome event after the mapping of the resolver is stored.
Attachment #8655859 - Flags: review?(fabrice)
Attachment #8655859 - Flags: review?(fabrice) → review+
Created attachment 8656439 [details] [diff] [review]
Patch, v1
Attachment #8655859 - Attachment is obsolete: true
Attachment #8656439 - Flags: review+
The latest try run. FYI.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=314e51909b9d
Keywords: checkin-needed
Target Milestone: --- → FxOS-S6 (04Sep)

Comment 4

2 years ago
https://hg.mozilla.org/integration/b2g-inbound/rev/c2ea7d896aee
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/c2ea7d896aee
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox43: --- → fixed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.