mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
CanGc fixes in several files (#33958)
* few cangc fixes Signed-off-by: L Ashwin B <lashwinib@gmail.com> * few cangc fixes Signed-off-by: L Ashwin B <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com>
This commit is contained in:
parent
1bf68567b8
commit
ebfea9b352
22 changed files with 170 additions and 129 deletions
|
@ -110,7 +110,11 @@ impl FormDataMethods for FormData {
|
|||
let datum = FormDatum {
|
||||
ty: DOMString::from("file"),
|
||||
name: DOMString::from(name.0.clone()),
|
||||
value: FormDatumValue::File(DomRoot::from_ref(&*self.create_an_entry(blob, filename))),
|
||||
value: FormDatumValue::File(DomRoot::from_ref(&*self.create_an_entry(
|
||||
blob,
|
||||
filename,
|
||||
CanGc::note(),
|
||||
))),
|
||||
};
|
||||
|
||||
self.data
|
||||
|
@ -187,7 +191,7 @@ impl FormDataMethods for FormData {
|
|||
#[allow(crown::unrooted_must_root)]
|
||||
// https://xhr.spec.whatwg.org/#dom-formdata-set
|
||||
fn Set_(&self, name: USVString, blob: &Blob, filename: Option<USVString>) {
|
||||
let file = self.create_an_entry(blob, filename);
|
||||
let file = self.create_an_entry(blob, filename, CanGc::note());
|
||||
|
||||
let mut data = self.data.borrow_mut();
|
||||
let local_name = LocalName::from(name.0.clone());
|
||||
|
@ -207,7 +211,12 @@ impl FormDataMethods for FormData {
|
|||
|
||||
impl FormData {
|
||||
// https://xhr.spec.whatwg.org/#create-an-entry
|
||||
fn create_an_entry(&self, blob: &Blob, opt_filename: Option<USVString>) -> DomRoot<File> {
|
||||
fn create_an_entry(
|
||||
&self,
|
||||
blob: &Blob,
|
||||
opt_filename: Option<USVString>,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<File> {
|
||||
// Steps 3-4
|
||||
let name = match opt_filename {
|
||||
Some(filename) => DOMString::from(filename.0),
|
||||
|
@ -229,6 +238,7 @@ impl FormData {
|
|||
BlobImpl::new_from_bytes(bytes, blob.type_string()),
|
||||
name,
|
||||
None,
|
||||
can_gc,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue