Move DUMMY_URL_DATA to glue and use static to avoid shutdown leak.

This commit is contained in:
Xidorn Quan 2017-04-03 21:17:17 +10:00
parent 806d73e696
commit 3d483a986d
2 changed files with 20 additions and 19 deletions

View file

@ -41,7 +41,7 @@ use gecko_bindings::bindings::Gecko_IsSignificantChild;
use gecko_bindings::bindings::Gecko_MatchStringArgPseudo;
use gecko_bindings::bindings::Gecko_UpdateAnimations;
use gecko_bindings::structs;
use gecko_bindings::structs::{RawGeckoElement, RawGeckoNode, URLExtraData};
use gecko_bindings::structs::{RawGeckoElement, RawGeckoNode};
use gecko_bindings::structs::{nsIAtom, nsIContent, nsStyleContext};
use gecko_bindings::structs::EffectCompositor_CascadeLevel as CascadeLevel;
use gecko_bindings::structs::NODE_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO;
@ -49,7 +49,6 @@ use gecko_bindings::structs::NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO;
use gecko_bindings::structs::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE;
use gecko_bindings::structs::NODE_IS_NATIVE_ANONYMOUS;
use gecko_bindings::sugar::ownership::HasArcFFI;
use gecko_bindings::sugar::refptr::RefPtr;
use parking_lot::RwLock;
use properties::{ComputedValues, parse_style_attribute};
use properties::PropertyDeclarationBlock;
@ -388,17 +387,6 @@ impl<'le> GeckoElement<'le> {
}
}
lazy_static! {
/// A dummy url data in order to get it where we don't have any available.
///
/// We need to get rid of this sooner than later.
pub static ref DUMMY_URL_DATA: RefPtr<URLExtraData> = {
unsafe {
RefPtr::from_addrefed(bindings::Gecko_URLExtraData_CreateDummy())
}
};
}
/// Converts flags from the layout used by rust-selectors to the layout used
/// by Gecko. We could align these and then do this without conditionals, but
/// it's probably not worth the trouble.