Introduce GlobalScope::core_resource_thread

This commit is contained in:
Anthony Ramine 2016-10-03 23:16:55 +02:00
parent de846f25a6
commit 71236e168a
5 changed files with 12 additions and 14 deletions

View file

@ -21,7 +21,7 @@ use dom::workerglobalscope::WorkerGlobalScope;
use ipc_channel::ipc::IpcSender;
use js::jsapi::{HandleValue, JS_GetContext, JS_GetObjectRuntime, JSContext};
use msg::constellation_msg::PipelineId;
use net_traits::ResourceThreads;
use net_traits::{CoreResourceThread, ResourceThreads, IpcSend};
use profile_traits::{mem, time};
use script_traits::{ScriptMsg as ConstellationMsg, TimerEventRequest};
use std::cell::Cell;
@ -252,6 +252,11 @@ impl GlobalScope {
pub fn resource_threads(&self) -> &ResourceThreads {
&self.resource_threads
}
/// Get the `CoreResourceThread` for this global scope.
pub fn core_resource_thread(&self) -> CoreResourceThread {
self.resource_threads().sender()
}
}
fn timestamp_in_ms(time: Timespec) -> u64 {