aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/global.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-07-25 01:50:31 -0600
committerbors-servo <metajack+bors@gmail.com>2015-07-25 01:50:31 -0600
commit1764267379a00b96a1df89f3917299a0c6fd325c (patch)
tree15641e7ed77b46ab61bab772fa3c63b7e8e8d619 /components/script/dom/bindings/global.rs
parent886c08c393f51499490702eaf97fc770273a2600 (diff)
parentbb99b2f3c8813919c476930c709b73d3cfbc8c83 (diff)
downloadservo-1764267379a00b96a1df89f3917299a0c6fd325c.tar.gz
servo-1764267379a00b96a1df89f3917299a0c6fd325c.zip
Auto merge of #6616 - pcwalton:canvas-webgl-ipc, r=jdm
script: Make most of 2D canvas and WebGL run over IPC. To actually make the multiprocess communication work, we'll need to reroute the task creation to the pipeline or the compositor. But this works as a first step. r? @jdm <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6616) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/bindings/global.rs')
-rw-r--r--components/script/dom/bindings/global.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/components/script/dom/bindings/global.rs b/components/script/dom/bindings/global.rs
index 85dd955628b..5335db1d928 100644
--- a/components/script/dom/bindings/global.rs
+++ b/components/script/dom/bindings/global.rs
@@ -17,7 +17,7 @@ use dom::window::{self, WindowHelpers};
use devtools_traits::DevtoolsControlChan;
use script_task::{ScriptChan, ScriptPort, ScriptMsg, ScriptTask};
-use msg::constellation_msg::{PipelineId, WorkerId};
+use msg::constellation_msg::{ConstellationChan, PipelineId, WorkerId};
use net_traits::ResourceTask;
use profile_traits::mem;
@@ -91,6 +91,14 @@ impl<'a> GlobalRef<'a> {
}
}
+ /// Get a `ConstellationChan` to send messages to the constellation channel when available.
+ pub fn constellation_chan(&self) -> ConstellationChan {
+ match *self {
+ GlobalRef::Window(window) => window.constellation_chan(),
+ GlobalRef::Worker(worker) => worker.constellation_chan(),
+ }
+ }
+
/// Get a `DevtoolsControlChan` to send messages to Devtools
/// task when available.
pub fn devtools_chan(&self) -> Option<DevtoolsControlChan> {