Remove LoadConsumer, LoadResponse, ProgressMsg.

This commit is contained in:
Ms2ger 2016-12-13 17:27:58 +01:00
parent cd40bb54ae
commit 6bea1b53e6

View file

@ -245,12 +245,6 @@ impl<T: BluetoothResponseListener> Action<T> for BluetoothResponseResult {
}
}
/// A wrapper for a network load that can either be channel or event-based.
#[derive(Deserialize, Serialize)]
pub enum LoadConsumer {
Channel(IpcSender<LoadResponse>),
}
/// Handle to a resource thread
pub type CoreResourceThread = IpcSender<CoreResourceMsg>;
@ -401,19 +395,6 @@ pub fn fetch_async<F>(request: RequestInit,
core_resource_thread.send(CoreResourceMsg::Fetch(request, action_sender)).unwrap();
}
/// Message sent in response to `Load`. Contains metadata, and a port
/// for receiving the data.
///
/// Even if loading fails immediately, we send one of these and the
/// progress_port will provide the error.
#[derive(Serialize, Deserialize)]
pub struct LoadResponse {
/// Metadata, such as from HTTP headers.
pub metadata: Metadata,
/// Port for reading data.
pub progress_port: IpcReceiver<ProgressMsg>,
}
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
pub struct ResourceCorsData {
/// CORS Preflight flag
@ -499,15 +480,6 @@ pub enum CookieSource {
NonHTTP,
}
/// Messages sent in response to a `Load` message
#[derive(PartialEq, Debug, Deserialize, Serialize)]
pub enum ProgressMsg {
/// Binary data - there may be multiple of these
Payload(Vec<u8>),
/// Indicates loading is complete, either successfully or not
Done(Result<(), NetworkError>),
}
/// Convenience function for synchronously loading a whole resource.
pub fn load_whole_resource(request: RequestInit,
core_resource_thread: &CoreResourceThread)