From 51625d7d062ca9144087cbd5527e097a5a7d2d16 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Fri, 3 Apr 2015 11:37:13 +0530 Subject: [PATCH] Fix gonk net_traits dependencies Issue #4476 --- ports/gonk/Cargo.lock | 28 ++++++++++++++++++++++------ ports/gonk/Cargo.toml | 3 +++ ports/gonk/src/lib.rs | 18 +++++++++++------- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock index 8fad18d177c..649f09aaf20 100644 --- a/ports/gonk/Cargo.lock +++ b/ports/gonk/Cargo.lock @@ -13,6 +13,7 @@ dependencies = [ "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "net 0.0.1", + "net_traits 0.0.1", "profile 0.0.1", "script 0.0.1", "script_traits 0.0.1", @@ -83,6 +84,7 @@ dependencies = [ "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "net 0.0.1", + "net_traits 0.0.1", "png 0.1.0 (git+https://github.com/servo/rust-png)", "profile 0.0.1", "script_traits 0.0.1", @@ -298,7 +300,7 @@ dependencies = [ "layers 0.1.0 (git+https://github.com/servo/rust-layers)", "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", - "net 0.0.1", + "net_traits 0.0.1", "plugins 0.0.1", "png 0.1.0 (git+https://github.com/servo/rust-png)", "profile 0.0.1", @@ -457,7 +459,7 @@ dependencies = [ "layout_traits 0.0.1", "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", - "net 0.0.1", + "net_traits 0.0.1", "plugins 0.0.1", "png 0.1.0 (git+https://github.com/servo/rust-png)", "profile 0.0.1", @@ -478,7 +480,7 @@ version = "0.0.1" dependencies = [ "gfx 0.0.1", "msg 0.0.1", - "net 0.0.1", + "net_traits 0.0.1", "profile 0.0.1", "script_traits 0.0.1", "url 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", @@ -569,18 +571,31 @@ dependencies = [ "flate2 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)", "hyper 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "net_traits 0.0.1", "openssl 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "png 0.1.0 (git+https://github.com/servo/rust-png)", "profile 0.0.1", "regex 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", "regex_macros 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)", "time 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", ] +[[package]] +name = "net_traits" +version = "0.0.1" +dependencies = [ + "geom 0.1.0 (git+https://github.com/servo/rust-geom)", + "hyper 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "png 0.1.0 (git+https://github.com/servo/rust-png)", + "profile 0.0.1", + "stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)", + "url 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", + "util 0.0.1", +] + [[package]] name = "openssl" version = "0.5.1" @@ -715,7 +730,7 @@ dependencies = [ "js 0.1.0 (git+https://github.com/servo/rust-mozjs)", "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", - "net 0.0.1", + "net_traits 0.0.1", "plugins 0.0.1", "profile 0.0.1", "rustc-serialize 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -738,7 +753,7 @@ dependencies = [ "geom 0.1.0 (git+https://github.com/servo/rust-geom)", "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", - "net 0.0.1", + "net_traits 0.0.1", "url 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", ] @@ -766,6 +781,7 @@ dependencies = [ "layout 0.0.1", "msg 0.0.1", "net 0.0.1", + "net_traits 0.0.1", "png 0.1.0 (git+https://github.com/servo/rust-png)", "profile 0.0.1", "script 0.0.1", diff --git a/ports/gonk/Cargo.toml b/ports/gonk/Cargo.toml index 6ecee4c3928..5ed55793d43 100644 --- a/ports/gonk/Cargo.toml +++ b/ports/gonk/Cargo.toml @@ -26,6 +26,9 @@ path = "../../components/script_traits" [dependencies.net] path = "../../components/net" +[dependencies.net_traits] +path = "../../components/net_traits" + [dependencies.gfx] path = "../../components/gfx" diff --git a/ports/gonk/src/lib.rs b/ports/gonk/src/lib.rs index ca01f431ae0..0cf0694a8c8 100644 --- a/ports/gonk/src/lib.rs +++ b/ports/gonk/src/lib.rs @@ -15,6 +15,7 @@ extern crate log; extern crate compositing; extern crate devtools; extern crate net; +extern crate net_traits; extern crate msg; #[macro_use] extern crate util; @@ -38,10 +39,12 @@ use msg::constellation_msg::ConstellationChan; use script::dom::bindings::codegen::RegisterBindings; #[cfg(not(test))] -use net::image_cache_task::{ImageCacheTask, LoadPlaceholder}; +use net::image_cache_task::{ImageCacheTaskFactory, LoadPlaceholder}; #[cfg(not(test))] use net::storage_task::StorageTaskFactory; #[cfg(not(test))] +use net_traits::image_cache_task::ImageCacheTask; +#[cfg(not(test))] use net::resource_task::new_resource_task; #[cfg(not(test))] use gfx::font_cache_task::FontCacheTask; @@ -87,13 +90,14 @@ impl Browser { // If we are emitting an output file, then we need to block on // image load or we risk emitting an output file missing the // image. - let image_cache_task = if opts.output_file.is_some() { - ImageCacheTask::new_sync(resource_task.clone(), shared_task_pool, - time_profiler_chan.clone(), LoadPlaceholder::Preload) + let image_cache_task: ImageCacheTask = if opts.output_file.is_some() { + ImageCacheTaskFactory::new_sync(resource_task.clone(), shared_task_pool, + time_profiler_chan.clone(), LoadPlaceholder::Preload) } else { - ImageCacheTask::new(resource_task.clone(), shared_task_pool, - time_profiler_chan.clone(), LoadPlaceholder::Preload) - }; + ImageCacheTaskFactory::new(resource_task.clone(), shared_task_pool, + time_profiler_chan.clone(), LoadPlaceholder::Preload) + }; + let font_cache_task = FontCacheTask::new(resource_task.clone()); let storage_task = StorageTaskFactory::new(); let constellation_chan = Constellation::