aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/document_loader.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-11-17 15:34:47 -0600
committerGitHub <noreply@github.com>2016-11-17 15:34:47 -0600
commit22aebdf5d41a3509cd6515ccf5edcdf33715a76d (patch)
tree824af410d147404d0a6dc0908cec85cc71df5bfd /components/script/document_loader.rs
parentb3ad71353bf264770bf0b3a87b32d86928eb09d4 (diff)
parent913c874cb55fd0fdc9e8f3a4c34624cd015fac8a (diff)
downloadservo-22aebdf5d41a3509cd6515ccf5edcdf33715a76d.tar.gz
servo-22aebdf5d41a3509cd6515ccf5edcdf33715a76d.zip
Auto merge of #14246 - emilio:servo-url, r=SimonSapin
Urlmageddon <!-- Please describe your changes on the following line: --> Still needs a bunch of code in net to be converted in order to get more advantage of this for images and stuff, but meanwhile this should help quite a bit with #13778. Still wanted to get this in. r? @SimonSapin <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14246) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/document_loader.rs')
-rw-r--r--components/script/document_loader.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/components/script/document_loader.rs b/components/script/document_loader.rs
index 04b9e258573..30d83019c5f 100644
--- a/components/script/document_loader.rs
+++ b/components/script/document_loader.rs
@@ -10,21 +10,21 @@ use dom::document::Document;
use ipc_channel::ipc::IpcSender;
use net_traits::{CoreResourceMsg, FetchResponseMsg, ResourceThreads, IpcSend};
use net_traits::request::RequestInit;
+use servo_url::ServoUrl;
use std::thread;
-use url::Url;
#[derive(JSTraceable, PartialEq, Clone, Debug, HeapSizeOf)]
pub enum LoadType {
- Image(Url),
- Script(Url),
- Subframe(Url),
- Stylesheet(Url),
- PageSource(Url),
- Media(Url),
+ Image(ServoUrl),
+ Script(ServoUrl),
+ Subframe(ServoUrl),
+ Stylesheet(ServoUrl),
+ PageSource(ServoUrl),
+ Media(ServoUrl),
}
impl LoadType {
- fn url(&self) -> &Url {
+ fn url(&self) -> &ServoUrl {
match *self {
LoadType::Image(ref url) |
LoadType::Script(ref url) |
@@ -67,7 +67,7 @@ impl LoadBlocker {
}
/// Return the url associated with this load.
- pub fn url(&self) -> Option<&Url> {
+ pub fn url(&self) -> Option<&ServoUrl> {
self.load.as_ref().map(LoadType::url)
}
}
@@ -93,7 +93,7 @@ impl DocumentLoader {
}
pub fn new_with_threads(resource_threads: ResourceThreads,
- initial_load: Option<Url>) -> DocumentLoader {
+ initial_load: Option<ServoUrl>) -> DocumentLoader {
debug!("Initial blocking load {:?}.", initial_load);
let initial_loads = initial_load.into_iter().map(LoadType::PageSource).collect();