Report errors using the top-level frame id rather than the pipeline id.

This commit is contained in:
Alan Jeffrey 2016-11-10 15:34:04 -06:00
parent 22aebdf5d4
commit c228a4cf03
9 changed files with 203 additions and 195 deletions

View file

@ -42,7 +42,6 @@ extern crate selectors;
extern crate serde_json;
extern crate servo_url;
extern crate style;
extern crate style_traits;
extern crate util;
extern crate webrender_traits;
@ -80,7 +79,7 @@ use layout::webrender_helpers::{WebRenderDisplayListConverter, WebRenderFrameBui
use layout::wrapper::LayoutNodeLayoutData;
use layout::wrapper::drop_style_and_layout_data;
use layout_traits::LayoutThreadFactory;
use msg::constellation_msg::PipelineId;
use msg::constellation_msg::{FrameId, PipelineId};
use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheResult, ImageCacheThread};
use net_traits::image_cache_thread::UsePlaceholder;
use parking_lot::RwLock;
@ -235,6 +234,7 @@ impl LayoutThreadFactory for LayoutThread {
/// Spawns a new layout thread.
fn create(id: PipelineId,
top_level_frame_id: Option<FrameId>,
url: ServoUrl,
is_iframe: bool,
chan: (Sender<Msg>, Receiver<Msg>),
@ -251,7 +251,11 @@ impl LayoutThreadFactory for LayoutThread {
thread::spawn_named(format!("LayoutThread {:?}", id),
move || {
thread_state::initialize(thread_state::LAYOUT);
PipelineId::install(id);
if let Some(top_level_frame_id) = top_level_frame_id {
FrameId::install(top_level_frame_id);
}
{ // Ensures layout thread is destroyed before we send shutdown message
let sender = chan.0;
let layout = LayoutThread::new(id,
@ -718,6 +722,7 @@ impl LayoutThread {
fn create_layout_thread(&self, info: NewLayoutThreadInfo) {
LayoutThread::create(info.id,
FrameId::installed(),
info.url.clone(),
info.is_parent,
info.layout_pair,