use dom_struct::dom_struct;
use crate::dom::bindings::codegen::Bindings::PerformanceNavigationBinding::{
PerformanceNavigationConstants, PerformanceNavigationMethods,
};
use crate::dom::bindings::codegen::Bindings::WindowBinding::Window_Binding::WindowMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::globalscope::GlobalScope;
use crate::script_runtime::CanGc;
#[dom_struct]
pub struct PerformanceNavigation {
reflector_: Reflector,
}
impl PerformanceNavigation {
fn new_inherited() -> PerformanceNavigation {
PerformanceNavigation {
reflector_: Reflector::new(),
}
}
pub fn new(global: &GlobalScope) -> DomRoot<PerformanceNavigation> {
reflect_dom_object(
Box::new(PerformanceNavigation::new_inherited()),
global,
CanGc::note(),
)
}
}
impl PerformanceNavigationMethods<crate::DomTypeHolder> for PerformanceNavigation {
fn Type(&self) -> u16 {
PerformanceNavigationConstants::TYPE_NAVIGATE
}
fn RedirectCount(&self) -> u16 {
self.global().as_window().Document().get_redirect_count()
}
}