mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #13571 - servo:simplify-fetching, r=nox
Simplify fetching code. <!-- 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/13571) <!-- Reviewable:end -->
This commit is contained in:
commit
b80769dbf5
5 changed files with 48 additions and 114 deletions
|
@ -96,7 +96,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, PendingAsyncLoad};
|
||||
use net_traits::{AsyncResponseTarget, FetchResponseMsg, IpcSend};
|
||||
use net_traits::CookieSource::NonHTTP;
|
||||
use net_traits::CoreResourceMsg::{GetCookiesForUrl, SetCookiesForUrl};
|
||||
use net_traits::request::RequestInit;
|
||||
|
@ -1423,17 +1423,6 @@ impl Document {
|
|||
ReflowReason::RequestAnimationFrame);
|
||||
}
|
||||
|
||||
/// Add a load to the list of loads blocking this document's load.
|
||||
pub fn add_blocking_load(&self, load: LoadType) {
|
||||
let mut loader = self.loader.borrow_mut();
|
||||
loader.add_blocking_load(load)
|
||||
}
|
||||
|
||||
pub fn prepare_async_load(&self, load: LoadType, referrer_policy: Option<ReferrerPolicy>) -> PendingAsyncLoad {
|
||||
let mut loader = self.loader.borrow_mut();
|
||||
loader.prepare_async_load(load, self, referrer_policy)
|
||||
}
|
||||
|
||||
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);
|
||||
|
@ -1441,10 +1430,9 @@ impl Document {
|
|||
|
||||
pub fn fetch_async(&self, load: LoadType,
|
||||
request: RequestInit,
|
||||
fetch_target: IpcSender<FetchResponseMsg>,
|
||||
referrer_policy: Option<ReferrerPolicy>) {
|
||||
fetch_target: IpcSender<FetchResponseMsg>) {
|
||||
let mut loader = self.loader.borrow_mut();
|
||||
loader.fetch_async(load, request, fetch_target, self, referrer_policy);
|
||||
loader.fetch_async(load, request, fetch_target);
|
||||
}
|
||||
|
||||
pub fn finish_load(&self, load: LoadType) {
|
||||
|
|
|
@ -269,7 +269,7 @@ fn fetch_a_classic_script(script: &HTMLScriptElement,
|
|||
ROUTER.add_route(action_receiver.to_opaque(), box move |message| {
|
||||
listener.notify_fetch(message.to().unwrap());
|
||||
});
|
||||
doc.fetch_async(LoadType::Script(url), request, action_sender, None);
|
||||
doc.fetch_async(LoadType::Script(url), request, action_sender);
|
||||
}
|
||||
|
||||
impl HTMLScriptElement {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue