diff options
Diffstat (limited to 'components/net')
-rw-r--r-- | components/net/blob_loader.rs | 2 | ||||
-rw-r--r-- | components/net/connector.rs | 4 | ||||
-rw-r--r-- | components/net/cookie.rs | 2 | ||||
-rw-r--r-- | components/net/cookie_storage.rs | 4 | ||||
-rw-r--r-- | components/net/fetch/methods.rs | 14 | ||||
-rw-r--r-- | components/net/http_cache.rs | 2 | ||||
-rw-r--r-- | components/net/http_loader.rs | 18 | ||||
-rw-r--r-- | components/net/lib.rs | 4 | ||||
-rw-r--r-- | components/net/resource_thread.rs | 24 | ||||
-rw-r--r-- | components/net/storage_thread.rs | 2 | ||||
-rw-r--r-- | components/net/tests/cookie.rs | 2 | ||||
-rw-r--r-- | components/net/tests/data_loader.rs | 2 | ||||
-rw-r--r-- | components/net/tests/fetch.rs | 8 | ||||
-rw-r--r-- | components/net/tests/filemanager_thread.rs | 2 | ||||
-rw-r--r-- | components/net/tests/http_loader.rs | 15 | ||||
-rw-r--r-- | components/net/tests/resource_thread.rs | 2 | ||||
-rw-r--r-- | components/net/websocket_loader.rs | 10 |
17 files changed, 59 insertions, 58 deletions
diff --git a/components/net/blob_loader.rs b/components/net/blob_loader.rs index c041123bc18..94e35ee4782 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; +use crate::filemanager_thread::FileManager; use headers_core::HeaderMapExt; use headers_ext::{ContentLength, ContentType}; use http::HeaderMap; diff --git a/components/net/connector.rs b/components/net/connector.rs index c8eb10a1fe2..e347862d2c9 100644 --- a/components/net/connector.rs +++ b/components/net/connector.rs @@ -2,9 +2,9 @@ * 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 crate::hosts::replace_host; +use crate::http_loader::Decoder; use flate2::read::GzDecoder; -use hosts::replace_host; -use http_loader::Decoder; use hyper::{Body, Client}; use hyper::body::Payload; use hyper::client::HttpConnector as HyperHttpConnector; diff --git a/components/net/cookie.rs b/components/net/cookie.rs index dadc78cf14f..d7d68196d4a 100644 --- a/components/net/cookie.rs +++ b/components/net/cookie.rs @@ -5,7 +5,7 @@ //! Implementation of cookie creation and matching as specified by //! http://tools.ietf.org/html/rfc6265 -use cookie_rs; +use crate::cookie_rs; use hyper_serde::{self, Serde}; use net_traits::CookieSource; use net_traits::pub_domains::is_pub_domain; diff --git a/components/net/cookie_storage.rs b/components/net/cookie_storage.rs index af06e876ddf..8959b6d97ac 100644 --- a/components/net/cookie_storage.rs +++ b/components/net/cookie_storage.rs @@ -5,8 +5,8 @@ //! Implementation of cookie storage as specified in //! http://tools.ietf.org/html/rfc6265 -use cookie::Cookie; -use cookie_rs; +use crate::cookie::Cookie; +use crate::cookie_rs; use net_traits::CookieSource; use net_traits::pub_domains::reg_suffix; use servo_url::ServoUrl; diff --git a/components/net/fetch/methods.rs b/components/net/fetch/methods.rs index d9fdebf895f..823046d6cfa 100644 --- a/components/net/fetch/methods.rs +++ b/components/net/fetch/methods.rs @@ -2,16 +2,16 @@ * 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 blob_loader::load_blob_sync; -use data_loader::decode; +use crate::blob_loader::load_blob_sync; +use crate::data_loader::decode; use devtools_traits::DevtoolsControlMsg; -use fetch::cors_cache::CorsCache; -use filemanager_thread::FileManager; +use crate::fetch::cors_cache::CorsCache; +use crate::filemanager_thread::FileManager; +use crate::http_loader::{HttpState, determine_request_referrer, http_fetch}; +use crate::http_loader::{set_default_accept, set_default_accept_language}; use headers_core::HeaderMapExt; use headers_ext::{AccessControlExposeHeaders, ContentType, Range}; use http::header::{self, HeaderMap, HeaderName, HeaderValue}; -use http_loader::{HttpState, determine_request_referrer, http_fetch}; -use http_loader::{set_default_accept, set_default_accept_language}; use hyper::Method; use hyper::StatusCode; use ipc_channel::ipc::IpcReceiver; @@ -32,7 +32,7 @@ use std::str; use std::sync::{Arc, Mutex}; use std::sync::atomic::Ordering; use std::thread; -use subresource_integrity::is_response_integrity_valid; +use crate::subresource_integrity::is_response_integrity_valid; lazy_static! { static ref X_CONTENT_TYPE_OPTIONS: HeaderName = diff --git a/components/net/http_cache.rs b/components/net/http_cache.rs index f9466523852..b234389d69b 100644 --- a/components/net/http_cache.rs +++ b/components/net/http_cache.rs @@ -7,7 +7,7 @@ //! A memory cache implementing the logic specified in <http://tools.ietf.org/html/rfc7234> //! and <http://tools.ietf.org/html/rfc7232>. -use fetch::methods::{Data, DoneChannel}; +use crate::fetch::methods::{Data, DoneChannel}; use headers_core::HeaderMapExt; use headers_ext::{CacheControl, ContentRange, Expires, LastModified, Pragma, Range, Vary}; use http::{header, HeaderMap}; diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs index e7077f7df0e..3b47a21c4cc 100644 --- a/components/net/http_loader.rs +++ b/components/net/http_loader.rs @@ -4,26 +4,26 @@ use brotli::Decompressor; use bytes::Bytes; -use connector::{BUF_SIZE, Connector, create_http_client, WrappedBody}; -use cookie; -use cookie_storage::CookieStorage; +use crate::connector::{BUF_SIZE, Connector, create_http_client, WrappedBody}; +use crate::cookie; +use crate::cookie_storage::CookieStorage; use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg, HttpRequest as DevtoolsHttpRequest}; use devtools_traits::{HttpResponse as DevtoolsHttpResponse, NetworkEvent}; -use fetch::cors_cache::CorsCache; -use fetch::methods::{Data, DoneChannel, FetchContext, Target}; -use fetch::methods::{is_cors_safelisted_request_header, is_cors_safelisted_method, main_fetch}; +use crate::fetch::cors_cache::CorsCache; +use crate::fetch::methods::{Data, DoneChannel, FetchContext, Target}; +use crate::fetch::methods::{is_cors_safelisted_request_header, is_cors_safelisted_method, main_fetch}; use flate2::read::{DeflateDecoder, GzDecoder}; +use crate::hsts::HstsList; +use crate::http_cache::HttpCache; use headers_core::HeaderMapExt; use headers_ext::{AccessControlAllowCredentials, AccessControlAllowHeaders}; use headers_ext::{AccessControlAllowMethods, AccessControlRequestHeaders, AccessControlRequestMethod, Authorization}; use headers_ext::{AccessControlAllowOrigin, AccessControlMaxAge, Basic}; use headers_ext::{CacheControl, ContentEncoding, ContentLength}; use headers_ext::{Host, IfModifiedSince, LastModified, Origin as HyperOrigin, Pragma, Referer, UserAgent}; -use hsts::HstsList; use http::{HeaderMap, Request as HyperRequest}; use http::header::{self, HeaderName, HeaderValue}; use http::uri::Authority; -use http_cache::HttpCache; use hyper::{Body, Client, Method, StatusCode, Response as HyperResponse}; use hyper_serde::Serde; use log; @@ -36,7 +36,7 @@ use net_traits::request::{RedirectMode, Referrer, Request, RequestMode}; use net_traits::request::{ResponseTainting, ServiceWorkersMode}; use net_traits::response::{HttpsState, Response, ResponseBody, ResponseType}; use openssl::ssl::SslConnectorBuilder; -use resource_thread::AuthCache; +use crate::resource_thread::AuthCache; use servo_channel::{channel, Sender}; use servo_url::{ImmutableOrigin, ServoUrl}; use std::collections::{HashMap, HashSet}; diff --git a/components/net/lib.rs b/components/net/lib.rs index 7f9714df07e..9fbb9415ab6 100644 --- a/components/net/lib.rs +++ b/components/net/lib.rs @@ -76,6 +76,6 @@ pub mod fetch { /// A module for re-exports of items used in unit tests. pub mod test { - pub use http_loader::HttpState; - pub use hosts::{replace_host_table, parse_hostsfile}; + pub use crate::http_loader::HttpState; + pub use crate::hosts::{replace_host_table, parse_hostsfile}; } diff --git a/components/net/resource_thread.rs b/components/net/resource_thread.rs index 8c0a1652778..7e11859828c 100644 --- a/components/net/resource_thread.rs +++ b/components/net/resource_thread.rs @@ -3,19 +3,19 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ //! A thread that takes a URL and streams back the binary data. -use connector::{create_http_client, create_ssl_connector_builder}; -use cookie; -use cookie_rs; -use cookie_storage::CookieStorage; +use crate::connector::{create_http_client, create_ssl_connector_builder}; +use crate::cookie; +use crate::cookie_rs; +use crate::cookie_storage::CookieStorage; use devtools_traits::DevtoolsControlMsg; use embedder_traits::EmbedderProxy; use embedder_traits::resources::{self, Resource}; -use fetch::cors_cache::CorsCache; -use fetch::methods::{CancellationListener, FetchContext, fetch}; -use filemanager_thread::FileManager; -use hsts::HstsList; -use http_cache::HttpCache; -use http_loader::{HANDLE, HttpState, http_redirect_fetch}; +use crate::fetch::cors_cache::CorsCache; +use crate::fetch::methods::{CancellationListener, FetchContext, fetch}; +use crate::filemanager_thread::FileManager; +use crate::hsts::HstsList; +use crate::http_cache::HttpCache; +use crate::http_loader::{HANDLE, HttpState, http_redirect_fetch}; use hyper_serde::Serde; use ipc_channel::ipc::{self, IpcReceiver, IpcReceiverSet, IpcSender}; use malloc_size_of::{MallocSizeOf, MallocSizeOfOps}; @@ -44,8 +44,8 @@ use std::ops::Deref; use std::path::{Path, PathBuf}; use std::sync::{Arc, Mutex, RwLock}; use std::thread; -use storage_thread::StorageThreadFactory; -use websocket_loader; +use crate::storage_thread::StorageThreadFactory; +use crate::websocket_loader; /// Returns a tuple of (public, private) senders to the new threads. pub fn new_resource_threads( diff --git a/components/net/storage_thread.rs b/components/net/storage_thread.rs index ec5503046ad..b901c717931 100644 --- a/components/net/storage_thread.rs +++ b/components/net/storage_thread.rs @@ -4,7 +4,7 @@ use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use net_traits::storage_thread::{StorageThreadMsg, StorageType}; -use resource_thread; +use crate::resource_thread; use servo_url::ServoUrl; use std::borrow::ToOwned; use std::collections::BTreeMap; diff --git a/components/net/tests/cookie.rs b/components/net/tests/cookie.rs index 219b2979aa9..9cf9aa3ac14 100644 --- a/components/net/tests/cookie.rs +++ b/components/net/tests/cookie.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 cookie_rs; +use crate::cookie_rs; use net::cookie::Cookie; use net::cookie_storage::CookieStorage; use net_traits::CookieSource; diff --git a/components/net/tests/data_loader.rs b/components/net/tests/data_loader.rs index cc8bfd69b38..5ab5c68943f 100644 --- a/components/net/tests/data_loader.rs +++ b/components/net/tests/data_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 fetch; +use crate::fetch; use headers_core::HeaderMapExt; use headers_ext::ContentType; use hyper_serde::Serde; diff --git a/components/net/tests/fetch.rs b/components/net/tests/fetch.rs index f89ed8170ba..bd24b873352 100644 --- a/components/net/tests/fetch.rs +++ b/components/net/tests/fetch.rs @@ -2,11 +2,11 @@ * 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 {DEFAULT_USER_AGENT, new_fetch_context, create_embedder_proxy, fetch, make_server, make_ssl_server}; +use crate::{DEFAULT_USER_AGENT, new_fetch_context, create_embedder_proxy, fetch, make_server, make_ssl_server}; use devtools_traits::HttpRequest as DevtoolsHttpRequest; use devtools_traits::HttpResponse as DevtoolsHttpResponse; -use fetch_with_context; -use fetch_with_cors_cache; +use crate::fetch_with_context; +use crate::fetch_with_cors_cache; use headers_core::HeaderMapExt; use headers_ext::{AccessControlAllowCredentials, AccessControlAllowHeaders, AccessControlAllowOrigin}; use headers_ext::{AccessControlAllowMethods, AccessControlMaxAge}; @@ -14,7 +14,7 @@ use headers_ext::{CacheControl, ContentLength, ContentType, Expires, Host, LastM use http::{Method, StatusCode}; use http::header::{self, HeaderMap, HeaderName, HeaderValue}; use http::uri::Authority; -use http_loader::{expect_devtools_http_request, expect_devtools_http_response}; +use crate::http_loader::{expect_devtools_http_request, expect_devtools_http_response}; use hyper::{Request as HyperRequest, Response as HyperResponse}; use hyper::body::Body; use mime::{self, Mime}; diff --git a/components/net/tests/filemanager_thread.rs b/components/net/tests/filemanager_thread.rs index 2320fa41a2f..35634cad815 100644 --- a/components/net/tests/filemanager_thread.rs +++ b/components/net/tests/filemanager_thread.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 create_embedder_proxy; +use crate::create_embedder_proxy; use embedder_traits::FilterPattern; use ipc_channel::ipc; use net::filemanager_thread::FileManager; diff --git a/components/net/tests/http_loader.rs b/components/net/tests/http_loader.rs index c0bdc57b357..25ed6f0e094 100644 --- a/components/net/tests/http_loader.rs +++ b/components/net/tests/http_loader.rs @@ -2,12 +2,12 @@ * 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 cookie_rs::Cookie as CookiePair; +use crate::cookie_rs::Cookie as CookiePair; use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg, NetworkEvent}; use devtools_traits::HttpRequest as DevtoolsHttpRequest; use devtools_traits::HttpResponse as DevtoolsHttpResponse; -use fetch; -use fetch_with_context; +use crate::fetch; +use crate::fetch_with_context; use flate2::Compression; use flate2::write::{DeflateEncoder, GzEncoder}; use futures::{self, Future, Stream}; @@ -19,7 +19,7 @@ use http::header::{self, HeaderMap, HeaderValue}; use http::uri::Authority; use hyper::{Request as HyperRequest, Response as HyperResponse}; use hyper::body::Body; -use make_server; +use crate::make_server; use msg::constellation_msg::TEST_PIPELINE_ID; use net::cookie::Cookie; use net::cookie_storage::CookieStorage; @@ -28,7 +28,7 @@ use net::test::replace_host_table; use net_traits::{CookieSource, NetworkError}; use net_traits::request::{Request, RequestInit, RequestMode, CredentialsMode, Destination}; use net_traits::response::ResponseBody; -use new_fetch_context; +use crate::new_fetch_context; use servo_channel::{channel, Receiver}; use servo_url::{ServoUrl, ImmutableOrigin}; use std::collections::HashMap; @@ -128,7 +128,7 @@ fn test_check_default_headers_loaded_in_every_request() { HeaderValue::from_static("en-US, en; q=0.5"), ); - headers.typed_insert::<UserAgent>(::DEFAULT_USER_AGENT.parse().unwrap()); + headers.typed_insert::<UserAgent>(crate::DEFAULT_USER_AGENT.parse().unwrap()); *expected_headers.lock().unwrap() = Some(headers.clone()); @@ -275,7 +275,8 @@ fn test_request_and_response_data_with_network_messages() { header::ACCEPT_LANGUAGE, HeaderValue::from_static("en-US, en; q=0.5"), ); - headers.typed_insert::<UserAgent>(::DEFAULT_USER_AGENT.parse().unwrap()); + + headers.typed_insert::<UserAgent>(crate::DEFAULT_USER_AGENT.parse().unwrap()); let httprequest = DevtoolsHttpRequest { url: url, diff --git a/components/net/tests/resource_thread.rs b/components/net/tests/resource_thread.rs index d9f09270f21..b33e28942fa 100644 --- a/components/net/tests/resource_thread.rs +++ b/components/net/tests/resource_thread.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 create_embedder_proxy; +use crate::create_embedder_proxy; use ipc_channel::ipc; use net::resource_thread::new_core_resource_thread; use net::test::parse_hostsfile; diff --git a/components/net/websocket_loader.rs b/components/net/websocket_loader.rs index 963874684b2..0dc0632d7ed 100644 --- a/components/net/websocket_loader.rs +++ b/components/net/websocket_loader.rs @@ -2,15 +2,15 @@ * 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 connector::create_ssl_connector_builder; -use cookie::Cookie; +use crate::connector::create_ssl_connector_builder; +use crate::cookie::Cookie; use embedder_traits::resources::{self, Resource}; -use fetch::methods::should_be_blocked_due_to_bad_port; +use crate::fetch::methods::should_be_blocked_due_to_bad_port; use headers_ext::Host; -use hosts::replace_host; +use crate::hosts::replace_host; +use crate::http_loader::HttpState; use http::header::{self, HeaderMap, HeaderName, HeaderValue}; use http::uri::Authority; -use http_loader::HttpState; use ipc_channel::ipc::{IpcReceiver, IpcSender}; use net_traits::{CookieSource, MessageData}; use net_traits::{WebSocketDomAction, WebSocketNetworkEvent}; |