Replace CanGc::note() with arguments passed by callers (#33917)

Signed-off-by: Wulan Seruniati Salim <lauwwulan1806@gmail.com>

remove not necessary comment

Co-authored-by: Wulan Seruniati Salim <lauwwulan1806@gmail.com>
This commit is contained in:
Wulan Seruniati Salim 2024-10-20 15:24:36 +07:00 committed by GitHub
parent a57b6a3f79
commit a14b65f30b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 10 deletions

View file

@ -810,7 +810,7 @@ fn run_package_data_algorithm(
BodyType::Text => run_text_data_algorithm(bytes),
BodyType::Json => run_json_data_algorithm(cx, bytes),
BodyType::Blob => run_blob_data_algorithm(&global, bytes, mime, can_gc),
BodyType::FormData => run_form_data_algorithm(&global, bytes, mime),
BodyType::FormData => run_form_data_algorithm(&global, bytes, mime, can_gc),
BodyType::ArrayBuffer => run_array_buffer_data_algorithm(cx, bytes),
}
}
@ -868,6 +868,7 @@ fn run_form_data_algorithm(
root: &GlobalScope,
bytes: Vec<u8>,
mime: &[u8],
can_gc: CanGc,
) -> Fallible<FetchedData> {
let mime_str = if let Ok(s) = str::from_utf8(mime) {
s
@ -883,7 +884,7 @@ fn run_form_data_algorithm(
// ... is not fully determined yet.
if mime.type_() == mime::APPLICATION && mime.subtype() == mime::WWW_FORM_URLENCODED {
let entries = form_urlencoded::parse(&bytes);
let formdata = FormData::new(None, root, CanGc::note());
let formdata = FormData::new(None, root, can_gc);
for (k, e) in entries {
formdata.Append(USVString(k.into_owned()), USVString(e.into_owned()));
}