diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2015-11-03 07:07:40 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2015-11-03 07:07:40 +0530 |
commit | 4f51710ed387baa1ad0a6e4cdb0fc5eee44093d5 (patch) | |
tree | 538d53a61aaefbaa33f71dacb0b7d971b4eecbf2 /components/script/dom/url.rs | |
parent | db1163b1eceb5fef6463c4425e99d974a85a50a8 (diff) | |
parent | df7fb8fa326e2b061e2da8c833cc558273db5f37 (diff) | |
download | servo-4f51710ed387baa1ad0a6e4cdb0fc5eee44093d5.tar.gz servo-4f51710ed387baa1ad0a6e4cdb0fc5eee44093d5.zip |
Auto merge of #8056 - eefriedman:trace-refcell, r=jdm
Fix the implementation of JSTraceable for RefCell.
The existing implementation could panic; make sure that doesn't
happen by requiring that the contents of a RefCell are trivially
traceable (i.e. the value don't contain any traceable objects).
I'm not sure whether the TriviallyJSTraceable trait is actually
worthwhile; maybe we should just never use RefCell in the DOM.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8056)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/url.rs')
-rw-r--r-- | components/script/dom/url.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/dom/url.rs b/components/script/dom/url.rs index 9ff22b53597..3bb1d48cee9 100644 --- a/components/script/dom/url.rs +++ b/components/script/dom/url.rs @@ -2,6 +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::cell::DOMRefCell; use dom::bindings::codegen::Bindings::URLBinding::{self, URLMethods}; use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::global::GlobalRef; @@ -10,7 +11,6 @@ use dom::bindings::str::USVString; use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::urlhelper::UrlHelper; use std::borrow::ToOwned; -use std::cell::RefCell; use url::{Host, ParseResult, Url, UrlParser}; use util::str::DOMString; @@ -20,7 +20,7 @@ pub struct URL { reflector_: Reflector, // https://url.spec.whatwg.org/#concept-urlutils-url - url: RefCell<Url>, + url: DOMRefCell<Url>, // https://url.spec.whatwg.org/#concept-urlutils-get-the-base base: Option<Url>, @@ -30,7 +30,7 @@ impl URL { fn new_inherited(url: Url, base: Option<Url>) -> URL { URL { reflector_: Reflector::new(), - url: RefCell::new(url), + url: DOMRefCell::new(url), base: base, } } |