Store proxy handlers in a static array rather than a hashtable per window.

This commit is contained in:
Ms2ger 2014-07-11 17:03:31 +02:00
parent f47b66b0c1
commit fd167f8922
4 changed files with 85 additions and 38 deletions

View file

@ -11,10 +11,9 @@ use dom::browsercontext;
use dom::window;
use servo_util::str::DOMString;
use std::collections::hashmap::HashMap;
use libc;
use libc::c_uint;
use std::cell::{Cell, RefCell};
use std::cell::Cell;
use std::mem;
use std::cmp::PartialEq;
use std::ptr;
@ -52,13 +51,11 @@ use js;
#[allow(raw_pointer_deriving)]
#[deriving(Encodable)]
pub struct GlobalStaticData {
pub proxy_handlers: Untraceable<RefCell<HashMap<uint, *libc::c_void>>>,
pub windowproxy_handler: Untraceable<*libc::c_void>,
}
pub fn GlobalStaticData() -> GlobalStaticData {
GlobalStaticData {
proxy_handlers: Untraceable::new(RefCell::new(HashMap::new())),
windowproxy_handler: Untraceable::new(browsercontext::new_window_proxy_handler()),
}
}