diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2016-10-01 18:15:15 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2016-10-06 21:35:38 +0200 |
commit | ae6af5172b5f09e9ba19d0beca026fd0ac39f8c8 (patch) | |
tree | d60b33499b7caf460b78d53131bb0f147b6e5be0 /components/script/body.rs | |
parent | 27f100b1d47058b92d0e23d8c1b2e472fb0eafca (diff) | |
download | servo-ae6af5172b5f09e9ba19d0beca026fd0ac39f8c8.tar.gz servo-ae6af5172b5f09e9ba19d0beca026fd0ac39f8c8.zip |
Introduce Reflectable::global_scope
Diffstat (limited to 'components/script/body.rs')
-rw-r--r-- | components/script/body.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/body.rs b/components/script/body.rs index 466523f394f..41886e0aee0 100644 --- a/components/script/body.rs +++ b/components/script/body.rs @@ -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), } } |