diff options
author | mckaymatt <mckaymatt@gmail.com> | 2017-04-02 18:37:27 -0400 |
---|---|---|
committer | mckaymatt <mckaymatt@gmail.com> | 2017-04-04 16:46:52 -0400 |
commit | 63f9ad022f1141e2d42d300a1d941988c7bb0d77 (patch) | |
tree | 01fe1c1bf1c1f556590de88ed334bf7ad3d17078 /components/script/dom/browsingcontext.rs | |
parent | 41e712786e6d618e83a0988d43436d6e5e5bb36e (diff) | |
download | servo-63f9ad022f1141e2d42d300a1d941988c7bb0d77.tar.gz servo-63f9ad022f1141e2d42d300a1d941988c7bb0d77.zip |
Add way to get c_void ptr or c_char from caller
Diffstat (limited to 'components/script/dom/browsingcontext.rs')
-rw-r--r-- | components/script/dom/browsingcontext.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/components/script/dom/browsingcontext.rs b/components/script/dom/browsingcontext.rs index b5e66b0fd7b..5a1a82ff9b0 100644 --- a/components/script/dom/browsingcontext.rs +++ b/components/script/dom/browsingcontext.rs @@ -9,8 +9,7 @@ use dom::bindings::js::{JS, Root, RootedReference}; use dom::bindings::proxyhandler::{fill_property_descriptor, get_property_descriptor}; use dom::bindings::reflector::{DomObject, Reflector}; use dom::bindings::trace::JSTraceable; -use dom::bindings::utils::WindowProxyHandler; -use dom::bindings::utils::get_array_index_from_id; +use dom::bindings::utils::{WindowProxyHandler, get_array_index_from_id, AsVoidPtr}; use dom::dissimilaroriginwindow::DissimilarOriginWindow; use dom::element::Element; use dom::globalscope::GlobalScope; @@ -112,7 +111,7 @@ impl BrowsingContext { // The window proxy owns the browsing context. // When we finalize the window proxy, it drops the browsing context it owns. - SetProxyExtra(window_proxy.get(), 0, &PrivateValue(&*browsing_context as *const _ as *const _)); + SetProxyExtra(window_proxy.get(), 0, &PrivateValue((&*browsing_context).as_void_ptr())); // Notify the JS engine about the new window proxy binding. SetWindowProxy(cx, window_jsobject, window_proxy.handle()); @@ -152,7 +151,7 @@ impl BrowsingContext { // The window proxy owns the browsing context. // When we finalize the window proxy, it drops the browsing context it owns. - SetProxyExtra(window_proxy.get(), 0, &PrivateValue(&*browsing_context as *const _ as *const _)); + SetProxyExtra(window_proxy.get(), 0, &PrivateValue((&*browsing_context).as_void_ptr())); // Notify the JS engine about the new window proxy binding. SetWindowProxy(cx, window_jsobject, window_proxy.handle()); @@ -225,7 +224,7 @@ impl BrowsingContext { debug!("Transplanted window proxy is {:p}.", new_window_proxy.get()); // Transfer ownership of this browsing context from the old window proxy to the new one. - SetProxyExtra(new_window_proxy.get(), 0, &PrivateValue(self as *const _ as *const _)); + SetProxyExtra(new_window_proxy.get(), 0, &PrivateValue(self.as_void_ptr())); // Notify the JS engine about the new window proxy binding. SetWindowProxy(cx, window_jsobject, new_window_proxy.handle()); @@ -601,4 +600,3 @@ unsafe extern fn trace(trc: *mut JSTracer, obj: *mut JSObject) { } (*this).trace(trc); } - |