aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/blob_loader.rs
diff options
context:
space:
mode:
authorMs2ger <Ms2ger@gmail.com>2016-11-18 13:09:23 +0100
committerMs2ger <Ms2ger@gmail.com>2016-11-21 10:37:26 +0100
commitae1340bf506eeef71c026e3da10b010eca59d379 (patch)
tree2fd2c6e4bf6603e0afd5094dbb098cd6307089f5 /components/net/blob_loader.rs
parentf672bf9eabdfcf2eca4305c577599900fbb77ea9 (diff)
downloadservo-ae1340bf506eeef71c026e3da10b010eca59d379.tar.gz
servo-ae1340bf506eeef71c026e3da10b010eca59d379.zip
Pass the UIProvider to FileManager::handle() as needed.
Diffstat (limited to 'components/net/blob_loader.rs')
-rw-r--r--components/net/blob_loader.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/components/net/blob_loader.rs b/components/net/blob_loader.rs
index 35aa34ac978..6bd5ff4c23f 100644
--- a/components/net/blob_loader.rs
+++ b/components/net/blob_loader.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/. */
-use filemanager_thread::{FileManager, UIProvider};
+use filemanager_thread::FileManager;
use hyper::header::{Charset, ContentLength, ContentType, Headers};
use hyper::header::{ContentDisposition, DispositionParam, DispositionType};
use hyper_serde::Serde;
@@ -24,7 +24,7 @@ use util::thread::spawn_named;
// TODO: Check on GET
// https://w3c.github.io/FileAPI/#requestResponseModel
-pub fn factory<UI: 'static + UIProvider>(filemanager: FileManager<UI>)
+pub fn factory(filemanager: FileManager)
-> Box<FnBox(LoadData, LoadConsumer, Arc<MimeClassifier>, CancellationListener) + Send> {
box move |load_data: LoadData, start_chan, classifier, cancel_listener| {
spawn_named(format!("blob loader for {}", load_data.url), move || {
@@ -33,10 +33,9 @@ pub fn factory<UI: 'static + UIProvider>(filemanager: FileManager<UI>)
}
}
-fn load_blob<UI: 'static + UIProvider>
- (load_data: LoadData, start_chan: LoadConsumer,
+fn load_blob(load_data: LoadData, start_chan: LoadConsumer,
classifier: Arc<MimeClassifier>,
- filemanager: FileManager<UI>,
+ filemanager: FileManager,
cancel_listener: CancellationListener) {
let (chan, recv) = ipc::channel().unwrap();
if let Ok((id, origin, _fragment)) = parse_blob_url(&load_data.url.clone()) {
@@ -122,9 +121,9 @@ fn load_blob<UI: 'static + UIProvider>
/// https://fetch.spec.whatwg.org/#concept-basic-fetch (partial)
// TODO: make async.
-pub fn load_blob_sync<UI: 'static + UIProvider>
+pub fn load_blob_sync
(url: ServoUrl,
- filemanager: FileManager<UI>)
+ filemanager: FileManager)
-> Result<(Headers, Vec<u8>), NetworkError> {
let (id, origin) = match parse_blob_url(&url) {
Ok((id, origin, _fragment)) => (id, origin),