mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Wrap SharedLayoutContext::font_cache_task in a Mutex.
This commit is contained in:
parent
11e760d582
commit
552a03fde6
2 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -455,7 +455,7 @@ impl LayoutTask {
|
|||
image_cache_sender: Mutex::new(self.image_cache_sender.clone()),
|
||||
viewport_size: rw_data.viewport_size.clone(),
|
||||
screen_size_changed: screen_size_changed,
|
||||
font_cache_task: self.font_cache_task.clone(),
|
||||
font_cache_task: Mutex::new(self.font_cache_task.clone()),
|
||||
canvas_layers_sender: self.canvas_layers_sender.clone(),
|
||||
stylist: &*rw_data.stylist,
|
||||
url: (*url).clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue