aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_thread/lib.rs
diff options
context:
space:
mode:
authorBobby Holley <bobbyholley@gmail.com>2016-12-16 11:50:11 -0800
committerBobby Holley <bobbyholley@gmail.com>2016-12-21 11:10:39 -0800
commitc5f01fe3b89c2a381fb891e9728fa2951b87a747 (patch)
treecca5add7c82e7f24255f4706696c02f2ed5bce3f /components/layout_thread/lib.rs
parent8f7f62f8104bf576c38f7cfa1fedfaf2c51c0049 (diff)
downloadservo-c5f01fe3b89c2a381fb891e9728fa2951b87a747.tar.gz
servo-c5f01fe3b89c2a381fb891e9728fa2951b87a747.zip
Introduce and use Scoped TLS.
It turns out that it's problematic to embed ThreadLocalStyleContext within LayoutContext, because parameterizing the former on TElement (which we do in the next patch) infects all the traversal stuff with the trait parameters, which we don't really want. In general, it probably makes sense to use separate scoped TLS types for the separate DOM and Flow tree passes, so we can add a different ScopedTLS type for the Flow pass if we ever need it. We also reorder the |scope| and |shared| parameters in parallel.rs, because it aligns more with the order in style/parallel.rs. I did this when I was adding a TLS parameter to all these functions, which I realized we don't need for now.
Diffstat (limited to 'components/layout_thread/lib.rs')
-rw-r--r--components/layout_thread/lib.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs
index d2bdf3a8f35..524b325dcec 100644
--- a/components/layout_thread/lib.rs
+++ b/components/layout_thread/lib.rs
@@ -63,7 +63,8 @@ use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use layout::animation;
use layout::construct::ConstructionResult;
-use layout::context::{LayoutContext, SharedLayoutContext, ThreadLocalLayoutContext, heap_size_of_local_context};
+use layout::context::{LayoutContext, SharedLayoutContext};
+use layout::context::heap_size_of_persistent_local_context;
use layout::display_list_builder::ToGfxColor;
use layout::flow::{self, Flow, ImmutableFlowUtils, MutableFlowUtils, MutableOwnedFlowUtils};
use layout::flow_ref::FlowRef;
@@ -723,11 +724,11 @@ impl LayoutThread {
size: stylist.heap_size_of_children(),
});
- // The LayoutThread has a context in TLS...
+ // The LayoutThread has data in Persistent TLS...
reports.push(Report {
path: path![formatted_url, "layout-thread", "local-context"],
kind: ReportKind::ExplicitJemallocHeapSize,
- size: heap_size_of_local_context(),
+ size: heap_size_of_persistent_local_context(),
});
reports_chan.send(reports);
@@ -1447,8 +1448,7 @@ impl LayoutThread {
self.profiler_metadata(),
self.time_profiler_chan.clone(),
|| {
- let tlc = ThreadLocalLayoutContext::new(&shared);
- let context = LayoutContext::new(&shared, &*tlc);
+ let context = LayoutContext::new(&shared);
sequential::store_overflow(&context,
FlowRef::deref_mut(&mut root_flow) as &mut Flow);
});