diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs index 2c8a0470c3d..d34184fee2a 100644 --- a/components/net/http_loader.rs +++ b/components/net/http_loader.rs @@ -350,13 +350,13 @@ fn update_sts_list_from_response(url: &Url, response: &HttpResponse, resource_mg } } -pub struct LoadResponse { +pub struct StreamedResponse { decoder: Decoder, pub metadata: Metadata } -impl Read for LoadResponse { +impl Read for StreamedResponse { #[inline] fn read(&mut self, buf: &mut [u8]) -> io::Result { match self.decoder { @@ -367,18 +367,18 @@ impl Read for LoadResponse { } } -impl LoadResponse { - fn new(m: Metadata, d: Decoder) -> LoadResponse { - LoadResponse { metadata: m, decoder: d } +impl StreamedResponse { + fn new(m: Metadata, d: Decoder) -> StreamedResponse { + StreamedResponse { metadata: m, decoder: d } } - fn from_http_response(response: R, m: Metadata) -> Result, LoadError> { + fn from_http_response(response: R, m: Metadata) -> Result, LoadError> { match response.content_encoding() { Some(Encoding::Gzip) => { let result = GzDecoder::new(response); match result { Ok(response_decoding) => { - return Ok(LoadResponse::new(m, Decoder::Gzip(response_decoding))); + return Ok(StreamedResponse::new(m, Decoder::Gzip(response_decoding))); } Err(err) => { return Err(LoadError::Decoding(m.final_url, err.to_string())); @@ -387,10 +387,10 @@ impl LoadResponse { } Some(Encoding::Deflate) => { let response_decoding = DeflateDecoder::new(response); - return Ok(LoadResponse::new(m, Decoder::Deflate(response_decoding))); + return Ok(StreamedResponse::new(m, Decoder::Deflate(response_decoding))); } _ => { - return Ok(LoadResponse::new(m, Decoder::Plain(response))); + return Ok(StreamedResponse::new(m, Decoder::Plain(response))); } } } @@ -432,7 +432,7 @@ pub fn load(load_data: LoadData, resource_mgr_chan: IpcSender, devtools_chan: Option>, request_factory: &HttpRequestFactory) - -> Result, LoadError> where A: HttpRequest + 'static { + -> Result, LoadError> where A: HttpRequest + 'static { // FIXME: At the time of writing this FIXME, servo didn't have any central // location for configuration. If you're reading this and such a // repository DOES exist, please update this constant to use it. @@ -626,7 +626,7 @@ pub fn load(load_data: LoadData, metadata.headers.clone(), metadata.status.clone() ); - return LoadResponse::from_http_response(response, metadata) + return StreamedResponse::from_http_response(response, metadata) } }