aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-05-27 10:26:23 -0500
committerbors-servo <lbergstrom+bors@mozilla.com>2016-05-27 10:26:23 -0500
commitd160f8cb8037db0f4fa0b592d5f59162c1428494 (patch)
treee68a275d8ad7ac3b8c9e2e6ec8c9b421aa1e8ee7 /components/script/script_thread.rs
parent3ab5c075595f6bffe3062e26d91f4837fedbf19c (diff)
parente94f3d4fe056a12d561fbdee7e0af26ba738389c (diff)
downloadservo-d160f8cb8037db0f4fa0b592d5f59162c1428494.tar.gz
servo-d160f8cb8037db0f4fa0b592d5f59162c1428494.zip
Auto merge of #11463 - Ms2ger:LayoutChan, r=nox
Remove the LayoutChan type. <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because refactoring <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> It is a pointless abstraction. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11463) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r--components/script/script_thread.rs21
1 files changed, 10 insertions, 11 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 5d70af5b059..5f83a467076 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -57,8 +57,7 @@ use js::jsapi::{DOMProxyShadowsResult, HandleId, HandleObject, RootedValue};
use js::jsapi::{JSContext, JS_SetWrapObjectCallbacks, JSTracer, SetWindowProxyClass};
use js::jsval::UndefinedValue;
use js::rust::Runtime;
-use layout_interface::ReflowQueryType;
-use layout_interface::{self, LayoutChan, NewLayoutThreadInfo};
+use layout_interface::{self, NewLayoutThreadInfo, ReflowQueryType};
use mem::heap_size_of_self_and_children;
use msg::constellation_msg::{LoadData, PanicMsg, PipelineId, PipelineNamespace};
use msg::constellation_msg::{SubpageId, WindowSizeData, WindowSizeType};
@@ -132,7 +131,7 @@ struct InProgressLoad {
/// The current window size associated with this pipeline.
window_size: Option<WindowSizeData>,
/// Channel to the layout thread associated with this pipeline.
- layout_chan: LayoutChan,
+ layout_chan: Sender<layout_interface::Msg>,
/// The current viewport clipping rectangle applying to this pipeline, if any.
clip_rect: Option<Rect<f32>>,
/// Window is frozen (navigated away while loading for example).
@@ -145,7 +144,7 @@ impl InProgressLoad {
/// Create a new InProgressLoad object.
fn new(id: PipelineId,
parent_info: Option<(PipelineId, SubpageId)>,
- layout_chan: LayoutChan,
+ layout_chan: Sender<layout_interface::Msg>,
window_size: Option<WindowSizeData>,
url: Url) -> InProgressLoad {
InProgressLoad {
@@ -431,7 +430,7 @@ impl ScriptThreadFactory for ScriptThread {
let (script_chan, script_port) = channel();
let (sender, receiver) = channel();
- let layout_chan = LayoutChan(sender.clone());
+ let layout_chan = sender.clone();
let pipeline_id = state.id;
thread::spawn_named_with_send_on_panic(format!("ScriptThread {:?}", state.id),
thread_state::SCRIPT,
@@ -1092,7 +1091,7 @@ impl ScriptThread {
} = new_layout_info;
let layout_pair = channel();
- let layout_chan = LayoutChan(layout_pair.0.clone());
+ let layout_chan = layout_pair.0.clone();
let layout_creation_info = NewLayoutThreadInfo {
id: new_pipeline_id,
@@ -1117,7 +1116,6 @@ impl ScriptThread {
// Tell layout to actually spawn the thread.
parent_window.layout_chan()
- .0
.send(layout_interface::Msg::CreateLayoutThread(layout_creation_info))
.unwrap();
@@ -1342,7 +1340,7 @@ impl ScriptThread {
// Tell the layout thread to begin shutting down, and wait until it
// processed this message.
let (response_chan, response_port) = channel();
- let LayoutChan(chan) = load.layout_chan;
+ let chan = &load.layout_chan;
if chan.send(layout_interface::Msg::PrepareToExit(response_chan)).is_ok() {
debug!("shutting down layout for page {:?}", id);
response_port.recv().unwrap();
@@ -1401,8 +1399,9 @@ impl ScriptThread {
let final_url = metadata.final_url.clone();
{
// send the final url to the layout thread.
- let LayoutChan(ref chan) = incomplete.layout_chan;
- chan.send(layout_interface::Msg::SetFinalUrl(final_url.clone())).unwrap();
+ incomplete.layout_chan
+ .send(layout_interface::Msg::SetFinalUrl(final_url.clone()))
+ .unwrap();
// update the pipeline url
self.constellation_chan
@@ -2000,7 +1999,7 @@ fn shut_down_layout(context_tree: &BrowsingContext) {
// processed this message.
let (response_chan, response_port) = channel();
let window = context.active_window();
- let LayoutChan(chan) = window.layout_chan().clone();
+ let chan = window.layout_chan().clone();
if chan.send(layout_interface::Msg::PrepareToExit(response_chan)).is_ok() {
channels.push(chan);
response_port.recv().unwrap();