mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Make the impl of JSTraceable for LayoutRPC sound with a Send bound
This commit is contained in:
parent
e8c9c12b6e
commit
b40681e231
2 changed files with 4 additions and 3 deletions
|
@ -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]
|
#[inline]
|
||||||
unsafe fn trace(&self, _: *mut JSTracer) {
|
unsafe fn trace(&self, _: *mut JSTracer) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
|
|
|
@ -196,7 +196,7 @@ pub struct Window {
|
||||||
|
|
||||||
/// A handle to perform RPC calls into the layout, quickly.
|
/// A handle to perform RPC calls into the layout, quickly.
|
||||||
#[ignore_heap_size_of = "trait objects are hard"]
|
#[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.
|
/// The current size of the window, in pixels.
|
||||||
window_size: Cell<Option<WindowSizeData>>,
|
window_size: Cell<Option<WindowSizeData>>,
|
||||||
|
@ -1538,7 +1538,7 @@ impl Window {
|
||||||
parent_info: Option<(PipelineId, FrameType)>,
|
parent_info: Option<(PipelineId, FrameType)>,
|
||||||
window_size: Option<WindowSizeData>)
|
window_size: Option<WindowSizeData>)
|
||||||
-> Root<Window> {
|
-> Root<Window> {
|
||||||
let layout_rpc: Box<LayoutRPC> = {
|
let layout_rpc: Box<LayoutRPC + Send> = {
|
||||||
let (rpc_send, rpc_recv) = channel();
|
let (rpc_send, rpc_recv) = channel();
|
||||||
layout_chan.send(Msg::GetRPC(rpc_send)).unwrap();
|
layout_chan.send(Msg::GetRPC(rpc_send)).unwrap();
|
||||||
rpc_recv.recv().unwrap()
|
rpc_recv.recv().unwrap()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue