aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/cssimportrule.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2017-03-17 16:46:22 +0100
committerSimon Sapin <simon.sapin@exyr.org>2017-03-19 22:30:36 +0100
commitadb97d4cbefde92b3645619d826ce175a787a069 (patch)
treec202ff995b70d7fd4f8feac0a009a7b839c460ba /components/script/dom/cssimportrule.rs
parentf35b4e27b3e0b748e10662cfb6f18873258483b7 (diff)
downloadservo-adb97d4cbefde92b3645619d826ce175a787a069.tar.gz
servo-adb97d4cbefde92b3645619d826ce175a787a069.zip
Wrap most CSS rules in Locked<_> instead of RwLock<_>
Diffstat (limited to 'components/script/dom/cssimportrule.rs')
-rw-r--r--components/script/dom/cssimportrule.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/components/script/dom/cssimportrule.rs b/components/script/dom/cssimportrule.rs
index bb01fdfcc84..3c0eb7eb4aa 100644
--- a/components/script/dom/cssimportrule.rs
+++ b/components/script/dom/cssimportrule.rs
@@ -10,21 +10,20 @@ use dom::cssrule::{CSSRule, SpecificCSSRule};
use dom::cssstylesheet::CSSStyleSheet;
use dom::window::Window;
use dom_struct::dom_struct;
-use parking_lot::RwLock;
use std::sync::Arc;
-use style::shared_lock::ToCssWithGuard;
+use style::shared_lock::{Locked, ToCssWithGuard};
use style::stylesheets::ImportRule;
#[dom_struct]
pub struct CSSImportRule {
cssrule: CSSRule,
#[ignore_heap_size_of = "Arc"]
- import_rule: Arc<RwLock<ImportRule>>,
+ import_rule: Arc<Locked<ImportRule>>,
}
impl CSSImportRule {
fn new_inherited(parent_stylesheet: &CSSStyleSheet,
- import_rule: Arc<RwLock<ImportRule>>)
+ import_rule: Arc<Locked<ImportRule>>)
-> Self {
CSSImportRule {
cssrule: CSSRule::new_inherited(parent_stylesheet),
@@ -35,7 +34,7 @@ impl CSSImportRule {
#[allow(unrooted_must_root)]
pub fn new(window: &Window,
parent_stylesheet: &CSSStyleSheet,
- import_rule: Arc<RwLock<ImportRule>>) -> Root<Self> {
+ import_rule: Arc<Locked<ImportRule>>) -> Root<Self> {
reflect_dom_object(box Self::new_inherited(parent_stylesheet, import_rule),
window,
CSSImportRuleBinding::Wrap)
@@ -50,6 +49,6 @@ impl SpecificCSSRule for CSSImportRule {
fn get_css(&self) -> DOMString {
let guard = self.cssrule.shared_lock().read();
- self.import_rule.read().to_css_string(&guard).into()
+ self.import_rule.read_with(&guard).to_css_string(&guard).into()
}
}