Make LayoutDocumentHelpers::style_shared_lock be safe

StyleSharedRwLock is Sync.
This commit is contained in:
Anthony Ramine 2020-04-01 00:22:22 +02:00
parent 4636507fa1
commit 0c0027ecfd
3 changed files with 5 additions and 5 deletions

View file

@ -368,7 +368,7 @@ impl<'ld> ServoLayoutDocument<'ld> {
} }
pub fn style_shared_lock(&self) -> &StyleSharedRwLock { pub fn style_shared_lock(&self) -> &StyleSharedRwLock {
unsafe { self.document.style_shared_lock() } self.document.style_shared_lock()
} }
pub fn shadow_roots(&self) -> Vec<ServoShadowRoot> { pub fn shadow_roots(&self) -> Vec<ServoShadowRoot> {

View file

@ -375,7 +375,7 @@ impl<'ld> ServoLayoutDocument<'ld> {
} }
pub fn style_shared_lock(&self) -> &StyleSharedRwLock { pub fn style_shared_lock(&self) -> &StyleSharedRwLock {
unsafe { self.document.style_shared_lock() } self.document.style_shared_lock()
} }
pub fn shadow_roots(&self) -> Vec<ServoShadowRoot> { pub fn shadow_roots(&self) -> Vec<ServoShadowRoot> {

View file

@ -2610,7 +2610,7 @@ pub trait LayoutDocumentHelpers<'dom> {
unsafe fn needs_paint_from_layout(self); unsafe fn needs_paint_from_layout(self);
unsafe fn will_paint(self); unsafe fn will_paint(self);
fn quirks_mode(self) -> QuirksMode; fn quirks_mode(self) -> QuirksMode;
unsafe fn style_shared_lock(self) -> &'dom StyleSharedRwLock; fn style_shared_lock(self) -> &'dom StyleSharedRwLock;
fn shadow_roots(self) -> Vec<LayoutDom<'dom, ShadowRoot>>; fn shadow_roots(self) -> Vec<LayoutDom<'dom, ShadowRoot>>;
fn shadow_roots_styles_changed(self) -> bool; fn shadow_roots_styles_changed(self) -> bool;
unsafe fn flush_shadow_roots_stylesheets(self); unsafe fn flush_shadow_roots_stylesheets(self);
@ -2639,8 +2639,8 @@ impl<'dom> LayoutDocumentHelpers<'dom> for LayoutDom<'dom, Document> {
} }
#[inline] #[inline]
unsafe fn style_shared_lock(self) -> &'dom StyleSharedRwLock { fn style_shared_lock(self) -> &'dom StyleSharedRwLock {
(*self.unsafe_get()).style_shared_lock() unsafe { self.unsafe_get().style_shared_lock() }
} }
#[inline] #[inline]