diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-26 01:53:40 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-26 09:49:10 +0200 |
commit | f87c2a8d7616112ca924e30292db2d244cf87eec (patch) | |
tree | 7344afe7ec0ec1ac7d1d13f5385111ee9c4be332 /components/script/dom/bindings/settings_stack.rs | |
parent | 577370746e2ce3da7fa25a20b8e1bbeed319df65 (diff) | |
download | servo-f87c2a8d7616112ca924e30292db2d244cf87eec.tar.gz servo-f87c2a8d7616112ca924e30292db2d244cf87eec.zip |
Rename Root<T> to DomRoot<T>
In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>,
where Root<T> will be able to handle all the things that need to be
rooted that have a stable traceable address that doesn't move for the
whole lifetime of the root. Stay tuned.
Diffstat (limited to 'components/script/dom/bindings/settings_stack.rs')
-rw-r--r-- | components/script/dom/bindings/settings_stack.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script/dom/bindings/settings_stack.rs b/components/script/dom/bindings/settings_stack.rs index 0d747cca205..fb708d1b235 100644 --- a/components/script/dom/bindings/settings_stack.rs +++ b/components/script/dom/bindings/settings_stack.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::root::{Dom, Root}; +use dom::bindings::root::{Dom, DomRoot}; use dom::bindings::trace::JSTraceable; use dom::globalscope::GlobalScope; use js::jsapi::GetScriptedCallerGlobal; @@ -37,7 +37,7 @@ pub unsafe fn trace(tracer: *mut JSTracer) { /// RAII struct that pushes and pops entries from the script settings stack. pub struct AutoEntryScript { - global: Root<GlobalScope>, + global: DomRoot<GlobalScope>, } impl AutoEntryScript { @@ -51,7 +51,7 @@ impl AutoEntryScript { kind: StackEntryKind::Entry, }); AutoEntryScript { - global: Root::from_ref(global), + global: DomRoot::from_ref(global), } }) } @@ -80,13 +80,13 @@ impl Drop for AutoEntryScript { /// Returns the ["entry"] global object. /// /// ["entry"]: https://html.spec.whatwg.org/multipage/#entry -pub fn entry_global() -> Root<GlobalScope> { +pub fn entry_global() -> DomRoot<GlobalScope> { STACK.with(|stack| { stack.borrow() .iter() .rev() .find(|entry| entry.kind == StackEntryKind::Entry) - .map(|entry| Root::from_ref(&*entry.global)) + .map(|entry| DomRoot::from_ref(&*entry.global)) }).unwrap() } @@ -145,7 +145,7 @@ impl Drop for AutoIncumbentScript { /// Returns the ["incumbent"] global object. /// /// ["incumbent"]: https://html.spec.whatwg.org/multipage/#incumbent -pub fn incumbent_global() -> Option<Root<GlobalScope>> { +pub fn incumbent_global() -> Option<DomRoot<GlobalScope>> { // https://html.spec.whatwg.org/multipage/#incumbent-settings-object // Step 1, 3: See what the JS engine has to say. If we've got a scripted @@ -165,6 +165,6 @@ pub fn incumbent_global() -> Option<Root<GlobalScope>> { STACK.with(|stack| { stack.borrow() .last() - .map(|entry| Root::from_ref(&*entry.global)) + .map(|entry| DomRoot::from_ref(&*entry.global)) }) } |