mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Introduce Reflectable::global_scope
This commit is contained in:
parent
27f100b1d4
commit
ae6af5172b
30 changed files with 116 additions and 120 deletions
|
@ -98,13 +98,14 @@ fn run_package_data_algorithm<T: BodyOperations + Reflectable>(object: &T,
|
|||
body_type: BodyType,
|
||||
mime_type: Ref<Vec<u8>>)
|
||||
-> Fallible<FetchedData> {
|
||||
let cx = object.global().r().get_cx();
|
||||
let global = object.global_scope();
|
||||
let cx = global.get_cx();
|
||||
let mime = &*mime_type;
|
||||
match body_type {
|
||||
BodyType::Text => run_text_data_algorithm(bytes),
|
||||
BodyType::Json => run_json_data_algorithm(cx, bytes),
|
||||
BodyType::Blob => run_blob_data_algorithm(object.global().r().as_global_scope(), bytes, mime),
|
||||
BodyType::FormData => run_form_data_algorithm(object.global().r().as_global_scope(), bytes, mime),
|
||||
BodyType::Blob => run_blob_data_algorithm(&global, bytes, mime),
|
||||
BodyType::FormData => run_form_data_algorithm(&global, bytes, mime),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue