mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Remove unused CancellationListener argument to obtain_response.
This commit is contained in:
parent
fb1279ec3a
commit
ffc2e09ea7
2 changed files with 2 additions and 12 deletions
|
@ -28,7 +28,6 @@ use net_traits::request::{CacheMode, CredentialsMode, Destination};
|
||||||
use net_traits::request::{RedirectMode, Referrer, Request, RequestMode, ResponseTainting};
|
use net_traits::request::{RedirectMode, Referrer, Request, RequestMode, ResponseTainting};
|
||||||
use net_traits::request::{Type, Origin, Window};
|
use net_traits::request::{Type, Origin, Window};
|
||||||
use net_traits::response::{HttpsState, Response, ResponseBody, ResponseType};
|
use net_traits::response::{HttpsState, Response, ResponseBody, ResponseType};
|
||||||
use resource_thread::CancellationListener;
|
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
@ -992,7 +991,6 @@ fn http_network_fetch(request: Rc<Request>,
|
||||||
connector: connection,
|
connector: connection,
|
||||||
};
|
};
|
||||||
let url = request.current_url();
|
let url = request.current_url();
|
||||||
let cancellation_listener = CancellationListener::new(None);
|
|
||||||
|
|
||||||
let request_id = context.devtools_chan.as_ref().map(|_| {
|
let request_id = context.devtools_chan.as_ref().map(|_| {
|
||||||
uuid::Uuid::new_v4().simple().to_string()
|
uuid::Uuid::new_v4().simple().to_string()
|
||||||
|
@ -1004,7 +1002,7 @@ fn http_network_fetch(request: Rc<Request>,
|
||||||
let is_xhr = request.destination == Destination::None;
|
let is_xhr = request.destination == Destination::None;
|
||||||
let wrapped_response = obtain_response(&factory, &url, &request.method.borrow(),
|
let wrapped_response = obtain_response(&factory, &url, &request.method.borrow(),
|
||||||
&request.headers.borrow(),
|
&request.headers.borrow(),
|
||||||
&cancellation_listener, &request.body.borrow(), &request.method.borrow(),
|
&request.body.borrow(), &request.method.borrow(),
|
||||||
&request.pipeline_id.get(), request.redirect_count.get() + 1,
|
&request.pipeline_id.get(), request.redirect_count.get() + 1,
|
||||||
request_id.as_ref().map(Deref::deref), is_xhr);
|
request_id.as_ref().map(Deref::deref), is_xhr);
|
||||||
|
|
||||||
|
@ -1015,7 +1013,6 @@ fn http_network_fetch(request: Rc<Request>,
|
||||||
let error = match error.error {
|
let error = match error.error {
|
||||||
LoadErrorType::ConnectionAborted { .. } => unreachable!(),
|
LoadErrorType::ConnectionAborted { .. } => unreachable!(),
|
||||||
LoadErrorType::Ssl { reason } => NetworkError::SslValidation(error.url, reason),
|
LoadErrorType::Ssl { reason } => NetworkError::SslValidation(error.url, reason),
|
||||||
LoadErrorType::Cancelled => NetworkError::LoadCancelled,
|
|
||||||
e => NetworkError::Internal(e.description().to_owned())
|
e => NetworkError::Internal(e.description().to_owned())
|
||||||
};
|
};
|
||||||
return Response::network_error(error);
|
return Response::network_error(error);
|
||||||
|
|
|
@ -27,7 +27,7 @@ use net_traits::{CookieSource, Metadata, ReferrerPolicy};
|
||||||
use net_traits::hosts::replace_hosts;
|
use net_traits::hosts::replace_hosts;
|
||||||
use openssl;
|
use openssl;
|
||||||
use openssl::ssl::error::{OpensslError, SslError};
|
use openssl::ssl::error::{OpensslError, SslError};
|
||||||
use resource_thread::{AuthCache, CancellationListener};
|
use resource_thread::AuthCache;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
@ -240,7 +240,6 @@ impl LoadError {
|
||||||
|
|
||||||
#[derive(Eq, PartialEq, Debug)]
|
#[derive(Eq, PartialEq, Debug)]
|
||||||
pub enum LoadErrorType {
|
pub enum LoadErrorType {
|
||||||
Cancelled,
|
|
||||||
Connection { reason: String },
|
Connection { reason: String },
|
||||||
ConnectionAborted { reason: String },
|
ConnectionAborted { reason: String },
|
||||||
Decoding { reason: String },
|
Decoding { reason: String },
|
||||||
|
@ -256,7 +255,6 @@ impl fmt::Display for LoadErrorType {
|
||||||
impl Error for LoadErrorType {
|
impl Error for LoadErrorType {
|
||||||
fn description(&self) -> &str {
|
fn description(&self) -> &str {
|
||||||
match *self {
|
match *self {
|
||||||
LoadErrorType::Cancelled => "load cancelled",
|
|
||||||
LoadErrorType::Connection { ref reason } => reason,
|
LoadErrorType::Connection { ref reason } => reason,
|
||||||
LoadErrorType::ConnectionAborted { ref reason } => reason,
|
LoadErrorType::ConnectionAborted { ref reason } => reason,
|
||||||
LoadErrorType::Decoding { ref reason } => reason,
|
LoadErrorType::Decoding { ref reason } => reason,
|
||||||
|
@ -511,7 +509,6 @@ pub fn obtain_response<A>(request_factory: &HttpRequestFactory<R=A>,
|
||||||
url: &ServoUrl,
|
url: &ServoUrl,
|
||||||
method: &Method,
|
method: &Method,
|
||||||
request_headers: &Headers,
|
request_headers: &Headers,
|
||||||
cancel_listener: &CancellationListener,
|
|
||||||
data: &Option<Vec<u8>>,
|
data: &Option<Vec<u8>>,
|
||||||
load_data_method: &Method,
|
load_data_method: &Method,
|
||||||
pipeline_id: &Option<PipelineId>,
|
pipeline_id: &Option<PipelineId>,
|
||||||
|
@ -569,10 +566,6 @@ pub fn obtain_response<A>(request_factory: &HttpRequestFactory<R=A>,
|
||||||
|
|
||||||
let connect_end = precise_time_ms();
|
let connect_end = precise_time_ms();
|
||||||
|
|
||||||
if cancel_listener.is_cancelled() {
|
|
||||||
return Err(LoadError::new(connection_url.clone(), LoadErrorType::Cancelled));
|
|
||||||
}
|
|
||||||
|
|
||||||
let send_start = precise_time_ms();
|
let send_start = precise_time_ms();
|
||||||
|
|
||||||
let maybe_response = req.send(request_body);
|
let maybe_response = req.send(request_body);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue