aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbors-servo <release+servo@mozilla.com>2013-10-01 23:54:50 -0700
committerbors-servo <release+servo@mozilla.com>2013-10-01 23:54:50 -0700
commit096af85834e25d86487e82851331d93374782eac (patch)
tree5328d6b8d7b67e7fd2a58e9c714d17a323913295 /src
parentbe5deb2a680524b7f802d20bb058175b3853489b (diff)
parent499935b77e8bc9e6a1f23fad985543cdbd72ff75 (diff)
downloadservo-096af85834e25d86487e82851331d93374782eac.tar.gz
servo-096af85834e25d86487e82851331d93374782eac.zip
auto merge of #1005 : jdm/servo/failfixes, r=metajack
Fixes #1004. I haven't seen the other ones be reported, but I saw often saw `task <unnamed> failed at 'RenderChan.send: render port closed', /home/jdm/sdb/servo/src/components/gfx/render_task.rs:76`, `task <unnamed> failed at 'receiving on closed channel', /home/jdm/sdb/servo/src/compiler/rust/src/libstd/rt/comm.rs:487`, and failed assertions due to layout running after we had begun tearing down the window.
Diffstat (limited to 'src')
-rw-r--r--src/components/main/constellation.rs2
-rw-r--r--src/components/main/pipeline.rs2
-rw-r--r--src/components/script/dom/bindings/codegen/CodegenRust.py2
-rw-r--r--src/components/script/dom/bindings/utils.rs15
-rw-r--r--src/components/script/script_task.rs4
5 files changed, 16 insertions, 9 deletions
diff --git a/src/components/main/constellation.rs b/src/components/main/constellation.rs
index 2b8c24c1da3..a7e06dd4a17 100644
--- a/src/components/main/constellation.rs
+++ b/src/components/main/constellation.rs
@@ -801,7 +801,7 @@ impl Constellation {
fn set_ids(&self, frame_tree: @mut FrameTree) {
let (port, chan) = comm::stream();
self.compositor_chan.send(SetIds(frame_tree.to_sendable(), chan, self.chan.clone()));
- port.recv();
+ port.try_recv();
for frame in frame_tree.iter() {
frame.pipeline.grant_paint_permission();
}
diff --git a/src/components/main/pipeline.rs b/src/components/main/pipeline.rs
index 4e7f7c066cf..1f7dbb8eef9 100644
--- a/src/components/main/pipeline.rs
+++ b/src/components/main/pipeline.rs
@@ -200,7 +200,7 @@ impl Pipeline {
}
pub fn grant_paint_permission(&self) {
- self.render_chan.send(PaintPermissionGranted);
+ self.render_chan.try_send(PaintPermissionGranted);
}
pub fn revoke_paint_permission(&self) {
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py
index 4c28883ab13..13a03c91c08 100644
--- a/src/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/src/components/script/dom/bindings/codegen/CodegenRust.py
@@ -4027,7 +4027,7 @@ def finalizeHook(descriptor, hookName, context):
pass
else:
assert descriptor.nativeIsISupports
- release = """let val = JS_GetReservedSlot(obj, 0);
+ release = """let val = JS_GetReservedSlot(obj, dom_object_slot(obj));
let _: @mut %s = cast::transmute(RUST_JSVAL_TO_PRIVATE(val));
debug!("%s finalize: %%p", this);
""" % (descriptor.concreteType, descriptor.concreteType)
diff --git a/src/components/script/dom/bindings/utils.rs b/src/components/script/dom/bindings/utils.rs
index 6f931cc3290..bb405b3a473 100644
--- a/src/components/script/dom/bindings/utils.rs
+++ b/src/components/script/dom/bindings/utils.rs
@@ -121,14 +121,19 @@ pub fn is_dom_proxy(obj: *JSObject) -> bool {
}
#[fixed_stack_segment]
-pub unsafe fn unwrap<T>(obj: *JSObject) -> T {
+pub unsafe fn dom_object_slot(obj: *JSObject) -> u32 {
let clasp = JS_GetClass(obj);
- let slot = if is_dom_class(clasp) {
- DOM_OBJECT_SLOT
+ if is_dom_class(clasp) {
+ DOM_OBJECT_SLOT as u32
} else {
assert!(is_dom_proxy(obj));
- DOM_PROXY_OBJECT_SLOT
- } as u32;
+ DOM_PROXY_OBJECT_SLOT as u32
+ }
+}
+
+#[fixed_stack_segment]
+pub unsafe fn unwrap<T>(obj: *JSObject) -> T {
+ let slot = dom_object_slot(obj);
let val = JS_GetReservedSlot(obj, slot);
cast::transmute(RUST_JSVAL_TO_PRIVATE(val))
}
diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs
index 5edec50a324..8ca1eb4a5bf 100644
--- a/src/components/script/script_task.rs
+++ b/src/components/script/script_task.rs
@@ -629,7 +629,9 @@ impl ScriptTask {
}
}
- fn handle_exit_window_msg(&mut self, _id: PipelineId) -> bool {
+ fn handle_exit_window_msg(&mut self, id: PipelineId) -> bool {
+ self.handle_exit_pipeline_msg(id);
+
// TODO(tkuehn): currently there is only one window,
// so this can afford to be naive and just shut down the
// compositor. In the future it'll need to be smarter.