diff options
author | rohan.prinja <rohan.prinja@samsung.com> | 2015-11-14 05:07:55 +0900 |
---|---|---|
committer | Rohan Prinja <rohan.prinja@gmail.com> | 2016-01-10 17:58:13 +0900 |
commit | 1f02c4ebbb7d5ea49051f4391f1418f20c15d7a9 (patch) | |
tree | 7d61e58e746ddca93074ca6bca6849360a098b8c /components/layout/context.rs | |
parent | f00532bab0382d1c24e6086314f26497fb6ffe0f (diff) | |
download | servo-1f02c4ebbb7d5ea49051f4391f1418f20c15d7a9.tar.gz servo-1f02c4ebbb7d5ea49051f4391f1418f20c15d7a9.zip |
task -> thread
Diffstat (limited to 'components/layout/context.rs')
-rw-r--r-- | components/layout/context.rs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/components/layout/context.rs b/components/layout/context.rs index 43c51147934..7c245408a23 100644 --- a/components/layout/context.rs +++ b/components/layout/context.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -//! Data needed by the layout task. +//! Data needed by the layout thread. #![deny(unsafe_code)] @@ -10,13 +10,13 @@ use app_units::Au; use canvas_traits::CanvasMsg; use euclid::Rect; use fnv::FnvHasher; -use gfx::font_cache_task::FontCacheTask; +use gfx::font_cache_thread::FontCacheThread; use gfx::font_context::FontContext; use gfx_traits::LayerId; use ipc_channel::ipc::{self, IpcSender}; use net_traits::image::base::Image; -use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask, ImageResponse, ImageState}; -use net_traits::image_cache_task::{UsePlaceholder}; +use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread, ImageResponse, ImageState}; +use net_traits::image_cache_thread::{UsePlaceholder}; use std::cell::{RefCell, RefMut}; use std::collections::HashMap; use std::collections::hash_state::DefaultState; @@ -59,13 +59,13 @@ 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 font_cache_thread = shared_layout_context.font_cache_thread.lock().unwrap().clone(); let context = Rc::new(LocalLayoutContext { style_context: LocalStyleContext { applicable_declarations_cache: RefCell::new(ApplicableDeclarationsCache::new()), style_sharing_candidate_cache: RefCell::new(StyleSharingCandidateCache::new()), }, - font_context: RefCell::new(FontContext::new(font_cache_task)), + font_context: RefCell::new(FontContext::new(font_cache_thread)), }); *r = Some(context.clone()); context @@ -78,19 +78,19 @@ pub struct SharedLayoutContext { /// Bits shared by the layout and style system. pub style_context: SharedStyleContext, - /// The shared image cache task. - pub image_cache_task: ImageCacheTask, + /// The shared image cache thread. + pub image_cache_thread: ImageCacheThread, /// A channel for the image cache to send responses to. pub image_cache_sender: Mutex<ImageCacheChan>, - /// Interface to the font cache task. - pub font_cache_task: Mutex<FontCacheTask>, + /// Interface to the font cache thread. + pub font_cache_thread: Mutex<FontCacheThread>, /// The URL. pub url: Url, - /// A channel to send canvas renderers to paint task, in order to correctly paint the layers + /// A channel to send canvas renderers to paint thread, in order to correctly paint the layers pub canvas_layers_sender: Mutex<Sender<(LayerId, IpcSender<CanvasMsg>)>>, /// The visible rects for each layer, as reported to us by the compositor. @@ -131,7 +131,7 @@ impl<'a> LayoutContext<'a> { pub fn get_or_request_image(&self, url: Url, use_placeholder: UsePlaceholder) -> Option<Arc<Image>> { // See if the image is already available - let result = self.shared.image_cache_task.find_image(url.clone(), + let result = self.shared.image_cache_thread.find_image(url.clone(), use_placeholder); match result { @@ -148,7 +148,7 @@ impl<'a> LayoutContext<'a> { // Not loaded, test mode - load the image synchronously (_, true) => { let (sync_tx, sync_rx) = ipc::channel().unwrap(); - self.shared.image_cache_task.request_image(url, + self.shared.image_cache_thread.request_image(url, ImageCacheChan(sync_tx), None); match sync_rx.recv().unwrap().image_response { @@ -160,7 +160,7 @@ impl<'a> LayoutContext<'a> { // Not yet requested, async mode - request image from the cache (ImageState::NotRequested, false) => { let sender = self.shared.image_cache_sender.lock().unwrap().clone(); - self.shared.image_cache_task.request_image(url, sender, None); + self.shared.image_cache_thread.request_image(url, sender, None); None } // Image has been requested, is still pending. Return no image |