pub(crate) struct ParserContext {
parser: Option<Trusted<ServoParser>>,
is_synthesized_document: bool,
has_loaded_document: bool,
webview_id: WebViewId,
pipeline_id: PipelineId,
url: ServoUrl,
pushed_entry_index: Option<usize>,
navigation_params: NavigationParams,
parent_info: Option<PipelineId>,
target_snapshot_params: TargetSnapshotParams,
source_origin: Option<MutableOrigin>,
document: Option<Trusted<Document>>,
}Expand description
The context required for asynchronously fetching a document and parsing it progressively.
Fields§
§parser: Option<Trusted<ServoParser>>The parser that initiated the request.
is_synthesized_document: boolIs this a synthesized document
has_loaded_document: boolHas a document already been loaded (relevant for checking the resource header)
webview_id: WebViewIdThe WebViewId of the WebView associated with this document.
pipeline_id: PipelineIdThe PipelineId of the Pipeline associated with this document.
url: ServoUrlThe URL for this document.
pushed_entry_index: Option<usize>pushed entry index
params required in document load algorithms
parent_info: Option<PipelineId>To report CSP violations to the global that initiated the navigation
target_snapshot_params: TargetSnapshotParams§source_origin: Option<MutableOrigin>The source origin this load if this navigation was initiated by script.
This is used to ensure that about:blank and about:srcdoc pages are
able to inherit the aliased MutableOrigin of their initiating pages
properly. In the case that the initiator is in another event loop, this
will be a non-aliased copy of the origin.
document: Option<Trusted<Document>>Implementations§
Source§impl ParserContext
impl ParserContext
pub(crate) fn new( webview_id: WebViewId, pipeline_id: PipelineId, url: ServoUrl, creation_sandboxing_flag_set: SandboxingFlagSet, parent_info: Option<PipelineId>, target_snapshot_params: TargetSnapshotParams, source_origin: Option<MutableOrigin>, ) -> ParserContext
pub(crate) fn set_policy_container( &mut self, policy_container: Option<&PolicyContainer>, )
pub(crate) fn set_about_base_url(&mut self, about_base_url: Option<ServoUrl>)
pub(crate) fn get_document(&self) -> Option<DomRoot<Document>>
pub(crate) fn parent_info(&self) -> Option<PipelineId>
Sourcefn create_policy_container_from_fetch_response(
metadata: &Metadata,
) -> PolicyContainer
fn create_policy_container_from_fetch_response( metadata: &Metadata, ) -> PolicyContainer
Sourcefn initialize_document_object(&self, cx: &mut JSContext, document: &Document)
fn initialize_document_object(&self, cx: &mut JSContext, document: &Document)
Sourcefn process_link_headers_in_media_phase_with_task(&mut self, document: &Document)
fn process_link_headers_in_media_phase_with_task(&mut self, document: &Document)
Part of various load document methods
Sourcefn load_document(
&mut self,
cx: &mut JSContext,
parser: Option<&ServoParser>,
document: &Document,
)
fn load_document( &mut self, cx: &mut JSContext, parser: Option<&ServoParser>, document: &Document, )
Sourcefn load_html_document(&mut self, cx: &mut JSContext, document: &Document)
fn load_html_document(&mut self, cx: &mut JSContext, document: &Document)
Sourcefn load_xml_document(&mut self, cx: &mut JSContext, document: &Document)
fn load_xml_document(&mut self, cx: &mut JSContext, document: &Document)
Sourcefn load_text_document(&mut self, cx: &mut JSContext, parser: &ServoParser)
fn load_text_document(&mut self, cx: &mut JSContext, parser: &ServoParser)
Sourcefn load_media_document(
&mut self,
cx: &mut JSContext,
parser: &ServoParser,
media_type: MediaType,
mime_type: &Mime,
)
fn load_media_document( &mut self, cx: &mut JSContext, parser: &ServoParser, media_type: MediaType, mime_type: &Mime, )
Sourcefn load_json_document(&mut self, cx: &mut JSContext, parser: &ServoParser)
fn load_json_document(&mut self, cx: &mut JSContext, parser: &ServoParser)
Load a JSON document with a pretty-printing, interactive viewer.
Sourcefn load_inline_unknown_content(
&mut self,
cx: &mut JSContext,
parser: &ServoParser,
page: String,
)
fn load_inline_unknown_content( &mut self, cx: &mut JSContext, parser: &ServoParser, page: String, )
Sourcefn submit_resource_timing(&mut self, cx: &mut JSContext)
fn submit_resource_timing(&mut self, cx: &mut JSContext)
Store a PerformanceNavigationTiming entry in the globalscope’s Performance buffer
fn finish_synchronous_load_for_initial_about_blank( &self, cx: &mut JSContext, document: &Document, )
Sourcepub(crate) fn process_response(
&mut self,
script_thread: &ScriptThread,
cx: &mut JSContext,
meta_result: Result<FetchMetadata, NetworkError>,
)
pub(crate) fn process_response( &mut self, script_thread: &ScriptThread, cx: &mut JSContext, meta_result: Result<FetchMetadata, NetworkError>, )
pub(crate) fn process_response_chunk( &mut self, cx: &mut JSContext, payload: Bytes, )
pub(crate) fn process_response_eof( self, cx: &mut JSContext, status: Result<(), NetworkError>, timing: ResourceFetchTiming, )
Auto Trait Implementations§
impl Freeze for ParserContext
impl !RefUnwindSafe for ParserContext
impl !Send for ParserContext
impl !Sync for ParserContext
impl Unpin for ParserContext
impl UnsafeUnpin for ParserContext
impl !UnwindSafe for ParserContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more