Open Bug 1415230 Opened 2 years ago Updated Last month

Add MOZ_CAN_RUN_SCRIPT annotations to things that can

Categories

(Core :: DOM: Core & HTML, enhancement, P2)

53 Branch
enhancement

Tracking

()

People

(Reporter: bzbarsky, Unassigned)

References

(Depends on 16 open bugs)

Details

Attachments

(1 obsolete file)

The idea is that things annotated MOZ_CAN_RUN_SCRIPT must have the caller holding on-stack strong refs to all refcounted arguments, including "this".  We added a static analysis for this in bug 1380423, but now we should actually use this annotation.

This is a tracking bug for this work.  I'll file some dependencies in a few minutes.
Depends on: 1415234
bz asked for something like this for testing on IRC, so I threw together a patch.

MozReview-Commit-ID: 2YKncUdrT5p
I've looked into something like this, based on adapting the GC rooting static analysis, but the way the GC rooting analysis is set up, you'd have to change the types of all of the raw pointer arguments to a type that explicitly roots, which seemed impractical.
Priority: -- → P2
Nika, do you mind landing that opt-out in a separate bug?  I think it will make it a _lot_ simpler to incrementally annotate things with MOZ_CAN_RUN_SCRIPT...
Flags: needinfo?(nika)
Flags: needinfo?(nika)
Attachment #8926010 - Attachment is obsolete: true
Depends on: 1418558
Depends on: 1429531
Depends on: 1471344
Depends on: 1534292
Depends on: 1534318
Depends on: 1534363
Depends on: 1534369
Depends on: 1534370
Depends on: 1534383
Depends on: 1534608
Component: DOM → DOM: Core & HTML
See Also: → 1249686
Depends on: 1535124
Depends on: 1535135
Depends on: 1535398
Depends on: 1535523
Depends on: 1535530
Depends on: 1537656
Depends on: 1539204
Depends on: 1539808
Depends on: 1539845
Depends on: 1539864
Depends on: 1539869
Depends on: 1539873
Depends on: 1539884
Depends on: 1539906
Depends on: 1541094
You need to log in before you can comment on or make changes to this bug.