mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Various borrow hazard fixes (#33133)
* Reduce the scope of the document tag map borrow. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Reduce scope of borrow when finishing a Response. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Avoid creating a File object while borrowing FormData's data. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Prevent the GC from seeing an uninitialized window proxy slot. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
c00cd1326a
commit
bc5235827f
4 changed files with 16 additions and 12 deletions
|
@ -175,6 +175,8 @@ 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 mut data = self.data.borrow_mut();
|
||||
let local_name = LocalName::from(name.0.clone());
|
||||
|
||||
|
@ -185,9 +187,7 @@ impl FormDataMethods for FormData {
|
|||
FormDatum {
|
||||
ty: DOMString::from("file"),
|
||||
name: DOMString::from(name.0),
|
||||
value: FormDatumValue::File(DomRoot::from_ref(
|
||||
&*self.create_an_entry(blob, filename),
|
||||
)),
|
||||
value: FormDatumValue::File(file),
|
||||
},
|
||||
));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue