Struct script::dom::dissimilaroriginwindow::DissimilarOriginWindow
source · #[repr(C)]pub struct DissimilarOriginWindow {
globalscope: GlobalScope,
window_proxy: Dom<WindowProxy>,
location: MutNullableDom<DissimilarOriginLocation>,
}
Expand description
Represents a dissimilar-origin Window
that exists in another script thread.
Since the Window
is in a different script thread, we cannot access it
directly, but some of its accessors (for example window.parent
)
still need to function.
In windowproxy.rs
, we create a custom window proxy for these windows,
that throws security exceptions for most accessors. This is not a replacement
for XOWs, but provides belt-and-braces security.
Fields§
§globalscope: GlobalScope
The global for this window.
window_proxy: Dom<WindowProxy>
The window proxy for this window.
location: MutNullableDom<DissimilarOriginLocation>
The location of this window, initialized lazily.
Implementations§
source§impl DissimilarOriginWindow
impl DissimilarOriginWindow
fn __assert_parent_type(&self)
source§impl DissimilarOriginWindow
impl DissimilarOriginWindow
pub fn new( global_to_clone_from: &GlobalScope, window_proxy: &WindowProxy ) -> Root<Dom<Self>>
pub fn window_proxy(&self) -> Root<Dom<WindowProxy>>
source§impl DissimilarOriginWindow
impl DissimilarOriginWindow
sourcefn post_message_impl(
&self,
target_origin: &USVString,
cx: JSContext,
message: HandleValue<'_>,
transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>
) -> Result<(), Error>
fn post_message_impl( &self, target_origin: &USVString, cx: JSContext, message: HandleValue<'_>, transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>> ) -> Result<(), Error>
sourcepub fn post_message(
&self,
target_origin: &USVString,
data: StructuredSerializedData
) -> Result<(), Error>
pub fn post_message( &self, target_origin: &USVString, data: StructuredSerializedData ) -> Result<(), Error>
Trait Implementations§
source§impl Castable for DissimilarOriginWindow
impl Castable for DissimilarOriginWindow
source§impl DissimilarOriginWindowMethods for DissimilarOriginWindow
impl DissimilarOriginWindowMethods for DissimilarOriginWindow
source§fn PostMessage(
&self,
cx: JSContext,
message: HandleValue<'_>,
target_origin: USVString,
transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>
) -> Result<(), Error>
fn PostMessage( &self, cx: JSContext, message: HandleValue<'_>, target_origin: USVString, transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>> ) -> Result<(), Error>
source§fn PostMessage_(
&self,
cx: JSContext,
message: HandleValue<'_>,
options: RootedTraceableBox<WindowPostMessageOptions>
) -> Result<(), Error>
fn PostMessage_( &self, cx: JSContext, message: HandleValue<'_>, options: RootedTraceableBox<WindowPostMessageOptions> ) -> Result<(), Error>
fn Window(&self) -> Root<Dom<WindowProxy>>
fn Self_(&self) -> Root<Dom<WindowProxy>>
fn Frames(&self) -> Root<Dom<WindowProxy>>
fn GetParent(&self) -> Option<Root<Dom<WindowProxy>>>
fn GetTop(&self) -> Option<Root<Dom<WindowProxy>>>
fn Length(&self) -> u32
fn Close(&self)
fn Closed(&self) -> bool
fn Opener(&self, _: JSContext) -> JSVal
fn SetOpener(&self, _: JSContext, _: HandleValue<'_>)
fn Blur(&self)
fn Focus(&self)
fn Location(&self) -> Root<Dom<DissimilarOriginLocation>>
source§impl DomObject for DissimilarOriginWindow
impl DomObject for DissimilarOriginWindow
source§impl HasParent for DissimilarOriginWindow
impl HasParent for DissimilarOriginWindow
source§fn as_parent(&self) -> &GlobalScope
fn as_parent(&self) -> &GlobalScope
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = GlobalScope
source§impl MallocSizeOf for DissimilarOriginWindow
impl MallocSizeOf for DissimilarOriginWindow
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl MutDomObject for DissimilarOriginWindow
impl MutDomObject for DissimilarOriginWindow
source§unsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
Initializes the Reflector
source§impl PartialEq<DissimilarOriginWindow> for DissimilarOriginWindow
impl PartialEq<DissimilarOriginWindow> for DissimilarOriginWindow
source§fn eq(&self, other: &DissimilarOriginWindow) -> bool
fn eq(&self, other: &DissimilarOriginWindow) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Traceable for DissimilarOriginWindow
impl Traceable for DissimilarOriginWindow
impl DerivedFrom<EventTarget> for DissimilarOriginWindow
impl DerivedFrom<GlobalScope> for DissimilarOriginWindow
Auto Trait Implementations§
impl !RefUnwindSafe for DissimilarOriginWindow
impl !Send for DissimilarOriginWindow
impl !Sync for DissimilarOriginWindow
impl Unpin for DissimilarOriginWindow
impl !UnwindSafe for DissimilarOriginWindow
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> 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>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,
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, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
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