mirror of
https://github.com/servo/servo.git
synced 2025-09-10 06:58:21 +01:00
Urlmageddon: Use refcounted urls more often.
This commit is contained in:
parent
f14e7339b5
commit
913c874cb5
161 changed files with 1044 additions and 718 deletions
|
@ -31,10 +31,10 @@ use html5ever::tree_builder::{NodeOrText, QuirksMode};
|
|||
use html5ever::tree_builder::{Tracer as HtmlTracer, TreeBuilder, TreeBuilderOpts, TreeSink};
|
||||
use html5ever_atoms::QualName;
|
||||
use js::jsapi::JSTracer;
|
||||
use servo_url::ServoUrl;
|
||||
use std::borrow::Cow;
|
||||
use std::io::{self, Write};
|
||||
use super::{FragmentContext, Sink};
|
||||
use url::Url;
|
||||
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
#[must_root]
|
||||
|
@ -48,7 +48,7 @@ pub struct Tokenizer {
|
|||
impl Tokenizer {
|
||||
pub fn new(
|
||||
document: &Document,
|
||||
url: Url,
|
||||
url: ServoUrl,
|
||||
fragment_context: Option<FragmentContext>)
|
||||
-> Self {
|
||||
let sink = Sink {
|
||||
|
|
|
@ -29,9 +29,9 @@ use network_listener::PreInvoke;
|
|||
use profile_traits::time::{TimerMetadata, TimerMetadataFrameType};
|
||||
use profile_traits::time::{TimerMetadataReflowType, ProfilerCategory, profile};
|
||||
use script_thread::ScriptThread;
|
||||
use servo_url::ServoUrl;
|
||||
use std::cell::Cell;
|
||||
use std::collections::VecDeque;
|
||||
use url::Url;
|
||||
use util::resource_files::read_resource_file;
|
||||
|
||||
mod html;
|
||||
|
@ -65,7 +65,7 @@ impl ServoParser {
|
|||
pub fn parse_html_document(
|
||||
document: &Document,
|
||||
input: DOMString,
|
||||
url: Url,
|
||||
url: ServoUrl,
|
||||
owner: Option<PipelineId>) {
|
||||
let parser = ServoParser::new(
|
||||
document,
|
||||
|
@ -122,7 +122,7 @@ impl ServoParser {
|
|||
pub fn parse_xml_document(
|
||||
document: &Document,
|
||||
input: DOMString,
|
||||
url: Url,
|
||||
url: ServoUrl,
|
||||
owner: Option<PipelineId>) {
|
||||
let parser = ServoParser::new(
|
||||
document,
|
||||
|
@ -287,7 +287,7 @@ enum Tokenizer {
|
|||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[must_root]
|
||||
struct Sink {
|
||||
pub base_url: Url,
|
||||
pub base_url: ServoUrl,
|
||||
pub document: JS<Document>,
|
||||
}
|
||||
|
||||
|
@ -338,11 +338,11 @@ pub struct ParserContext {
|
|||
/// The pipeline associated with this document.
|
||||
id: PipelineId,
|
||||
/// The URL for this document.
|
||||
url: Url,
|
||||
url: ServoUrl,
|
||||
}
|
||||
|
||||
impl ParserContext {
|
||||
pub fn new(id: PipelineId, url: Url) -> ParserContext {
|
||||
pub fn new(id: PipelineId, url: ServoUrl) -> ParserContext {
|
||||
ParserContext {
|
||||
parser: None,
|
||||
is_synthesized_document: false,
|
||||
|
|
|
@ -19,9 +19,9 @@ use dom::processinginstruction::ProcessingInstruction;
|
|||
use dom::text::Text;
|
||||
use html5ever_atoms::{Prefix, QualName};
|
||||
use js::jsapi::JSTracer;
|
||||
use servo_url::ServoUrl;
|
||||
use std::borrow::Cow;
|
||||
use super::Sink;
|
||||
use url::Url;
|
||||
use xml5ever::tendril::StrTendril;
|
||||
use xml5ever::tokenizer::{Attribute, QName, XmlTokenizer};
|
||||
use xml5ever::tree_builder::{NextParserState, NodeOrText};
|
||||
|
@ -35,7 +35,7 @@ pub struct Tokenizer {
|
|||
}
|
||||
|
||||
impl Tokenizer {
|
||||
pub fn new(document: &Document, url: Url) -> Self {
|
||||
pub fn new(document: &Document, url: ServoUrl) -> Self {
|
||||
let sink = Sink {
|
||||
base_url: url,
|
||||
document: JS::from_ref(document),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue