pub(crate) struct ParserContext {
parser: Option<Trusted<ServoParser>>,
is_synthesized_document: bool,
has_loaded_document: bool,
id: PipelineId,
url: ServoUrl,
resource_timing: ResourceFetchTiming,
pushed_entry_index: Option<usize>,
navigation_params: NavigationParams,
}
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: bool
Is this a synthesized document
has_loaded_document: bool
Has a document already been loaded (relevant for checking the resource header)
id: PipelineId
The pipeline associated with this document.
url: ServoUrl
The URL for this document.
resource_timing: ResourceFetchTiming
timing data for this resource
pushed_entry_index: Option<usize>
pushed entry index
params required in document load algorithms
Implementations§
Source§impl ParserContext
impl ParserContext
pub(crate) fn new(id: PipelineId, url: ServoUrl) -> ParserContext
pub(crate) fn set_policy_container( &mut self, policy_container: Option<&PolicyContainer>, )
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, document: &Document)
fn initialize_document_object(&self, document: &Document)
Sourcefn load_document(&mut self, can_gc: CanGc)
fn load_document(&mut self, can_gc: CanGc)
Sourcefn load_html_document(&self, parser: &ServoParser)
fn load_html_document(&self, parser: &ServoParser)
Sourcefn load_xml_document(&self, parser: &ServoParser)
fn load_xml_document(&self, parser: &ServoParser)
Sourcefn load_text_document(&self, parser: &ServoParser)
fn load_text_document(&self, parser: &ServoParser)
Sourcefn load_media_document(
&mut self,
parser: &ServoParser,
media_type: MediaType,
mime_type: &Mime,
)
fn load_media_document( &mut self, parser: &ServoParser, media_type: MediaType, mime_type: &Mime, )
Sourcefn load_inline_unknown_content(&mut self, parser: &ServoParser, page: String)
fn load_inline_unknown_content(&mut self, parser: &ServoParser, page: String)
Trait Implementations§
Source§impl FetchResponseListener for ParserContext
impl FetchResponseListener for ParserContext
fn process_request_body(&mut self, _: RequestId)
fn process_request_eof(&mut self, _: RequestId)
fn process_response( &mut self, _: RequestId, meta_result: Result<FetchMetadata, NetworkError>, )
fn process_response_chunk(&mut self, _: RequestId, payload: Vec<u8>)
fn process_response_eof( &mut self, _: RequestId, status: Result<ResourceFetchTiming, NetworkError>, )
fn resource_timing_mut(&mut self) -> &mut ResourceFetchTiming
fn resource_timing(&self) -> &ResourceFetchTiming
fn submit_resource_timing(&mut self)
fn process_csp_violations( &mut self, _request_id: RequestId, violations: Vec<Violation>, )
Source§impl PreInvoke for ParserContext
impl PreInvoke for ParserContext
fn should_invoke(&self) -> bool
Auto Trait Implementations§
impl Freeze for ParserContext
impl !RefUnwindSafe for ParserContext
impl Send for ParserContext
impl !Sync for ParserContext
impl Unpin 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
Mutably borrows from an owned value. Read more
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
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>
Converts
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>
Converts
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert