mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Various CanGc fixes in components/script/dom (#33706)
* Propagate 'can_gc' in IFrame DOM code Signed-off-by: webbeef <me@webbeef.org> * Propagate 'can_gc' in HTML video and image elements Signed-off-by: webbeef <me@webbeef.org> * Propagate 'can_gc' in Blob and dependencies Signed-off-by: webbeef <me@webbeef.org> * Leftover can_gc fixes for HTMLMediaElement Signed-off-by: webbeef <me@webbeef.org> * Address comment Signed-off-by: webbeef <me@webbeef.org> --------- Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
parent
7d931e673a
commit
d3c0785d64
14 changed files with 67 additions and 42 deletions
|
@ -34,6 +34,7 @@ use crate::dom::messageevent::MessageEvent;
|
|||
use crate::dom::rtcerror::RTCError;
|
||||
use crate::dom::rtcerrorevent::RTCErrorEvent;
|
||||
use crate::dom::rtcpeerconnection::RTCPeerConnection;
|
||||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct RTCDataChannel {
|
||||
|
@ -154,7 +155,7 @@ impl RTCDataChannel {
|
|||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
pub fn on_message(&self, channel_message: DataChannelMessage) {
|
||||
pub fn on_message(&self, channel_message: DataChannelMessage, can_gc: CanGc) {
|
||||
unsafe {
|
||||
let global = self.global();
|
||||
let cx = GlobalScope::get_cx();
|
||||
|
@ -167,8 +168,11 @@ impl RTCDataChannel {
|
|||
},
|
||||
DataChannelMessage::Binary(data) => match &**self.binary_type.borrow() {
|
||||
"blob" => {
|
||||
let blob =
|
||||
Blob::new(&global, BlobImpl::new_from_bytes(data, "".to_owned()));
|
||||
let blob = Blob::new(
|
||||
&global,
|
||||
BlobImpl::new_from_bytes(data, "".to_owned()),
|
||||
can_gc,
|
||||
);
|
||||
blob.to_jsval(*cx, message.handle_mut());
|
||||
},
|
||||
"arraybuffer" => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue