aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Ramine <nox@nox.paris>2020-04-01 00:22:22 +0200
committerAnthony Ramine <nox@nox.paris>2020-04-01 11:40:55 +0200
commit0c0027ecfdf380f6813d03a270428b62d42434e5 (patch)
tree82ee78e0d9ffdec24345321990f9ede0e63d3f08
parent4636507fa1f218d4c0d858089946b3e6f9b9aabc (diff)
downloadservo-0c0027ecfdf380f6813d03a270428b62d42434e5.tar.gz
servo-0c0027ecfdf380f6813d03a270428b62d42434e5.zip
Make LayoutDocumentHelpers::style_shared_lock be safe
StyleSharedRwLock is Sync.
-rw-r--r--components/layout_thread/dom_wrapper.rs2
-rw-r--r--components/layout_thread_2020/dom_wrapper.rs2
-rw-r--r--components/script/dom/document.rs6
3 files changed, 5 insertions, 5 deletions
diff --git a/components/layout_thread/dom_wrapper.rs b/components/layout_thread/dom_wrapper.rs
index 5c9cf183053..db8d0ffc36d 100644
--- a/components/layout_thread/dom_wrapper.rs
+++ b/components/layout_thread/dom_wrapper.rs
@@ -368,7 +368,7 @@ impl<'ld> ServoLayoutDocument<'ld> {
}
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> {
diff --git a/components/layout_thread_2020/dom_wrapper.rs b/components/layout_thread_2020/dom_wrapper.rs
index 0e527bd75d9..bd187482ee5 100644
--- a/components/layout_thread_2020/dom_wrapper.rs
+++ b/components/layout_thread_2020/dom_wrapper.rs
@@ -375,7 +375,7 @@ impl<'ld> ServoLayoutDocument<'ld> {
}
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> {
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index c3c64babfef..afaf0a5292b 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -2610,7 +2610,7 @@ pub trait LayoutDocumentHelpers<'dom> {
unsafe fn needs_paint_from_layout(self);
unsafe fn will_paint(self);
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_styles_changed(self) -> bool;
unsafe fn flush_shadow_roots_stylesheets(self);
@@ -2639,8 +2639,8 @@ impl<'dom> LayoutDocumentHelpers<'dom> for LayoutDom<'dom, Document> {
}
#[inline]
- unsafe fn style_shared_lock(self) -> &'dom StyleSharedRwLock {
- (*self.unsafe_get()).style_shared_lock()
+ fn style_shared_lock(self) -> &'dom StyleSharedRwLock {
+ unsafe { self.unsafe_get().style_shared_lock() }
}
#[inline]