Redirect document loads manually

This commit is contained in:
Nikhil Shagrithaya 2017-02-01 13:45:35 +05:30
parent 779edd7c4a
commit 541baafe1c
17 changed files with 376 additions and 52 deletions

View file

@ -42,7 +42,7 @@ use ipc_channel::Error as IpcError;
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use request::{Request, RequestInit};
use response::{HttpsState, Response};
use response::{HttpsState, Response, ResponseInit};
use servo_url::ServoUrl;
use std::error::Error;
use storage_thread::StorageThreadMsg;
@ -369,6 +369,8 @@ pub struct WebSocketConnectData {
#[derive(Deserialize, Serialize)]
pub enum CoreResourceMsg {
Fetch(RequestInit, IpcSender<FetchResponseMsg>),
/// Initiate a fetch in response to processing a redirection
FetchRedirect(RequestInit, ResponseInit, IpcSender<FetchResponseMsg>),
/// Try to make a websocket connection to a URL.
WebsocketConnect(WebSocketCommunicate, WebSocketConnectData),
/// Store a cookie for a given originating URL
@ -435,6 +437,9 @@ pub struct Metadata {
/// Referrer Url
pub referrer: Option<ServoUrl>,
/// Referrer Policy of the Request used to obtain Response
pub referrer_policy: Option<ReferrerPolicy>,
}
impl Metadata {
@ -449,6 +454,7 @@ impl Metadata {
status: Some((200, b"OK".to_vec())),
https_state: HttpsState::None,
referrer: None,
referrer_policy: None,
}
}