mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Remove Window::layout_join_port.
It is only used in Window::force_reflow.
This commit is contained in:
parent
9ad69586d1
commit
1608450e4e
1 changed files with 11 additions and 25 deletions
|
@ -63,11 +63,10 @@ use std::collections::HashSet;
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
use std::ffi::CString;
|
use std::ffi::CString;
|
||||||
use std::io::{Write, stderr, stdout};
|
use std::io::{Write, stderr, stdout};
|
||||||
use std::mem as std_mem;
|
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::sync::mpsc::TryRecvError::{Disconnected, Empty};
|
use std::sync::mpsc::TryRecvError::{Disconnected, Empty};
|
||||||
use std::sync::mpsc::{Receiver, Sender, channel};
|
use std::sync::mpsc::{Sender, channel};
|
||||||
use string_cache::Atom;
|
use string_cache::Atom;
|
||||||
use time;
|
use time;
|
||||||
use timers::{ActiveTimers, IsInterval, TimerCallback};
|
use timers::{ActiveTimers, IsInterval, TimerCallback};
|
||||||
|
@ -182,10 +181,6 @@ pub struct Window {
|
||||||
#[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 + 'static>,
|
||||||
|
|
||||||
/// The port that we will use to join layout. If this is `None`, then layout is not running.
|
|
||||||
#[ignore_heap_size_of = "channels are hard"]
|
|
||||||
layout_join_port: DOMRefCell<Option<Receiver<()>>>,
|
|
||||||
|
|
||||||
/// 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>>,
|
||||||
|
|
||||||
|
@ -914,11 +909,6 @@ impl Window {
|
||||||
// Layout will let us know when it's done.
|
// Layout will let us know when it's done.
|
||||||
let (join_chan, join_port) = channel();
|
let (join_chan, join_port) = channel();
|
||||||
|
|
||||||
{
|
|
||||||
let mut layout_join_port = self.layout_join_port.borrow_mut();
|
|
||||||
*layout_join_port = Some(join_port);
|
|
||||||
}
|
|
||||||
|
|
||||||
let last_reflow_id = &self.last_reflow_id;
|
let last_reflow_id = &self.last_reflow_id;
|
||||||
last_reflow_id.set(last_reflow_id.get() + 1);
|
last_reflow_id.set(last_reflow_id.get() + 1);
|
||||||
|
|
||||||
|
@ -949,22 +939,19 @@ impl Window {
|
||||||
// FIXME(cgaebel): this is racey. What if the compositor triggers a
|
// FIXME(cgaebel): this is racey. What if the compositor triggers a
|
||||||
// reflow between the "join complete" message and returning from this
|
// reflow between the "join complete" message and returning from this
|
||||||
// function?
|
// function?
|
||||||
let mut layout_join_port = self.layout_join_port.borrow_mut();
|
match join_port.try_recv() {
|
||||||
if let Some(join_port) = std_mem::replace(&mut *layout_join_port, None) {
|
Err(Empty) => {
|
||||||
match join_port.try_recv() {
|
info!("script: waiting on layout");
|
||||||
Err(Empty) => {
|
join_port.recv().unwrap();
|
||||||
info!("script: waiting on layout");
|
}
|
||||||
join_port.recv().unwrap();
|
Ok(_) => {}
|
||||||
}
|
Err(Disconnected) => {
|
||||||
Ok(_) => {}
|
panic!("Layout task failed while script was waiting for a result.");
|
||||||
Err(Disconnected) => {
|
|
||||||
panic!("Layout task failed while script was waiting for a result.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
debug!("script: layout joined")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug!("script: layout joined");
|
||||||
|
|
||||||
self.pending_reflow_count.set(0);
|
self.pending_reflow_count.set(0);
|
||||||
|
|
||||||
if let Some(marker) = marker {
|
if let Some(marker) = marker {
|
||||||
|
@ -1300,7 +1287,6 @@ impl Window {
|
||||||
next_subpage_id: Cell::new(SubpageId(0)),
|
next_subpage_id: Cell::new(SubpageId(0)),
|
||||||
layout_chan: layout_chan,
|
layout_chan: layout_chan,
|
||||||
layout_rpc: layout_rpc,
|
layout_rpc: layout_rpc,
|
||||||
layout_join_port: DOMRefCell::new(None),
|
|
||||||
window_size: Cell::new(window_size),
|
window_size: Cell::new(window_size),
|
||||||
current_viewport: Cell::new(Rect::zero()),
|
current_viewport: Cell::new(Rect::zero()),
|
||||||
pending_reflow_count: Cell::new(0),
|
pending_reflow_count: Cell::new(0),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue