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

@ -26,7 +26,7 @@ use js::jsapi::{HandleValue, JS_SetInterruptCallback};
use js::jsapi::{JSAutoCompartment, JSContext};
use js::jsval::UndefinedValue;
use js::rust::Runtime;
use msg::constellation_msg::PipelineId;
use msg::constellation_msg::FrameId;
use net_traits::{IpcSend, load_whole_resource};
use net_traits::request::{CredentialsMode, Destination, RequestInit, Type as RequestType};
use rand::random;
@ -158,9 +158,14 @@ impl DedicatedWorkerGlobalScope {
closing: Arc<AtomicBool>) {
let serialized_worker_url = worker_url.to_string();
let name = format!("WebWorker for {}", serialized_worker_url);
let top_level_frame_id = FrameId::installed();
spawn_named(name, move || {
thread_state::initialize(thread_state::SCRIPT | thread_state::IN_WORKER);
PipelineId::install(init.pipeline_id);
if let Some(top_level_frame_id) = top_level_frame_id {
FrameId::install(top_level_frame_id);
}
let roots = RootCollection::new();
let _stack_roots_tls = StackRootTLS::new(&roots);

View file

@ -517,8 +517,8 @@ impl ScriptThreadFactory for ScriptThread {
thread::spawn_named(format!("ScriptThread {:?}", state.id),
move || {
thread_state::initialize(thread_state::SCRIPT);
PipelineId::install(state.id);
PipelineNamespace::install(state.pipeline_namespace_id);
FrameId::install(state.top_level_frame_id);
let roots = RootCollection::new();
let _stack_roots_tls = StackRootTLS::new(&roots);
let id = state.id;