Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some unused support for the legacy network stack in script. #13741

Merged
merged 2 commits into from Oct 13, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Remove Document::load_async.

  • Loading branch information
Ms2ger committed Oct 13, 2016
commit 7b905a5590c08a7703cfb8b8ab14e9cb78c61187
@@ -8,9 +8,8 @@
use dom::bindings::js::JS;
use dom::document::Document;
use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::{PipelineId, ReferrerPolicy};
use net_traits::{AsyncResponseTarget, CoreResourceMsg, load_async};
use net_traits::{FetchResponseMsg, LoadContext, ResourceThreads, IpcSend};
use msg::constellation_msg::PipelineId;
use net_traits::{CoreResourceMsg, FetchResponseMsg, ResourceThreads, IpcSend};
use net_traits::request::RequestInit;
use std::thread;
use url::Url;
@@ -36,20 +35,10 @@ impl LoadType {
LoadType::PageSource(ref url) => url,
}
}

fn to_load_context(&self) -> LoadContext {
match *self {
LoadType::Image(_) => LoadContext::Image,
LoadType::Script(_) => LoadContext::Script,
LoadType::Subframe(_) | LoadType::PageSource(_) => LoadContext::Browsing,
LoadType::Stylesheet(_) => LoadContext::Style,
LoadType::Media(_) => LoadContext::AudioVideo,
}
}
}

/// Canary value ensuring that manually added blocking loads (ie. ones that weren't
/// created via DocumentLoader::{load_async, fetch_async}) are always removed by the time
/// created via DocumentLoader::fetch_async) are always removed by the time
/// that the owner is destroyed.
#[derive(JSTraceable, HeapSizeOf)]
#[must_root]
@@ -123,24 +112,6 @@ impl DocumentLoader {
self.blocking_loads.push(load);
}

/// Create and initiate a new network request.
pub fn load_async(&mut self,
load: LoadType,
listener: AsyncResponseTarget,
referrer: &Document,
referrer_policy: Option<ReferrerPolicy>) {
let context = load.to_load_context();
let url = load.url().clone();
self.add_blocking_load(load);
load_async(context,
self.resource_threads.sender(),
url,
self.pipeline,
referrer_policy.or(referrer.get_referrer_policy()),
Some(referrer.url().clone()),
listener);
}

/// Initiate a new fetch.
pub fn fetch_async(&mut self,
load: LoadType,
@@ -97,7 +97,7 @@ use js::jsapi::JS_GetRuntime;
use msg::constellation_msg::{ALT, CONTROL, SHIFT, SUPER};
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
use msg::constellation_msg::{PipelineId, ReferrerPolicy};
use net_traits::{AsyncResponseTarget, FetchResponseMsg, IpcSend};
use net_traits::{FetchResponseMsg, IpcSend};
use net_traits::CookieSource::NonHTTP;
use net_traits::CoreResourceMsg::{GetCookiesForUrl, SetCookiesForUrl};
use net_traits::request::RequestInit;
@@ -1472,11 +1472,6 @@ impl Document {
ReflowReason::RequestAnimationFrame);
}

pub fn load_async(&self, load: LoadType, listener: AsyncResponseTarget, referrer_policy: Option<ReferrerPolicy>) {
let mut loader = self.loader.borrow_mut();
loader.load_async(load, listener, self, referrer_policy);
}

pub fn fetch_async(&self, load: LoadType,
request: RequestInit,
fetch_target: IpcSender<FetchResponseMsg>) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.