Use DOMRefCell for URLSearchParams.

This commit is contained in:
Tetsuharu OHZEKI 2014-10-21 02:16:03 +09:00
parent 38ddddd1ca
commit 6d089a87d5

View file

@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::URLSearchParamsBinding; use dom::bindings::codegen::Bindings::URLSearchParamsBinding;
use dom::bindings::codegen::Bindings::URLSearchParamsBinding::URLSearchParamsMethods; use dom::bindings::codegen::Bindings::URLSearchParamsBinding::URLSearchParamsMethods;
use dom::bindings::codegen::UnionTypes::StringOrURLSearchParams::{StringOrURLSearchParams, eURLSearchParams, eString}; use dom::bindings::codegen::UnionTypes::StringOrURLSearchParams::{StringOrURLSearchParams, eURLSearchParams, eString};
@ -15,21 +16,20 @@ use servo_util::str::DOMString;
use encoding::all::UTF_8; use encoding::all::UTF_8;
use encoding::types::{EncodingRef, EncodeReplace}; use encoding::types::{EncodingRef, EncodeReplace};
use std::cell::RefCell;
use std::collections::hashmap::HashMap; use std::collections::hashmap::HashMap;
use std::fmt::radix; use std::fmt::radix;
use std::ascii::OwnedStrAsciiExt; use std::ascii::OwnedStrAsciiExt;
#[dom_struct] #[dom_struct]
pub struct URLSearchParams { pub struct URLSearchParams {
data: RefCell<HashMap<DOMString, Vec<DOMString>>>, data: DOMRefCell<HashMap<DOMString, Vec<DOMString>>>,
reflector_: Reflector, reflector_: Reflector,
} }
impl URLSearchParams { impl URLSearchParams {
fn new_inherited() -> URLSearchParams { fn new_inherited() -> URLSearchParams {
URLSearchParams { URLSearchParams {
data: RefCell::new(HashMap::new()), data: DOMRefCell::new(HashMap::new()),
reflector_: Reflector::new(), reflector_: Reflector::new(),
} }
} }