Rename ScriptContext to ClassicContext

This commit is contained in:
CYBAI 2019-06-09 01:19:51 +09:00
parent 47d8c572ce
commit 608c44f103

View file

@ -158,7 +158,7 @@ impl ClassicScript {
pub type ScriptResult = Result<ClassicScript, NetworkError>;
/// The context required for asynchronously loading an external script source.
struct ScriptContext {
struct ClassicContext {
/// The element that initiated the request.
elem: Trusted<HTMLScriptElement>,
/// The kind of external script.
@ -178,7 +178,7 @@ struct ScriptContext {
resource_timing: ResourceFetchTiming,
}
impl FetchResponseListener for ScriptContext {
impl FetchResponseListener for ClassicContext {
fn process_request_body(&mut self) {} // TODO(KiChjang): Perhaps add custom steps to perform fetch here?
fn process_request_eof(&mut self) {} // TODO(KiChjang): Perhaps add custom steps to perform fetch here?
@ -265,7 +265,7 @@ impl FetchResponseListener for ScriptContext {
}
}
impl ResourceTimingListener for ScriptContext {
impl ResourceTimingListener for ClassicContext {
fn resource_timing_information(&self) -> (InitiatorType, ServoUrl) {
let initiator_type = InitiatorType::LocalName(
self.elem
@ -282,7 +282,7 @@ impl ResourceTimingListener for ScriptContext {
}
}
impl PreInvoke for ScriptContext {}
impl PreInvoke for ClassicContext {}
/// <https://html.spec.whatwg.org/multipage/#fetch-a-classic-script>
fn fetch_a_classic_script(
@ -318,7 +318,7 @@ fn fetch_a_classic_script(
// TODO: Step 3, Add custom steps to perform fetch
let context = Arc::new(Mutex::new(ScriptContext {
let context = Arc::new(Mutex::new(ClassicContext {
elem: Trusted::new(script),
kind: kind,
character_encoding: character_encoding,