diff options
author | Ms2ger <ms2ger@gmail.com> | 2014-03-05 21:04:57 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2014-03-05 21:04:57 +0100 |
commit | 57be68ca8b492ba93f66600f0b01c902ff35114b (patch) | |
tree | 3465248a5b63e07ea3c0902cad422dbc694bd25d /src/components/script/script_task.rs | |
parent | 14f679d455e5907a738c5879e10c0ff32de7a942 (diff) | |
download | servo-57be68ca8b492ba93f66600f0b01c902ff35114b.tar.gz servo-57be68ca8b492ba93f66600f0b01c902ff35114b.zip |
Stop sticking a Page in the JSContext's private.
Diffstat (limited to 'src/components/script/script_task.rs')
-rw-r--r-- | src/components/script/script_task.rs | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs index 5bc064c77cf..d4215b46c28 100644 --- a/src/components/script/script_task.rs +++ b/src/components/script/script_task.rs @@ -35,8 +35,7 @@ use geom::size::Size2D; use js::JSVAL_NULL; use js::global::DEBUG_FNS; use js::glue::RUST_JSVAL_TO_OBJECT; -use js::jsapi::{JSContext, JSObject, JS_InhibitGC, JS_AllowGC}; -use js::jsapi::{JS_CallFunctionValue, JS_GetContextPrivate}; +use js::jsapi::{JSObject, JS_InhibitGC, JS_AllowGC, JS_CallFunctionValue}; use js::rust::{Compartment, Cx, CxUtils, RtUtils}; use js; use servo_msg::compositor_msg::{FinishedLoading, Loading, PerformingLayout, ScriptListener}; @@ -420,15 +419,7 @@ impl Page { Err(()) => fail!("Failed to create a compartment"), }; - // Indirection for Rust Issue #6248, dynamic freeze scope artifically extended - let page_ptr = { - let borrowed_page = &*self; - borrowed_page as *Page - }; - unsafe { - js_context.borrow().set_cx_private(page_ptr as *()); - JS_InhibitGC(js_context.borrow().ptr); } @@ -489,13 +480,6 @@ pub struct ScriptTask { mouse_over_targets: RefCell<Option<~[JS<Node>]>> } -/// Returns the relevant page from the associated JS Context. -pub fn page_from_context(js_context: *JSContext) -> *Page { - unsafe { - JS_GetContextPrivate(js_context) as *Page - } -} - impl ScriptTask { /// Creates a new script task. pub fn new(id: PipelineId, |