diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-05-13 07:09:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-13 07:09:29 -0500 |
commit | 34d0e59849a0a3e231e47fe10d66484340b8b80c (patch) | |
tree | 46d0bb5c7f6858eea9ac15c2165df1006c5b4c83 /components/script/dom/dissimilaroriginwindow.rs | |
parent | d2fa2ae9343db8d958570a501ff9a7b7a203ceeb (diff) | |
parent | 43ca26068935e014b1a41a6a02f45d05436577b4 (diff) | |
download | servo-34d0e59849a0a3e231e47fe10d66484340b8b80c.tar.gz servo-34d0e59849a0a3e231e47fe10d66484340b8b80c.zip |
Auto merge of #16845 - asajeffrey:script-rename-browsing-contexts, r=jdm
Renamed BrowsingContext to WindowProxy in script.
<!-- Please describe your changes on the following line: -->
Renamed `script::dom::BrowsingContext` to `script::dom::WindowProxy`.
The browsing context is mostly maintained in the constellation, not in script. It would be nice to rename `constellation::Frame` to `constellation::BrowsingContext`, but that will be very confusing if there are two `BrowsingContext` types.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because renamings aren't externally visible
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16845)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/dissimilaroriginwindow.rs')
-rw-r--r-- | components/script/dom/dissimilaroriginwindow.rs | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/components/script/dom/dissimilaroriginwindow.rs b/components/script/dom/dissimilaroriginwindow.rs index 4188f51f0e5..7d5bef36344 100644 --- a/components/script/dom/dissimilaroriginwindow.rs +++ b/components/script/dom/dissimilaroriginwindow.rs @@ -9,9 +9,9 @@ use dom::bindings::inheritance::Castable; use dom::bindings::js::{JS, MutNullableJS, Root}; use dom::bindings::str::DOMString; use dom::bindings::structuredclone::StructuredCloneData; -use dom::browsingcontext::BrowsingContext; use dom::dissimilaroriginlocation::DissimilarOriginLocation; use dom::globalscope::GlobalScope; +use dom::windowproxy::WindowProxy; use dom_struct::dom_struct; use ipc_channel::ipc; use js::jsapi::{JSContext, HandleValue}; @@ -28,7 +28,7 @@ use servo_url::ServoUrl; /// directly, but some of its accessors (for example `window.parent`) /// still need to function. /// -/// In `browsingcontext.rs`, we create a custom window proxy for these windows, +/// 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. #[dom_struct] @@ -36,8 +36,8 @@ pub struct DissimilarOriginWindow { /// The global for this window. globalscope: GlobalScope, - /// The browsing context this window is part of. - browsing_context: JS<BrowsingContext>, + /// The window proxy for this window. + window_proxy: JS<WindowProxy>, /// The location of this window, initialized lazily. location: MutNullableJS<DissimilarOriginLocation>, @@ -45,7 +45,7 @@ pub struct DissimilarOriginWindow { impl DissimilarOriginWindow { #[allow(unsafe_code)] - pub fn new(global_to_clone_from: &GlobalScope, browsing_context: &BrowsingContext) -> Root<DissimilarOriginWindow> { + pub fn new(global_to_clone_from: &GlobalScope, window_proxy: &WindowProxy) -> Root<DissimilarOriginWindow> { let cx = global_to_clone_from.get_cx(); // Any timer events fired on this window are ignored. let (timer_event_chan, _) = ipc::channel().unwrap(); @@ -59,7 +59,7 @@ impl DissimilarOriginWindow { global_to_clone_from.resource_threads().clone(), timer_event_chan, global_to_clone_from.origin().clone()), - browsing_context: JS::from_ref(browsing_context), + window_proxy: JS::from_ref(window_proxy), location: MutNullableJS::new(None), }; unsafe { DissimilarOriginWindowBinding::Wrap(cx, win) } @@ -73,42 +73,42 @@ impl DissimilarOriginWindow { impl DissimilarOriginWindowMethods for DissimilarOriginWindow { // https://html.spec.whatwg.org/multipage/#dom-window - fn Window(&self) -> Root<BrowsingContext> { - Root::from_ref(&*self.browsing_context) + fn Window(&self) -> Root<WindowProxy> { + Root::from_ref(&*self.window_proxy) } // https://html.spec.whatwg.org/multipage/#dom-self - fn Self_(&self) -> Root<BrowsingContext> { - Root::from_ref(&*self.browsing_context) + fn Self_(&self) -> Root<WindowProxy> { + Root::from_ref(&*self.window_proxy) } // https://html.spec.whatwg.org/multipage/#dom-frames - fn Frames(&self) -> Root<BrowsingContext> { - Root::from_ref(&*self.browsing_context) + fn Frames(&self) -> Root<WindowProxy> { + Root::from_ref(&*self.window_proxy) } // https://html.spec.whatwg.org/multipage/#dom-parent - fn GetParent(&self) -> Option<Root<BrowsingContext>> { + fn GetParent(&self) -> Option<Root<WindowProxy>> { // Steps 1-3. - if self.browsing_context.is_discarded() { + if self.window_proxy.is_browsing_context_discarded() { return None; } // Step 4. - if let Some(parent) = self.browsing_context.parent() { + if let Some(parent) = self.window_proxy.parent() { return Some(Root::from_ref(parent)); } // Step 5. - Some(Root::from_ref(&*self.browsing_context)) + Some(Root::from_ref(&*self.window_proxy)) } // https://html.spec.whatwg.org/multipage/#dom-top - fn GetTop(&self) -> Option<Root<BrowsingContext>> { + fn GetTop(&self) -> Option<Root<WindowProxy>> { // Steps 1-3. - if self.browsing_context.is_discarded() { + if self.window_proxy.is_browsing_context_discarded() { return None; } // Steps 4-5. - Some(Root::from_ref(self.browsing_context.top())) + Some(Root::from_ref(self.window_proxy.top())) } // https://html.spec.whatwg.org/multipage/#dom-length @@ -184,7 +184,7 @@ impl DissimilarOriginWindowMethods for DissimilarOriginWindow { impl DissimilarOriginWindow { pub fn post_message(&self, origin: Option<ImmutableOrigin>, data: StructuredCloneData) { - let msg = ConstellationMsg::PostMessage(self.browsing_context.frame_id(), origin, data.move_to_arraybuffer()); + let msg = ConstellationMsg::PostMessage(self.window_proxy.frame_id(), origin, data.move_to_arraybuffer()); let _ = self.upcast::<GlobalScope>().constellation_chan().send(msg); } } |