Cleanup Window, XHR

This commit is contained in:
Manish Goregaokar 2015-08-15 05:09:00 +05:30
parent ac1b7a3896
commit 5c4f91c0f1
3 changed files with 15 additions and 17 deletions

View file

@ -269,19 +269,19 @@ impl Window {
(box SendableMainThreadScriptChan(tx), box rx)
}
pub fn image_cache_task<'a>(&'a self) -> &'a ImageCacheTask {
pub fn image_cache_task(&self) -> &ImageCacheTask {
&self.image_cache_task
}
pub fn compositor<'a>(&'a self) -> &'a IpcSender<ScriptToCompositorMsg> {
pub fn compositor(&self) -> &IpcSender<ScriptToCompositorMsg> {
&self.compositor
}
pub fn browsing_context<'a>(&'a self) -> Ref<'a, Option<BrowsingContext>> {
pub fn browsing_context(&self) -> Ref<Option<BrowsingContext>> {
self.browsing_context.borrow()
}
pub fn page<'a>(&'a self) -> &'a Page {
pub fn page(&self) -> &Page {
&*self.page
}

View file

@ -784,8 +784,8 @@ impl<'a> PrivateXMLHttpRequestHelpers for &'a XMLHttpRequest {
fn process_headers_available(self, cors_request: Option<CORSRequest>,
gen_id: GenerationId, metadata: Metadata) -> Result<(), Error> {
match cors_request {
Some(ref req) => {
if let Some(ref req) = cors_request {
match metadata.headers {
Some(ref h) if allow_cross_origin_request(req, h) => {},
_ => {
@ -793,10 +793,8 @@ impl<'a> PrivateXMLHttpRequestHelpers for &'a XMLHttpRequest {
return Err(Network);
}
}
},
}
_ => {}
};
// XXXManishearth Clear cache entries in case of a network error
self.process_partial_response(XHRProgress::HeadersReceived(gen_id,
metadata.headers,

View file

@ -28,7 +28,7 @@ impl XMLHttpRequestEventTarget {
}
#[inline]
pub fn eventtarget<'a>(&'a self) -> &'a EventTarget {
pub fn eventtarget(&self) -> &EventTarget {
&self.eventtarget
}
}