mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Mark JSTraceable and its method as unsafe
This commit is contained in:
parent
73b6e705b4
commit
620a67ff14
16 changed files with 191 additions and 185 deletions
|
@ -41,10 +41,11 @@ fn expand_string(input: &str) -> String {
|
||||||
}
|
}
|
||||||
|
|
||||||
let tokens = quote! {
|
let tokens = quote! {
|
||||||
impl #impl_generics ::dom::bindings::trace::JSTraceable for #name #ty_generics #where_clause {
|
#[allow(unsafe_code)]
|
||||||
|
unsafe impl #impl_generics ::dom::bindings::trace::JSTraceable for #name #ty_generics #where_clause {
|
||||||
#[inline]
|
#[inline]
|
||||||
#[allow(unused_variables, unused_imports)]
|
#[allow(unused_variables, unused_imports)]
|
||||||
fn trace(&self, tracer: *mut ::js::jsapi::JSTracer) {
|
unsafe fn trace(&self, tracer: *mut ::js::jsapi::JSTracer) {
|
||||||
use ::dom::bindings::trace::JSTraceable;
|
use ::dom::bindings::trace::JSTraceable;
|
||||||
match *self {
|
match *self {
|
||||||
#match_body
|
#match_body
|
||||||
|
|
|
@ -122,8 +122,8 @@ which has an area, and the trait provides a way to get that object's area.
|
||||||
Now let's look at the `JSTraceable` trait, which we use for tracing:
|
Now let's look at the `JSTraceable` trait, which we use for tracing:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
pub trait JSTraceable {
|
pub unsafe trait JSTraceable {
|
||||||
fn trace(&self, trc: *mut JSTracer);
|
unsafe fn trace(&self, trc: *mut JSTracer);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ pub fn trace_reflector(tracer: *mut JSTracer, description: &str, reflector: &Ref
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: Reflectable> JSTraceable for JS<T> {
|
impl<T: Reflectable> JSTraceable for JS<T> {
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
trace_reflector(trc, "", unsafe { (**self.ptr).reflector() });
|
trace_reflector(trc, "", unsafe { (**self.ptr).reflector() });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,10 +105,10 @@ impl<T: Reflectable> Deref for JS<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: Reflectable> JSTraceable for JS<T> {
|
unsafe impl<T: Reflectable> JSTraceable for JS<T> {
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
let trace_str = format!("for {} on heap", unsafe { type_name::<T>() });
|
let trace_str = format!("for {} on heap", type_name::<T>());
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
let trace_info = &trace_str[..];
|
let trace_info = &trace_str[..];
|
||||||
#[cfg(not(debug_assertions))]
|
#[cfg(not(debug_assertions))]
|
||||||
|
@ -116,7 +116,7 @@ impl<T: Reflectable> JSTraceable for JS<T> {
|
||||||
|
|
||||||
trace_reflector(trc,
|
trace_reflector(trc,
|
||||||
trace_info,
|
trace_info,
|
||||||
unsafe { (**self.ptr).reflector() });
|
(**self.ptr).reflector());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
//! This is typically derived via a `#[dom_struct]`
|
//! This is typically derived via a `#[dom_struct]`
|
||||||
//! (implies `#[derive(JSTraceable)]`) annotation.
|
//! (implies `#[derive(JSTraceable)]`) annotation.
|
||||||
//! Non-JS-managed types have an empty inline `trace()` method,
|
//! Non-JS-managed types have an empty inline `trace()` method,
|
||||||
//! achieved via `no_jsmanaged_fields!` or similar.
|
//! achieved via `unsafe_no_jsmanaged_fields!` or similar.
|
||||||
//! 3. For all fields, `Foo::trace()`
|
//! 3. For all fields, `Foo::trace()`
|
||||||
//! calls `trace()` on the field.
|
//! calls `trace()` on the field.
|
||||||
//! For example, for fields of type `JS<T>`, `JS<T>::trace()` calls
|
//! For example, for fields of type `JS<T>`, `JS<T>::trace()` calls
|
||||||
|
@ -26,8 +26,8 @@
|
||||||
//! 5. When the GC finishes tracing, it [`finalizes`](../index.html#destruction)
|
//! 5. When the GC finishes tracing, it [`finalizes`](../index.html#destruction)
|
||||||
//! any reflectors that were not reachable.
|
//! any reflectors that were not reachable.
|
||||||
//!
|
//!
|
||||||
//! The `no_jsmanaged_fields!()` macro adds an empty implementation of `JSTraceable` to
|
//! The `unsafe_no_jsmanaged_fields!()` macro adds an empty implementation of
|
||||||
//! a datatype.
|
//! `JSTraceable` to a datatype.
|
||||||
|
|
||||||
use canvas_traits::{CanvasGradientStop, LinearGradientStyle, RadialGradientStyle};
|
use canvas_traits::{CanvasGradientStop, LinearGradientStyle, RadialGradientStyle};
|
||||||
use canvas_traits::{CompositionOrBlending, LineCapStyle, LineJoinStyle, RepetitionStyle};
|
use canvas_traits::{CompositionOrBlending, LineCapStyle, LineJoinStyle, RepetitionStyle};
|
||||||
|
@ -106,18 +106,18 @@ use webrender_traits::{WebGLBufferId, WebGLError, WebGLFramebufferId, WebGLProgr
|
||||||
use webrender_traits::{WebGLRenderbufferId, WebGLShaderId, WebGLTextureId};
|
use webrender_traits::{WebGLRenderbufferId, WebGLShaderId, WebGLTextureId};
|
||||||
|
|
||||||
/// A trait to allow tracing (only) DOM objects.
|
/// A trait to allow tracing (only) DOM objects.
|
||||||
pub trait JSTraceable {
|
pub unsafe trait JSTraceable {
|
||||||
/// Trace `self`.
|
/// Trace `self`.
|
||||||
fn trace(&self, trc: *mut JSTracer);
|
unsafe fn trace(&self, trc: *mut JSTracer);
|
||||||
}
|
}
|
||||||
|
|
||||||
no_jsmanaged_fields!(CSSError);
|
unsafe_no_jsmanaged_fields!(CSSError);
|
||||||
|
|
||||||
no_jsmanaged_fields!(EncodingRef);
|
unsafe_no_jsmanaged_fields!(EncodingRef);
|
||||||
|
|
||||||
no_jsmanaged_fields!(Reflector);
|
unsafe_no_jsmanaged_fields!(Reflector);
|
||||||
|
|
||||||
no_jsmanaged_fields!(Duration);
|
unsafe_no_jsmanaged_fields!(Duration);
|
||||||
|
|
||||||
/// Trace a `JSVal`.
|
/// Trace a `JSVal`.
|
||||||
pub fn trace_jsval(tracer: *mut JSTracer, description: &str, val: &Heap<JSVal>) {
|
pub fn trace_jsval(tracer: *mut JSTracer, description: &str, val: &Heap<JSVal>) {
|
||||||
|
@ -154,40 +154,38 @@ pub fn trace_object(tracer: *mut JSTracer, description: &str, obj: &Heap<*mut JS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: JSTraceable> JSTraceable for Rc<T> {
|
unsafe impl<T: JSTraceable> JSTraceable for Rc<T> {
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
(**self).trace(trc)
|
(**self).trace(trc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: JSTraceable + ?Sized> JSTraceable for Box<T> {
|
unsafe impl<T: JSTraceable + ?Sized> JSTraceable for Box<T> {
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
(**self).trace(trc)
|
(**self).trace(trc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: JSTraceable + Copy> JSTraceable for Cell<T> {
|
unsafe impl<T: JSTraceable + Copy> JSTraceable for Cell<T> {
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
self.get().trace(trc)
|
self.get().trace(trc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: JSTraceable> JSTraceable for UnsafeCell<T> {
|
unsafe impl<T: JSTraceable> JSTraceable for UnsafeCell<T> {
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
unsafe { (*self.get()).trace(trc) }
|
(*self.get()).trace(trc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: JSTraceable> JSTraceable for DOMRefCell<T> {
|
unsafe impl<T: JSTraceable> JSTraceable for DOMRefCell<T> {
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
unsafe {
|
|
||||||
(*self).borrow_for_gc_trace().trace(trc)
|
(*self).borrow_for_gc_trace().trace(trc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
impl JSTraceable for Heap<*mut JSObject> {
|
unsafe impl JSTraceable for Heap<*mut JSObject> {
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
if self.get().is_null() {
|
if self.get().is_null() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -195,34 +193,34 @@ impl JSTraceable for Heap<*mut JSObject> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl JSTraceable for Heap<JSVal> {
|
unsafe impl JSTraceable for Heap<JSVal> {
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
trace_jsval(trc, "heap value", self);
|
trace_jsval(trc, "heap value", self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXXManishearth Check if the following three are optimized to no-ops
|
// XXXManishearth Check if the following three are optimized to no-ops
|
||||||
// if e.trace() is a no-op (e.g it is an no_jsmanaged_fields type)
|
// if e.trace() is a no-op (e.g it is an unsafe_no_jsmanaged_fields type)
|
||||||
impl<T: JSTraceable> JSTraceable for Vec<T> {
|
unsafe impl<T: JSTraceable> JSTraceable for Vec<T> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
for e in &*self {
|
for e in &*self {
|
||||||
e.trace(trc);
|
e.trace(trc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: JSTraceable> JSTraceable for VecDeque<T> {
|
unsafe impl<T: JSTraceable> JSTraceable for VecDeque<T> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
for e in &*self {
|
for e in &*self {
|
||||||
e.trace(trc);
|
e.trace(trc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: JSTraceable> JSTraceable for (T, T, T, T) {
|
unsafe impl<T: JSTraceable> JSTraceable for (T, T, T, T) {
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
self.0.trace(trc);
|
self.0.trace(trc);
|
||||||
self.1.trace(trc);
|
self.1.trace(trc);
|
||||||
self.2.trace(trc);
|
self.2.trace(trc);
|
||||||
|
@ -231,26 +229,26 @@ impl<T: JSTraceable> JSTraceable for (T, T, T, T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXXManishearth Check if the following three are optimized to no-ops
|
// XXXManishearth Check if the following three are optimized to no-ops
|
||||||
// if e.trace() is a no-op (e.g it is an no_jsmanaged_fields type)
|
// if e.trace() is a no-op (e.g it is an unsafe_no_jsmanaged_fields type)
|
||||||
impl<T: JSTraceable + 'static> JSTraceable for SmallVec<[T; 1]> {
|
unsafe impl<T: JSTraceable + 'static> JSTraceable for SmallVec<[T; 1]> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
for e in self.iter() {
|
for e in self.iter() {
|
||||||
e.trace(trc);
|
e.trace(trc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: JSTraceable> JSTraceable for Option<T> {
|
unsafe impl<T: JSTraceable> JSTraceable for Option<T> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
self.as_ref().map(|e| e.trace(trc));
|
self.as_ref().map(|e| e.trace(trc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: JSTraceable, U: JSTraceable> JSTraceable for Result<T, U> {
|
unsafe impl<T: JSTraceable, U: JSTraceable> JSTraceable for Result<T, U> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
match *self {
|
match *self {
|
||||||
Ok(ref inner) => inner.trace(trc),
|
Ok(ref inner) => inner.trace(trc),
|
||||||
Err(ref inner) => inner.trace(trc),
|
Err(ref inner) => inner.trace(trc),
|
||||||
|
@ -258,13 +256,13 @@ impl<T: JSTraceable, U: JSTraceable> JSTraceable for Result<T, U> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<K, V, S> JSTraceable for HashMap<K, V, S>
|
unsafe impl<K, V, S> JSTraceable for HashMap<K, V, S>
|
||||||
where K: Hash + Eq + JSTraceable,
|
where K: Hash + Eq + JSTraceable,
|
||||||
V: JSTraceable,
|
V: JSTraceable,
|
||||||
S: BuildHasher
|
S: BuildHasher
|
||||||
{
|
{
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
for (k, v) in &*self {
|
for (k, v) in &*self {
|
||||||
k.trace(trc);
|
k.trace(trc);
|
||||||
v.trace(trc);
|
v.trace(trc);
|
||||||
|
@ -272,9 +270,9 @@ impl<K, V, S> JSTraceable for HashMap<K, V, S>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<K: Ord + JSTraceable, V: JSTraceable> JSTraceable for BTreeMap<K, V> {
|
unsafe impl<K: Ord + JSTraceable, V: JSTraceable> JSTraceable for BTreeMap<K, V> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
for (k, v) in self {
|
for (k, v) in self {
|
||||||
k.trace(trc);
|
k.trace(trc);
|
||||||
v.trace(trc);
|
v.trace(trc);
|
||||||
|
@ -282,18 +280,18 @@ impl<K: Ord + JSTraceable, V: JSTraceable> JSTraceable for BTreeMap<K, V> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<A: JSTraceable, B: JSTraceable> JSTraceable for (A, B) {
|
unsafe impl<A: JSTraceable, B: JSTraceable> JSTraceable for (A, B) {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
let (ref a, ref b) = *self;
|
let (ref a, ref b) = *self;
|
||||||
a.trace(trc);
|
a.trace(trc);
|
||||||
b.trace(trc);
|
b.trace(trc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<A: JSTraceable, B: JSTraceable, C: JSTraceable> JSTraceable for (A, B, C) {
|
unsafe impl<A: JSTraceable, B: JSTraceable, C: JSTraceable> JSTraceable for (A, B, C) {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
let (ref a, ref b, ref c) = *self;
|
let (ref a, ref b, ref c) = *self;
|
||||||
a.trace(trc);
|
a.trace(trc);
|
||||||
b.trace(trc);
|
b.trace(trc);
|
||||||
|
@ -301,131 +299,131 @@ impl<A: JSTraceable, B: JSTraceable, C: JSTraceable> JSTraceable for (A, B, C) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
no_jsmanaged_fields!(bool, f32, f64, String, ServoUrl, AtomicBool, AtomicUsize, UrlOrigin, Uuid, char);
|
unsafe_no_jsmanaged_fields!(bool, f32, f64, String, ServoUrl, AtomicBool, AtomicUsize, UrlOrigin, Uuid, char);
|
||||||
no_jsmanaged_fields!(usize, u8, u16, u32, u64);
|
unsafe_no_jsmanaged_fields!(usize, u8, u16, u32, u64);
|
||||||
no_jsmanaged_fields!(isize, i8, i16, i32, i64);
|
unsafe_no_jsmanaged_fields!(isize, i8, i16, i32, i64);
|
||||||
no_jsmanaged_fields!(Sender<T>);
|
unsafe_no_jsmanaged_fields!(Sender<T>);
|
||||||
no_jsmanaged_fields!(Receiver<T>);
|
unsafe_no_jsmanaged_fields!(Receiver<T>);
|
||||||
no_jsmanaged_fields!(Point2D<T>);
|
unsafe_no_jsmanaged_fields!(Point2D<T>);
|
||||||
no_jsmanaged_fields!(Rect<T>);
|
unsafe_no_jsmanaged_fields!(Rect<T>);
|
||||||
no_jsmanaged_fields!(Size2D<T>);
|
unsafe_no_jsmanaged_fields!(Size2D<T>);
|
||||||
no_jsmanaged_fields!(Arc<T>);
|
unsafe_no_jsmanaged_fields!(Arc<T>);
|
||||||
no_jsmanaged_fields!(Image, ImageMetadata, ImageCacheChan, ImageCacheThread);
|
unsafe_no_jsmanaged_fields!(Image, ImageMetadata, ImageCacheChan, ImageCacheThread);
|
||||||
no_jsmanaged_fields!(Metadata);
|
unsafe_no_jsmanaged_fields!(Metadata);
|
||||||
no_jsmanaged_fields!(NetworkError);
|
unsafe_no_jsmanaged_fields!(NetworkError);
|
||||||
no_jsmanaged_fields!(Atom, Prefix, LocalName, Namespace, QualName);
|
unsafe_no_jsmanaged_fields!(Atom, Prefix, LocalName, Namespace, QualName);
|
||||||
no_jsmanaged_fields!(Trusted<T: Reflectable>);
|
unsafe_no_jsmanaged_fields!(Trusted<T: Reflectable>);
|
||||||
no_jsmanaged_fields!(TrustedPromise);
|
unsafe_no_jsmanaged_fields!(TrustedPromise);
|
||||||
no_jsmanaged_fields!(PropertyDeclarationBlock);
|
unsafe_no_jsmanaged_fields!(PropertyDeclarationBlock);
|
||||||
no_jsmanaged_fields!(HashSet<T>);
|
unsafe_no_jsmanaged_fields!(HashSet<T>);
|
||||||
// These three are interdependent, if you plan to put jsmanaged data
|
// These three are interdependent, if you plan to put jsmanaged data
|
||||||
// in one of these make sure it is propagated properly to containing structs
|
// in one of these make sure it is propagated properly to containing structs
|
||||||
no_jsmanaged_fields!(FrameId, FrameType, WindowSizeData, WindowSizeType, PipelineId);
|
unsafe_no_jsmanaged_fields!(FrameId, FrameType, WindowSizeData, WindowSizeType, PipelineId);
|
||||||
no_jsmanaged_fields!(TimerEventId, TimerSource);
|
unsafe_no_jsmanaged_fields!(TimerEventId, TimerSource);
|
||||||
no_jsmanaged_fields!(WorkerId);
|
unsafe_no_jsmanaged_fields!(WorkerId);
|
||||||
no_jsmanaged_fields!(BufferQueue, QuirksMode);
|
unsafe_no_jsmanaged_fields!(BufferQueue, QuirksMode);
|
||||||
no_jsmanaged_fields!(Runtime);
|
unsafe_no_jsmanaged_fields!(Runtime);
|
||||||
no_jsmanaged_fields!(Headers, Method);
|
unsafe_no_jsmanaged_fields!(Headers, Method);
|
||||||
no_jsmanaged_fields!(WindowProxyHandler);
|
unsafe_no_jsmanaged_fields!(WindowProxyHandler);
|
||||||
no_jsmanaged_fields!(UntrustedNodeAddress);
|
unsafe_no_jsmanaged_fields!(UntrustedNodeAddress);
|
||||||
no_jsmanaged_fields!(LengthOrPercentageOrAuto);
|
unsafe_no_jsmanaged_fields!(LengthOrPercentageOrAuto);
|
||||||
no_jsmanaged_fields!(RGBA);
|
unsafe_no_jsmanaged_fields!(RGBA);
|
||||||
no_jsmanaged_fields!(EuclidLength<Unit, T>);
|
unsafe_no_jsmanaged_fields!(EuclidLength<Unit, T>);
|
||||||
no_jsmanaged_fields!(Matrix2D<T>);
|
unsafe_no_jsmanaged_fields!(Matrix2D<T>);
|
||||||
no_jsmanaged_fields!(Matrix4D<T>);
|
unsafe_no_jsmanaged_fields!(Matrix4D<T>);
|
||||||
no_jsmanaged_fields!(StorageType);
|
unsafe_no_jsmanaged_fields!(StorageType);
|
||||||
no_jsmanaged_fields!(CanvasGradientStop, LinearGradientStyle, RadialGradientStyle);
|
unsafe_no_jsmanaged_fields!(CanvasGradientStop, LinearGradientStyle, RadialGradientStyle);
|
||||||
no_jsmanaged_fields!(LineCapStyle, LineJoinStyle, CompositionOrBlending);
|
unsafe_no_jsmanaged_fields!(LineCapStyle, LineJoinStyle, CompositionOrBlending);
|
||||||
no_jsmanaged_fields!(RepetitionStyle);
|
unsafe_no_jsmanaged_fields!(RepetitionStyle);
|
||||||
no_jsmanaged_fields!(WebGLError, GLLimits);
|
unsafe_no_jsmanaged_fields!(WebGLError, GLLimits);
|
||||||
no_jsmanaged_fields!(TimeProfilerChan);
|
unsafe_no_jsmanaged_fields!(TimeProfilerChan);
|
||||||
no_jsmanaged_fields!(MemProfilerChan);
|
unsafe_no_jsmanaged_fields!(MemProfilerChan);
|
||||||
no_jsmanaged_fields!(PseudoElement);
|
unsafe_no_jsmanaged_fields!(PseudoElement);
|
||||||
no_jsmanaged_fields!(Length);
|
unsafe_no_jsmanaged_fields!(Length);
|
||||||
no_jsmanaged_fields!(ElementState);
|
unsafe_no_jsmanaged_fields!(ElementState);
|
||||||
no_jsmanaged_fields!(DOMString);
|
unsafe_no_jsmanaged_fields!(DOMString);
|
||||||
no_jsmanaged_fields!(Mime);
|
unsafe_no_jsmanaged_fields!(Mime);
|
||||||
no_jsmanaged_fields!(AttrIdentifier);
|
unsafe_no_jsmanaged_fields!(AttrIdentifier);
|
||||||
no_jsmanaged_fields!(AttrValue);
|
unsafe_no_jsmanaged_fields!(AttrValue);
|
||||||
no_jsmanaged_fields!(Snapshot);
|
unsafe_no_jsmanaged_fields!(Snapshot);
|
||||||
no_jsmanaged_fields!(PendingRestyle);
|
unsafe_no_jsmanaged_fields!(PendingRestyle);
|
||||||
no_jsmanaged_fields!(HttpsState);
|
unsafe_no_jsmanaged_fields!(HttpsState);
|
||||||
no_jsmanaged_fields!(Request);
|
unsafe_no_jsmanaged_fields!(Request);
|
||||||
no_jsmanaged_fields!(RequestInit);
|
unsafe_no_jsmanaged_fields!(RequestInit);
|
||||||
no_jsmanaged_fields!(SharedRt);
|
unsafe_no_jsmanaged_fields!(SharedRt);
|
||||||
no_jsmanaged_fields!(TouchpadPressurePhase);
|
unsafe_no_jsmanaged_fields!(TouchpadPressurePhase);
|
||||||
no_jsmanaged_fields!(USVString);
|
unsafe_no_jsmanaged_fields!(USVString);
|
||||||
no_jsmanaged_fields!(ReferrerPolicy);
|
unsafe_no_jsmanaged_fields!(ReferrerPolicy);
|
||||||
no_jsmanaged_fields!(Response);
|
unsafe_no_jsmanaged_fields!(Response);
|
||||||
no_jsmanaged_fields!(ResponseBody);
|
unsafe_no_jsmanaged_fields!(ResponseBody);
|
||||||
no_jsmanaged_fields!(ResourceThreads);
|
unsafe_no_jsmanaged_fields!(ResourceThreads);
|
||||||
no_jsmanaged_fields!(StatusCode);
|
unsafe_no_jsmanaged_fields!(StatusCode);
|
||||||
no_jsmanaged_fields!(SystemTime);
|
unsafe_no_jsmanaged_fields!(SystemTime);
|
||||||
no_jsmanaged_fields!(Instant);
|
unsafe_no_jsmanaged_fields!(Instant);
|
||||||
no_jsmanaged_fields!(RelativePos);
|
unsafe_no_jsmanaged_fields!(RelativePos);
|
||||||
no_jsmanaged_fields!(OpaqueStyleAndLayoutData);
|
unsafe_no_jsmanaged_fields!(OpaqueStyleAndLayoutData);
|
||||||
no_jsmanaged_fields!(PathBuf);
|
unsafe_no_jsmanaged_fields!(PathBuf);
|
||||||
no_jsmanaged_fields!(CSSErrorReporter);
|
unsafe_no_jsmanaged_fields!(CSSErrorReporter);
|
||||||
no_jsmanaged_fields!(WebGLBufferId);
|
unsafe_no_jsmanaged_fields!(WebGLBufferId);
|
||||||
no_jsmanaged_fields!(WebGLFramebufferId);
|
unsafe_no_jsmanaged_fields!(WebGLFramebufferId);
|
||||||
no_jsmanaged_fields!(WebGLProgramId);
|
unsafe_no_jsmanaged_fields!(WebGLProgramId);
|
||||||
no_jsmanaged_fields!(WebGLRenderbufferId);
|
unsafe_no_jsmanaged_fields!(WebGLRenderbufferId);
|
||||||
no_jsmanaged_fields!(WebGLShaderId);
|
unsafe_no_jsmanaged_fields!(WebGLShaderId);
|
||||||
no_jsmanaged_fields!(WebGLTextureId);
|
unsafe_no_jsmanaged_fields!(WebGLTextureId);
|
||||||
no_jsmanaged_fields!(MediaList);
|
unsafe_no_jsmanaged_fields!(MediaList);
|
||||||
|
|
||||||
impl JSTraceable for Box<ScriptChan + Send> {
|
unsafe impl JSTraceable for Box<ScriptChan + Send> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, _trc: *mut JSTracer) {
|
unsafe fn trace(&self, _trc: *mut JSTracer) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl JSTraceable for Box<FnBox(f64, )> {
|
unsafe impl JSTraceable for Box<FnBox(f64, )> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, _trc: *mut JSTracer) {
|
unsafe fn trace(&self, _trc: *mut JSTracer) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> JSTraceable for &'a str {
|
unsafe impl<'a> JSTraceable for &'a str {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, _: *mut JSTracer) {
|
unsafe fn trace(&self, _: *mut JSTracer) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<A, B> JSTraceable for fn(A) -> B {
|
unsafe impl<A, B> JSTraceable for fn(A) -> B {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, _: *mut JSTracer) {
|
unsafe fn trace(&self, _: *mut JSTracer) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> JSTraceable for IpcSender<T> where T: Deserialize + Serialize {
|
unsafe impl<T> JSTraceable for IpcSender<T> where T: Deserialize + Serialize {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, _: *mut JSTracer) {
|
unsafe fn trace(&self, _: *mut JSTracer) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl JSTraceable for Box<LayoutRPC + 'static> {
|
unsafe impl JSTraceable for Box<LayoutRPC + 'static> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, _: *mut JSTracer) {
|
unsafe fn trace(&self, _: *mut JSTracer) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl JSTraceable for () {
|
unsafe impl JSTraceable for () {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, _: *mut JSTracer) {
|
unsafe fn trace(&self, _: *mut JSTracer) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> JSTraceable for IpcReceiver<T> where T: Deserialize + Serialize {
|
unsafe impl<T> JSTraceable for IpcReceiver<T> where T: Deserialize + Serialize {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, _: *mut JSTracer) {
|
unsafe fn trace(&self, _: *mut JSTracer) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -433,7 +431,7 @@ impl<T> JSTraceable for IpcReceiver<T> where T: Deserialize + Serialize {
|
||||||
/// Homemade trait object for JSTraceable things
|
/// Homemade trait object for JSTraceable things
|
||||||
struct TraceableInfo {
|
struct TraceableInfo {
|
||||||
pub ptr: *const libc::c_void,
|
pub ptr: *const libc::c_void,
|
||||||
pub trace: fn(obj: *const libc::c_void, tracer: *mut JSTracer),
|
pub trace: unsafe fn(obj: *const libc::c_void, tracer: *mut JSTracer),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Holds a set of JSTraceables that need to be rooted
|
/// Holds a set of JSTraceables that need to be rooted
|
||||||
|
@ -474,8 +472,8 @@ impl RootedTraceableSet {
|
||||||
|
|
||||||
unsafe fn add<T: JSTraceable>(traceable: &T) {
|
unsafe fn add<T: JSTraceable>(traceable: &T) {
|
||||||
ROOTED_TRACEABLES.with(|ref traceables| {
|
ROOTED_TRACEABLES.with(|ref traceables| {
|
||||||
fn trace<T: JSTraceable>(obj: *const libc::c_void, tracer: *mut JSTracer) {
|
unsafe fn trace<T: JSTraceable>(obj: *const libc::c_void, tracer: *mut JSTracer) {
|
||||||
let obj: &T = unsafe { &*(obj as *const T) };
|
let obj: &T = &*(obj as *const T);
|
||||||
obj.trace(tracer);
|
obj.trace(tracer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@ impl<T: WeakReferenceable> PartialEq<T> for WeakRef<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
no_jsmanaged_fields!(WeakRef<T: WeakReferenceable>);
|
unsafe_no_jsmanaged_fields!(WeakRef<T: WeakReferenceable>);
|
||||||
|
|
||||||
impl<T: WeakReferenceable> Drop for WeakRef<T> {
|
impl<T: WeakReferenceable> Drop for WeakRef<T> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
|
@ -188,10 +188,9 @@ impl<T: WeakReferenceable> HeapSizeOf for MutableWeakRef<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: WeakReferenceable> JSTraceable for MutableWeakRef<T> {
|
unsafe impl<T: WeakReferenceable> JSTraceable for MutableWeakRef<T> {
|
||||||
fn trace(&self, _: *mut JSTracer) {
|
unsafe fn trace(&self, _: *mut JSTracer) {
|
||||||
let ptr = self.cell.get();
|
let ptr = self.cell.get();
|
||||||
unsafe {
|
|
||||||
let should_drop = match *ptr {
|
let should_drop = match *ptr {
|
||||||
Some(ref value) => !value.is_alive(),
|
Some(ref value) => !value.is_alive(),
|
||||||
None => false,
|
None => false,
|
||||||
|
@ -201,7 +200,6 @@ impl<T: WeakReferenceable> JSTraceable for MutableWeakRef<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// A vector of weak references. On tracing, the vector retains
|
/// A vector of weak references. On tracing, the vector retains
|
||||||
/// only references which still point to live objects.
|
/// only references which still point to live objects.
|
||||||
|
|
|
@ -15,7 +15,7 @@ use js::jsapi::{JSContext, JSObject};
|
||||||
use js::jsapi::{JS_GetArrayBufferViewType, Type};
|
use js::jsapi::{JS_GetArrayBufferViewType, Type};
|
||||||
use rand::{OsRng, Rng};
|
use rand::{OsRng, Rng};
|
||||||
|
|
||||||
no_jsmanaged_fields!(OsRng);
|
unsafe_no_jsmanaged_fields!(OsRng);
|
||||||
|
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/API/Crypto
|
// https://developer.mozilla.org/en-US/docs/Web/API/Crypto
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
|
|
|
@ -16,8 +16,10 @@ use parking_lot::RwLock;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use style::stylesheets::{CssRules, KeyframesRule, RulesMutateError};
|
use style::stylesheets::{CssRules, KeyframesRule, RulesMutateError};
|
||||||
|
|
||||||
no_jsmanaged_fields!(RulesSource);
|
#[allow(unsafe_code)]
|
||||||
no_jsmanaged_fields!(CssRules);
|
unsafe_no_jsmanaged_fields!(RulesSource);
|
||||||
|
|
||||||
|
unsafe_no_jsmanaged_fields!(CssRules);
|
||||||
|
|
||||||
impl From<RulesMutateError> for Error {
|
impl From<RulesMutateError> for Error {
|
||||||
fn from(other: RulesMutateError) -> Self {
|
fn from(other: RulesMutateError) -> Self {
|
||||||
|
|
|
@ -50,7 +50,7 @@ use style::parser::ParserContextExtraData;
|
||||||
use style::str::HTML_SPACE_CHARACTERS;
|
use style::str::HTML_SPACE_CHARACTERS;
|
||||||
use style::stylesheets::{Stylesheet, Origin};
|
use style::stylesheets::{Stylesheet, Origin};
|
||||||
|
|
||||||
no_jsmanaged_fields!(Stylesheet);
|
unsafe_no_jsmanaged_fields!(Stylesheet);
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLLinkElement {
|
pub struct HTMLLinkElement {
|
||||||
|
|
|
@ -19,7 +19,7 @@ use msg::constellation_msg::{Key, KeyModifiers};
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
no_jsmanaged_fields!(Key);
|
unsafe_no_jsmanaged_fields!(Key);
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct KeyboardEvent {
|
pub struct KeyboardEvent {
|
||||||
|
|
|
@ -302,37 +302,41 @@ macro_rules! make_nonzero_dimension_setter(
|
||||||
|
|
||||||
/// For use on non-jsmanaged types
|
/// For use on non-jsmanaged types
|
||||||
/// Use #[derive(JSTraceable)] on JS managed types
|
/// Use #[derive(JSTraceable)] on JS managed types
|
||||||
macro_rules! no_jsmanaged_fields(
|
macro_rules! unsafe_no_jsmanaged_fields(
|
||||||
([$ty:ident; $count:expr]) => (
|
([$ty:ident; $count:expr]) => (
|
||||||
impl $crate::dom::bindings::trace::JSTraceable for [$ty; $count] {
|
#[allow(unsafe_code)]
|
||||||
|
unsafe impl $crate::dom::bindings::trace::JSTraceable for [$ty; $count] {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, _: *mut ::js::jsapi::JSTracer) {
|
unsafe fn trace(&self, _: *mut ::js::jsapi::JSTracer) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
($($ty:ident),+) => (
|
($($ty:ident),+) => (
|
||||||
$(
|
$(
|
||||||
impl $crate::dom::bindings::trace::JSTraceable for $ty {
|
#[allow(unsafe_code)]
|
||||||
|
unsafe impl $crate::dom::bindings::trace::JSTraceable for $ty {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, _: *mut ::js::jsapi::JSTracer) {
|
unsafe fn trace(&self, _: *mut ::js::jsapi::JSTracer) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)+
|
)+
|
||||||
);
|
);
|
||||||
($ty:ident<$($gen:ident),+>) => (
|
($ty:ident<$($gen:ident),+>) => (
|
||||||
impl<$($gen),+> $crate::dom::bindings::trace::JSTraceable for $ty<$($gen),+> {
|
#[allow(unsafe_code)]
|
||||||
|
unsafe impl<$($gen),+> $crate::dom::bindings::trace::JSTraceable for $ty<$($gen),+> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, _: *mut ::js::jsapi::JSTracer) {
|
unsafe fn trace(&self, _: *mut ::js::jsapi::JSTracer) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
($ty:ident<$($gen:ident: $bound:ident),+>) => (
|
($ty:ident<$($gen:ident: $bound:ident),+>) => (
|
||||||
impl<$($gen: $bound),+> $crate::dom::bindings::trace::JSTraceable for $ty<$($gen),+> {
|
#[allow(unsafe_code)]
|
||||||
|
unsafe impl<$($gen: $bound),+> $crate::dom::bindings::trace::JSTraceable for $ty<$($gen),+> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn trace(&self, _: *mut ::js::jsapi::JSTracer) {
|
unsafe fn trace(&self, _: *mut ::js::jsapi::JSTracer) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,8 +143,9 @@ impl WeakMediaQueryListVec {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl JSTraceable for WeakMediaQueryListVec {
|
#[allow(unsafe_code)]
|
||||||
fn trace(&self, _: *mut JSTracer) {
|
unsafe impl JSTraceable for WeakMediaQueryListVec {
|
||||||
|
unsafe fn trace(&self, _: *mut JSTracer) {
|
||||||
self.cell.borrow_mut().retain_alive()
|
self.cell.borrow_mut().retain_alive()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2566,7 +2566,7 @@ struct UniqueId {
|
||||||
cell: UnsafeCell<Option<Box<Uuid>>>,
|
cell: UnsafeCell<Option<Box<Uuid>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
no_jsmanaged_fields!(UniqueId);
|
unsafe_no_jsmanaged_fields!(UniqueId);
|
||||||
|
|
||||||
impl HeapSizeOf for UniqueId {
|
impl HeapSizeOf for UniqueId {
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
|
|
|
@ -1262,8 +1262,8 @@ impl HeapSizeOf for WeakRangeVec {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
impl JSTraceable for WeakRangeVec {
|
unsafe impl JSTraceable for WeakRangeVec {
|
||||||
fn trace(&self, _: *mut JSTracer) {
|
unsafe fn trace(&self, _: *mut JSTracer) {
|
||||||
unsafe { (*self.cell.get()).retain_alive() }
|
(*self.cell.get()).retain_alive()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,8 +96,9 @@ impl Tokenizer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl JSTraceable for HtmlTokenizer<TreeBuilder<JS<Node>, Sink>> {
|
#[allow(unsafe_code)]
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe impl JSTraceable for HtmlTokenizer<TreeBuilder<JS<Node>, Sink>> {
|
||||||
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
struct Tracer(*mut JSTracer);
|
struct Tracer(*mut JSTracer);
|
||||||
let tracer = Tracer(trc);
|
let tracer = Tracer(trc);
|
||||||
|
|
||||||
|
@ -105,7 +106,7 @@ impl JSTraceable for HtmlTokenizer<TreeBuilder<JS<Node>, Sink>> {
|
||||||
type Handle = JS<Node>;
|
type Handle = JS<Node>;
|
||||||
#[allow(unrooted_must_root)]
|
#[allow(unrooted_must_root)]
|
||||||
fn trace_handle(&self, node: &JS<Node>) {
|
fn trace_handle(&self, node: &JS<Node>) {
|
||||||
node.trace(self.0);
|
unsafe { node.trace(self.0); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,8 +72,9 @@ impl Tokenizer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl JSTraceable for XmlTokenizer<XmlTreeBuilder<JS<Node>, Sink>> {
|
#[allow(unsafe_code)]
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
unsafe impl JSTraceable for XmlTokenizer<XmlTreeBuilder<JS<Node>, Sink>> {
|
||||||
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
struct Tracer(*mut JSTracer);
|
struct Tracer(*mut JSTracer);
|
||||||
let tracer = Tracer(trc);
|
let tracer = Tracer(trc);
|
||||||
|
|
||||||
|
@ -81,7 +82,7 @@ impl JSTraceable for XmlTokenizer<XmlTreeBuilder<JS<Node>, Sink>> {
|
||||||
type Handle = JS<Node>;
|
type Handle = JS<Node>;
|
||||||
#[allow(unrooted_must_root)]
|
#[allow(unrooted_must_root)]
|
||||||
fn trace_handle(&self, node: JS<Node>) {
|
fn trace_handle(&self, node: JS<Node>) {
|
||||||
node.trace(self.0);
|
unsafe { node.trace(self.0); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ pub enum TexParameterValue {
|
||||||
const MAX_LEVEL_COUNT: usize = 31;
|
const MAX_LEVEL_COUNT: usize = 31;
|
||||||
const MAX_FACE_COUNT: usize = 6;
|
const MAX_FACE_COUNT: usize = 6;
|
||||||
|
|
||||||
no_jsmanaged_fields!([ImageInfo; MAX_LEVEL_COUNT * MAX_FACE_COUNT]);
|
unsafe_no_jsmanaged_fields!([ImageInfo; MAX_LEVEL_COUNT * MAX_FACE_COUNT]);
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct WebGLTexture {
|
pub struct WebGLTexture {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue