mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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
|
@ -36,6 +36,7 @@ use script_runtime::{ScriptPort, maybe_take_panic_result};
|
|||
use script_thread::{MainThreadScriptChan, RunnableWrapper, ScriptThread};
|
||||
use script_traits::{MsDuration, ScriptMsg as ConstellationMsg, TimerEvent};
|
||||
use script_traits::{TimerEventId, TimerEventRequest, TimerSource};
|
||||
use servo_url::ServoUrl;
|
||||
use std::cell::Cell;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::hash_map::Entry;
|
||||
|
@ -46,7 +47,6 @@ use task_source::networking::NetworkingTaskSource;
|
|||
use time::{Timespec, get_time};
|
||||
use timers::{IsInterval, OneshotTimerCallback, OneshotTimerHandle};
|
||||
use timers::{OneshotTimers, TimerCallback};
|
||||
use url::Url;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct GlobalScope {
|
||||
|
@ -239,7 +239,7 @@ impl GlobalScope {
|
|||
|
||||
/// Get the [base url](https://html.spec.whatwg.org/multipage/#api-base-url)
|
||||
/// for this global scope.
|
||||
pub fn api_base_url(&self) -> Url {
|
||||
pub fn api_base_url(&self) -> ServoUrl {
|
||||
if let Some(window) = self.downcast::<Window>() {
|
||||
// https://html.spec.whatwg.org/multipage/#script-settings-for-browsing-contexts:api-base-url
|
||||
return window.Document().base_url();
|
||||
|
@ -252,7 +252,7 @@ impl GlobalScope {
|
|||
}
|
||||
|
||||
/// Get the URL for this global scope.
|
||||
pub fn get_url(&self) -> Url {
|
||||
pub fn get_url(&self) -> ServoUrl {
|
||||
if let Some(window) = self.downcast::<Window>() {
|
||||
return window.get_url();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue