Closed Bug 1646556 Opened 4 years ago Closed 4 years ago

Fix GetInProcessTop/GetInProcessParentDocument usage in PaymentRequest code

Categories

(Core :: DOM: Web Payments, defect, P3)

defect

Tracking

()

RESOLVED FIXED
89 Branch
Fission Milestone Future
Tracking Status
firefox89 --- fixed

People

(Reporter: kmag, Assigned: edenchuang)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

These methods are not Fission-compatible, and will do the wrong thing for windows with OOP ancestors.

Should this inherit Fission M6a from bug 1642433 ?

Flags: needinfo?(kmaglione+bmo)

(In reply to Jens Stutte [:jstutte] from comment #1)

Should this inherit Fission M6a from bug 1642433 ?

No, we'll assign a priority during this week's triage.

Flags: needinfo?(kmaglione+bmo)
Severity: -- → S4
Priority: -- → P3

This code path should be possible to implement by walking the BrowsingContext tree, and checking if each WindowContext is currently active within it's BrowsingContext. https://searchfox.org/mozilla-central/rev/c6676771df58c6e0098574bc6b11517acbf264cf/dom/payments/PaymentRequest.cpp#1169-1177

This call-site would probably be improved by using the top browsing context ID rather than outer window ID: https://searchfox.org/mozilla-central/rev/c6676771df58c6e0098574bc6b11517acbf264cf/dom/payments/PaymentRequestManager.cpp#502-508. That being said, the top outer window ID is also avaliable with BrowsingContext::GetTopWindowContext() and WindowContext::GetOuterWindowId(). (though the only call site looks like it'd work with BrowsingContext ID just fine: https://searchfox.org/mozilla-central/rev/c6676771df58c6e0098574bc6b11517acbf264cf/browser/components/payments/PaymentUIService.jsm#61-63)

(didn't look super hard, so there may be other callers)

Eden, can you fix this for Fission please?

Fission Milestone: --- → M6c
Flags: needinfo?(echuang)
Assignee: nobody → echuang
Flags: needinfo?(echuang)

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:edenchuang, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(echuang)

We now have nsPIDOMWindowInner::IsFullyActive(), which adds required IsDiscarded() tests on the BrowsingContext. It also has IsDiscarded() tests on the WindowContext, but I suspect that may not be necessary, right now at least.

However, simply using that is not sufficient in PaymentRequest::NotifyOwnerDocumentActivityChanged(), as is detected by test_closePayment.html.
Analysis of testCloseByRemovingIframe() identifies that the last NotifyOwnerDocumentActivityChanged() call is triggered from nsDocShell::Destroy() before mScriptGlobal->DetachFromDocShell().
Essentially the document is becoming not fully active, but is not there yet.
The current doc tests happen to catch that case, but I suspect they may not still do so with activity changes in frames across process boundaries.

There's no plan to enable PaymentRequest in the near future, so this is not a priority.

(In reply to Karl Tomlinson (back Oct 5 :karlt) from comment #7)

There's no plan to enable PaymentRequest in the near future, so this is not a priority.

In that case, this bug should continue to block PaymentRequest (meta bug 1318984) but doesn't need to block shipping Fission MVP.

Fission Milestone: M6c → Future
Attachment #9166554 - Attachment description: Bug 1646556 - Make PaymentRequest APIs be fission compatible → Bug 1646556 - Make PaymentRequest APIs be fission compatible.
Pushed by echuang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3237b019d8c4 Make PaymentRequest APIs be fission compatible. r=nika
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
Flags: needinfo?(echuang)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: