diff options
author | Ms2ger <Ms2ger@gmail.com> | 2015-11-06 23:01:18 +0100 |
---|---|---|
committer | Ms2ger <Ms2ger@gmail.com> | 2015-11-07 11:23:44 +0100 |
commit | 552a03fde66b5869d77892d52da4f2a3df3f4cdf (patch) | |
tree | 188f7f0b3e18a5c633081ed1fef3288913e6c419 /components/layout/context.rs | |
parent | 11e760d582a1302651b9eb5f8ad277ce7ec72a9d (diff) | |
download | servo-552a03fde66b5869d77892d52da4f2a3df3f4cdf.tar.gz servo-552a03fde66b5869d77892d52da4f2a3df3f4cdf.zip |
Wrap SharedLayoutContext::font_cache_task in a Mutex.
Diffstat (limited to 'components/layout/context.rs')
-rw-r--r-- | components/layout/context.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/layout/context.rs b/components/layout/context.rs index e7e0ab070b8..5a7bbdfed8f 100644 --- a/components/layout/context.rs +++ b/components/layout/context.rs @@ -62,8 +62,9 @@ fn create_or_get_local_context(shared_layout_context: &SharedLayoutContext) } context } else { + let font_cache_task = shared_layout_context.font_cache_task.lock().unwrap().clone(); let context = Rc::new(LocalLayoutContext { - font_context: RefCell::new(FontContext::new(shared_layout_context.font_cache_task.clone())), + font_context: RefCell::new(FontContext::new(font_cache_task)), applicable_declarations_cache: RefCell::new(ApplicableDeclarationsCache::new()), style_sharing_candidate_cache: RefCell::new(StyleSharingCandidateCache::new()), }); @@ -88,7 +89,7 @@ pub struct SharedLayoutContext { pub screen_size_changed: bool, /// Interface to the font cache task. - pub font_cache_task: FontCacheTask, + pub font_cache_task: Mutex<FontCacheTask>, /// The CSS selector stylist. /// @@ -121,7 +122,6 @@ pub struct SharedLayoutContext { // FIXME(#6569) This implementations is unsound: // XXX UNSOUND!!! for image_cache_task -// XXX UNSOUND!!! for font_cache_task // XXX UNSOUND!!! for stylist // XXX UNSOUND!!! for new_animations_sender // XXX UNSOUND!!! for canvas_layers_sender |