servo: Drop impls for DOM types should be forbidden
@pcwalton @Manishearth @asajeffrey I recall discussing this topic in Berlin, but I can’t find the notes I thought I took. Attempting to reconstruct from memory:
- there exist DOM objects that have Drop impls for various reasons
- there was agreement that it should be possible to run some code in response to a GC finalizer (eg. webgl objects need to be able to unreference their graphics resources)
- the easiest way to ban Drop impls is to make the
#[dom_struct]macro also add an empty Drop impl, which will conflict with any manual implementation - for any code which does require a valid Drop, we can create inner structs that only hold the data required for that implementation and nothing more
Does this make sense? My memory is haziest when it comes to the last point.
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 33 (24 by maintainers)
Commits related to this issue
- Auto merge of #29354 - ben-freist:dom-drop-impl-worklet, r=delan #26488 Move worklet drop implementation into single droppable member Signed-off-by: Benjamin Freist <bfreist@soundhound.com> <!-- Pl... — committed to servo/servo by bors-servo 4 years ago
- [#26488] Moved Droppable code into a separate struct for CanvasRenderingContext2D (#37136) This is part of incremental implementation of #26488 . The interface involved in this PR is CanvasRenderingC... — committed to servo/servo by willypuzzle a year ago
- [#26488] Moved Droppable code into a separate struct for CanvasRenderingContext2D (#37136) This is part of incremental implementation of #26488 . The interface involved in this PR is CanvasRenderingC... — committed to PotatoCP/servo by willypuzzle a year ago
- [#26488] Moves the FetchCanceller to a separate droppable struct, in Event Source (#37261) Testing: No tests added. Fixes: partially fixes #26488 Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.... — committed to servo/servo by willypuzzle a year ago
- [#26499] Refactors HTMLMediaElement drop logic (#37310) Testing: No tests added Fixes: Partially #26488 Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> — committed to servo/servo by willypuzzle a year ago
- [#26488] Refactored RTCDataChannel for safer dropping and added Promise comment (#37332) Fixes (partially) #26488 and apply the https://github.com/servo/servo/pull/37324#discussion_r2133989190 commen... — committed to servo/servo by willypuzzle a year ago
- [#26488] Makes RTCPeerConnection weak referenceable thorugh Binding.conf (#37518) This PR fixes some mistakes introduced in https://github.com/servo/servo/pull/37332. Where Binding.conf and WeakRefer... — committed to servo/servo by willypuzzle a year ago
- [#26488] Refactored RTCDataChannel for safer dropping and added Promise comment (#37332) Fixes (partially) #26488 and apply the https://github.com/servo/servo/pull/37324#discussion_r2133989190 commen... — committed to PotatoCP/servo by willypuzzle a year ago
- [#26488] Improves WebGLBuffer drop impl (#37512) Testing: No tests added Fixes: Partially #26488 --------- Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> — committed to servo/servo by willypuzzle a year ago
- [#26488] Refactors WebGLFramebuffer deletion (#37589) Testing: No tests added Fixes: Partially #26488 Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> — committed to servo/servo by willypuzzle a year ago
@willypuzzle https://github.com/servo/servo/issues/26488#issuecomment-640237906 describes the work that needs to happen right now. One PR per interface where the existing Drop implementation is refined and minimized would be best to work on his incrementally.
Done.
In that time we moved from compiler plugins to crown so yeah, it does make sense to start on more fresh base, but use PR as reference.
@jdm May I try this issue? This is the first time to contribute to Servo for me.