Remove unused content blocker code.

I don't know what it is for, so I believe it would be better to remove it
entirely until and unless we start using it.
This commit is contained in:
Ms2ger 2017-03-07 10:29:09 +01:00
parent e3cc2dd283
commit 5a61d8b2ea
7 changed files with 0 additions and 118 deletions

View file

@ -11,7 +11,6 @@ path = "lib.rs"
[dependencies]
brotli = "1.0.6"
content-blocker = "0.2.3"
cookie = "0.2.5"
devtools_traits = {path = "../devtools_traits"}
flate2 = "0.2.0"
@ -19,7 +18,6 @@ hyper = "0.9.9"
hyper_serde = "0.5"
immeta = "0.3.1"
ipc-channel = "0.7"
lazy_static = "0.2"
log = "0.3.5"
matches = "0.1"
mime = "0.2.1"

View file

@ -1,31 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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 content_blocker_parser::{RuleList, parse_list};
use servo_config::resource_files::read_resource_file;
use std::str;
use std::sync::Arc;
lazy_static! {
pub static ref BLOCKED_CONTENT_RULES: Arc<Option<RuleList>> = Arc::new(create_rule_list());
}
fn create_rule_list() -> Option<RuleList> {
let contents = match read_resource_file("blocked-content.json") {
Ok(c) => c,
Err(_) => return None,
};
let str_contents = match str::from_utf8(&contents) {
Ok(c) => c,
Err(_) => return None,
};
let list = match parse_list(&str_contents) {
Ok(l) => l,
Err(_) => return None,
};
Some(list)
}

View file

@ -4,7 +4,6 @@
use brotli::Decompressor;
use connector::{Connector, create_http_connector};
use content_blocker_parser::RuleList;
use cookie;
use cookie_storage::CookieStorage;
use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg, HttpRequest as DevtoolsHttpRequest};
@ -70,7 +69,6 @@ pub struct HttpState {
pub hsts_list: Arc<RwLock<HstsList>>,
pub cookie_jar: Arc<RwLock<CookieStorage>>,
pub auth_cache: Arc<RwLock<AuthCache>>,
pub blocked_content: Arc<Option<RuleList>>,
pub connector_pool: Arc<Pool<Connector>>,
}
@ -80,7 +78,6 @@ impl HttpState {
hsts_list: Arc::new(RwLock::new(HstsList::new())),
cookie_jar: Arc::new(RwLock::new(CookieStorage::new(150))),
auth_cache: Arc::new(RwLock::new(AuthCache::new())),
blocked_content: Arc::new(None),
connector_pool: create_http_connector(certificate_path),
}
}

View file

@ -7,7 +7,6 @@
#![feature(mpsc_select)]
extern crate brotli;
extern crate content_blocker as content_blocker_parser;
extern crate cookie as cookie_rs;
extern crate devtools_traits;
extern crate flate2;
@ -15,7 +14,6 @@ extern crate hyper;
extern crate hyper_serde;
extern crate immeta;
extern crate ipc_channel;
#[macro_use] extern crate lazy_static;
#[macro_use] extern crate log;
#[macro_use] #[no_link] extern crate matches;
#[macro_use]
@ -46,7 +44,6 @@ extern crate websocket;
mod blob_loader;
mod chrome_loader;
mod connector;
mod content_blocker;
pub mod cookie;
pub mod cookie_storage;
mod data_loader;

View file

@ -4,7 +4,6 @@
//! A thread that takes a URL and streams back the binary data.
use connector::{Connector, create_http_connector};
use content_blocker::BLOCKED_CONTENT_RULES;
use cookie;
use cookie_rs;
use cookie_storage::CookieStorage;
@ -324,7 +323,6 @@ impl CoreResourceManager {
hsts_list: group.hsts_list.clone(),
cookie_jar: group.cookie_jar.clone(),
auth_cache: group.auth_cache.clone(),
blocked_content: BLOCKED_CONTENT_RULES.clone(),
// FIXME(#15694): use group.connector.clone() instead.
connector_pool: create_http_connector("certs"),
};