Replace the 'GlobalStaticData' free function by a 'new' static member function.

This commit is contained in:
Ms2ger 2015-01-29 18:27:31 +01:00
parent 8f351cdc32
commit bfddd1ec53
2 changed files with 7 additions and 5 deletions

View file

@ -55,10 +55,12 @@ pub struct GlobalStaticData {
pub windowproxy_handler: WindowProxyHandler, pub windowproxy_handler: WindowProxyHandler,
} }
/// Creates a new GlobalStaticData. impl GlobalStaticData {
pub fn GlobalStaticData() -> GlobalStaticData { /// Creates a new GlobalStaticData.
GlobalStaticData { pub fn new() -> GlobalStaticData {
windowproxy_handler: browsercontext::new_window_proxy_handler(), GlobalStaticData {
windowproxy_handler: browsercontext::new_window_proxy_handler(),
}
} }
} }

View file

@ -133,7 +133,7 @@ impl Page {
constellation_chan: ConstellationChan, constellation_chan: ConstellationChan,
js_context: Rc<Cx>) -> Page { js_context: Rc<Cx>) -> Page {
let js_info = JSPageInfo { let js_info = JSPageInfo {
dom_static: GlobalStaticData(), dom_static: GlobalStaticData::new(),
js_context: js_context, js_context: js_context,
}; };
let layout_rpc: Box<LayoutRPC> = { let layout_rpc: Box<LayoutRPC> = {