mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
adding interface for custom responses
This commit is contained in:
parent
bcea0ada27
commit
3766cd1673
17 changed files with 663 additions and 146 deletions
|
@ -18,8 +18,8 @@ use ipc_channel::ipc::IpcSender;
|
|||
use js::jsapi::{CurrentGlobalOrNull, GetGlobalForObjectCrossCompartment};
|
||||
use js::jsapi::{JSContext, JSObject, JS_GetClass, MutableHandleValue};
|
||||
use js::{JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL};
|
||||
use msg::constellation_msg::{PanicMsg, PipelineId};
|
||||
use net_traits::CoreResourceThread;
|
||||
use msg::constellation_msg::{PipelineId, PanicMsg};
|
||||
use net_traits::{CoreResourceThread, RequestSource};
|
||||
use profile_traits::{mem, time};
|
||||
use script_runtime::{CommonScriptMsg, ScriptChan, ScriptPort};
|
||||
use script_thread::{MainThreadScriptChan, ScriptThread};
|
||||
|
@ -65,6 +65,14 @@ impl<'a> GlobalRef<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
/// gets the custom message channel associated with global object
|
||||
pub fn request_source(&self) -> RequestSource {
|
||||
match *self {
|
||||
GlobalRef::Window(ref window) => RequestSource::Window(window.custom_message_chan()),
|
||||
GlobalRef::Worker(ref worker) => RequestSource::Worker(worker.custom_message_chan()),
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the `PipelineId` for this global scope.
|
||||
pub fn pipeline(&self) -> PipelineId {
|
||||
match *self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue