Cleanup script_task

This commit is contained in:
Manish Goregaokar 2015-08-15 04:45:12 +05:30
parent f749881eea
commit 94cd004c28

View file

@ -267,7 +267,7 @@ pub struct SendableMainThreadScriptChan(pub Sender<CommonScriptMsg>);
impl ScriptChan for SendableMainThreadScriptChan { impl ScriptChan for SendableMainThreadScriptChan {
fn send(&self, msg: CommonScriptMsg) -> Result<(), ()> { fn send(&self, msg: CommonScriptMsg) -> Result<(), ()> {
let SendableMainThreadScriptChan(ref chan) = *self; let SendableMainThreadScriptChan(ref chan) = *self;
return chan.send(msg).map_err(|_| ()); chan.send(msg).map_err(|_| ())
} }
fn clone(&self) -> Box<ScriptChan + Send> { fn clone(&self) -> Box<ScriptChan + Send> {
@ -550,7 +550,7 @@ unsafe extern "C" fn debug_gc_callback(_rt: *mut JSRuntime, status: JSGCStatus,
unsafe extern "C" fn shadow_check_callback(_cx: *mut JSContext, unsafe extern "C" fn shadow_check_callback(_cx: *mut JSContext,
_object: HandleObject, _id: HandleId) -> DOMProxyShadowsResult { _object: HandleObject, _id: HandleId) -> DOMProxyShadowsResult {
// XXX implement me // XXX implement me
return DOMProxyShadowsResult::ShadowCheckFailed; DOMProxyShadowsResult::ShadowCheckFailed
} }
impl ScriptTask { impl ScriptTask {
@ -1062,7 +1062,7 @@ impl ScriptTask {
return ScriptState::DocumentLoading; return ScriptState::DocumentLoading;
} }
return ScriptState::DocumentLoaded; ScriptState::DocumentLoaded
} }
fn handle_new_layout(&self, new_layout_info: NewLayoutInfo) { fn handle_new_layout(&self, new_layout_info: NewLayoutInfo) {
@ -1406,7 +1406,7 @@ impl ScriptTask {
if let Some(ref mut child_page) = page.remove(id) { if let Some(ref mut child_page) = page.remove(id) {
shut_down_layout(&*child_page, exit_type); shut_down_layout(&*child_page, exit_type);
} }
return false; false
} }
/// Handles when layout task finishes all animation in one tick /// Handles when layout task finishes all animation in one tick
@ -1550,7 +1550,7 @@ impl ScriptTask {
DocumentSource::FromParser, DocumentSource::FromParser,
loader); loader);
let frame_element = frame_element.r().map(|elem| ElementCast::from_ref(elem)); let frame_element = frame_element.r().map(ElementCast::from_ref);
window.r().init_browsing_context(document.r(), frame_element); window.r().init_browsing_context(document.r(), frame_element);
// Create the root frame // Create the root frame