mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Prefetch img and scripts during parsing
This commit is contained in:
parent
5bcb1b579c
commit
1aeb97b281
8 changed files with 351 additions and 45 deletions
|
@ -237,6 +237,18 @@ impl FetchTaskTarget for IpcSender<FetchResponseMsg> {
|
|||
}
|
||||
}
|
||||
|
||||
impl FetchTaskTarget for () {
|
||||
fn process_request_body(&mut self, _: &Request) {}
|
||||
|
||||
fn process_request_eof(&mut self, _: &Request) {}
|
||||
|
||||
fn process_response(&mut self, _: &Response) {}
|
||||
|
||||
fn process_response_chunk(&mut self, _: Vec<u8>) {}
|
||||
|
||||
fn process_response_eof(&mut self, _: &Response) {}
|
||||
}
|
||||
|
||||
pub trait Action<Listener> {
|
||||
fn process(self, listener: &mut Listener);
|
||||
}
|
||||
|
@ -368,6 +380,9 @@ pub enum FetchChannels {
|
|||
event_sender: IpcSender<WebSocketNetworkEvent>,
|
||||
action_receiver: IpcReceiver<WebSocketDomAction>,
|
||||
},
|
||||
/// If the fetch is just being done to populate the cache,
|
||||
/// not because the data is needed now.
|
||||
Prefetch,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue