Closed Bug 1482279 Opened 7 years ago Closed 5 years ago

Stop using forcePermissiveCOWs

Categories

(Testing :: Mochitest, enhancement)

Version 3
enhancement
Not set
normal

Tracking

(firefox78 fixed)

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: kmag, Assigned: kmag)

References

Details

Attachments

(3 files)

We'd like to remove platform support for permissive COWs, which means SpecialPowers needs to stop using them. This should be relatively simple. It just requires that we wrapper proxies in the content compartment rather than in the SpecialPowers global, and then call SpecialPowers.wrap on the SpecialPowers object before we expose it. In all likelihood, this will actually simplify a lot of code, since we won't have to manually wrap anything we return from SpecialPowers APIs. The proxy will handle it all transparently.
Attachment #9147237 - Attachment description: Bug 1482279 - Stop using Cu.forcePermissiveCOWs(). r?bholley → Bug 1482279 - Stop using Cu.forcePermissiveCOWs() in SpecialPowers. r?kmag
Summary: Stop using forcePermissiveCOWs in SpecialPowers → Stop using forcePermissiveCOWs
Pushed by VYV03354@nifty.ne.jp: https://hg.mozilla.org/integration/autoland/rev/9bd1d9cca860 Stop using Cu.forcePermissiveCOWs() in test_resize_move_windows.xhtml. r=kmag
Pushed by VYV03354@nifty.ne.jp: https://hg.mozilla.org/integration/autoland/rev/a845717e4d10 Stop using Cu.forcePermissiveCOWs() in SpecialPowers. r=kmag
Backout by malexandru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d5c77659d412 Backed out changeset a845717e4d10 for causing multiple failures.
Keywords: leave-open
Depends on: 1531851
Flags: needinfo?(VYV03354)
Keywords: leave-open
  • Some mochitest failed only when snapshotWindowWithOptions returned a promise because it was unwrapped.
  • getGroupTopLevelWindows would wrap return values. It caused Android test failures. Since it is difficult to unwrap iterated values from Generator functions and NavigationUtils.js is the only caller of getGroupTopLevelWindows, I'll manually unwrap the value to fix the problem.
  • attachToWindow would always wrap the SpecialPowers object itself even if the page does not actually use SpecialPowers at all. It had some bad effects to browser-chrome tests. I'll lazify the SpecialPowers object to fix the problem.
  • WeakMap (or at least our implementation thereof) does not work well with cross-global WeakMap keys. I'll reduce and tweak WeakMap usages to mitigate problems.
Pushed by VYV03354@nifty.ne.jp: https://hg.mozilla.org/integration/autoland/rev/f9cdd88decde Stop using Cu.forcePermissiveCOWs() in SpecialPowers. r=kmag
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78

Can you please update the comment at [1] to reflect the wrapping/unwrapping behavior after changes made in this bug ?
Especially the second paragraph.
Thanks.

[1] https://searchfox.org/mozilla-central/rev/fac90408bcf52ca88a3dcd2ef30a379b68ab24e2/dom/quota/test/common/content.js#19

Since content has no access to chrome-privileged objects without permissive
COWs, we can no longer unwrap the methods anymore. On the other hand,
SpecialPowers wrapper improved so that we don't have to unwrap the return
value from getAsArrayBuffer() manually.

Attachment #9155674 - Attachment description: Bug 1482279 - Update the comment in dom/quota/test/common/content.js. r?janv → Bug 1482279 - Update the comment in dom/quota/test/common/content.js. r=asuth
Pushed by VYV03354@nifty.ne.jp: https://hg.mozilla.org/integration/autoland/rev/4d54e6681654 Update the comment in dom/quota/test/common/content.js. r=asuth
Regressions: 1651436
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: