Skip to content

Commit

Permalink
Move image cache implementation to the net crate
Browse files Browse the repository at this point in the history
  • Loading branch information
ferjm committed Mar 27, 2017
1 parent 72d7ee6 commit 166c4e8
Show file tree
Hide file tree
Showing 11 changed files with 580 additions and 534 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions components/constellation/Cargo.toml
Expand Up @@ -24,6 +24,7 @@ ipc-channel = "0.7"
layout_traits = {path = "../layout_traits"}
log = "0.3.5"
msg = {path = "../msg"}
net = {path = "../net"}
net_traits = {path = "../net_traits"}
offscreen_gl_context = "0.8"
profile_traits = {path = "../profile_traits"}
Expand Down
1 change: 1 addition & 0 deletions components/constellation/lib.rs
Expand Up @@ -24,6 +24,7 @@ extern crate layout_traits;
#[macro_use]
extern crate log;
extern crate msg;
extern crate net;
extern crate net_traits;
extern crate offscreen_gl_context;
extern crate profile_traits;
Expand Down
4 changes: 3 additions & 1 deletion components/constellation/pipeline.rs
Expand Up @@ -16,6 +16,7 @@ use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use layout_traits::LayoutThreadFactory;
use msg::constellation_msg::{FrameId, FrameType, PipelineId, PipelineNamespaceId};
use net::image_cache::ImageCacheImpl;
use net_traits::{IpcSend, ResourceThreads};
use net_traits::image_cache::ImageCache;
use profile_traits::mem as profile_mem;
Expand All @@ -34,6 +35,7 @@ use std::env;
use std::ffi::OsStr;
use std::process;
use std::rc::Rc;
use std::sync::Arc;
use std::sync::mpsc::Sender;
use style_traits::CSSPixel;
use webrender_traits;
Expand Down Expand Up @@ -472,7 +474,7 @@ impl UnprivilegedPipelineContent {
where LTF: LayoutThreadFactory<Message=Message>,
STF: ScriptThreadFactory<Message=Message>
{
let image_cache = ImageCache::new(self.webrender_api_sender.create_api());
let image_cache = Arc::new(ImageCacheImpl::new(self.webrender_api_sender.create_api()));
let layout_pair = STF::create(InitialScriptState {
id: self.id,
frame_id: self.frame_id,
Expand Down
2 changes: 1 addition & 1 deletion components/layout_traits/lib.rs
Expand Up @@ -48,4 +48,4 @@ pub trait LayoutThreadFactory {
content_process_shutdown_chan: Option<IpcSender<()>>,
webrender_api_sender: webrender_traits::RenderApiSender,
layout_threads: usize);
}
}

0 comments on commit 166c4e8

Please sign in to comment.