mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Enable optional mime sniffing, and integrate it with the file loader.
This commit is contained in:
parent
2d730f2ae9
commit
a3201bc1ac
8 changed files with 102 additions and 152 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
use net_traits::{LoadData, Metadata};
|
||||
use net_traits::ProgressMsg::Done;
|
||||
use mime_classifier::MIMEClassifier;
|
||||
use resource_task::start_sending;
|
||||
use file_loader;
|
||||
|
||||
|
@ -13,8 +14,9 @@ use util::resource_files::resources_dir_path;
|
|||
|
||||
use std::borrow::IntoCow;
|
||||
use std::fs::PathExt;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub fn factory(mut load_data: LoadData) {
|
||||
pub fn factory(mut load_data: LoadData, classifier: Arc<MIMEClassifier>) {
|
||||
match load_data.url.non_relative_scheme_data().unwrap() {
|
||||
"blank" => {
|
||||
let start_chan = load_data.consumer;
|
||||
|
@ -42,5 +44,5 @@ pub fn factory(mut load_data: LoadData) {
|
|||
return
|
||||
}
|
||||
};
|
||||
file_loader::factory(load_data)
|
||||
file_loader::factory(load_data, classifier)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue