Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up JSTraceable and how we use it #14473

Merged
merged 7 commits into from Dec 7, 2016

Make the impl of JSTraceable for LayoutRPC sound with a Send bound

  • Loading branch information
nox committed Dec 6, 2016
commit b40681e2312a2c3fd3c34f0f70760c768dda0753
@@ -391,7 +391,8 @@ unsafe impl<T> JSTraceable for IpcSender<T> where T: Deserialize + Serialize {
}
}

unsafe impl JSTraceable for Box<LayoutRPC + 'static> {
// Safe thanks to the Send bound.
unsafe impl JSTraceable for Box<LayoutRPC + Send + 'static> {
#[inline]
unsafe fn trace(&self, _: *mut JSTracer) {
// Do nothing
@@ -196,7 +196,7 @@ pub struct Window {

/// A handle to perform RPC calls into the layout, quickly.
#[ignore_heap_size_of = "trait objects are hard"]
layout_rpc: Box<LayoutRPC + 'static>,
layout_rpc: Box<LayoutRPC + Send + 'static>,

/// The current size of the window, in pixels.
window_size: Cell<Option<WindowSizeData>>,
@@ -1538,7 +1538,7 @@ impl Window {
parent_info: Option<(PipelineId, FrameType)>,
window_size: Option<WindowSizeData>)
-> Root<Window> {
let layout_rpc: Box<LayoutRPC> = {
let layout_rpc: Box<LayoutRPC + Send> = {
let (rpc_send, rpc_recv) = channel();
layout_chan.send(Msg::GetRPC(rpc_send)).unwrap();
rpc_recv.recv().unwrap()
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.