Refactor util::prefs operations to be methods on static struct.

This commit is contained in:
Corey Farwell 2016-07-02 13:51:17 -04:00
parent 307844a8c1
commit 22928f50ac
30 changed files with 166 additions and 162 deletions

View file

@ -62,7 +62,7 @@ use string_cache::Atom;
use time;
use timers::{OneshotTimerCallback, OneshotTimerHandle};
use url::{Url, Position};
use util::prefs::mozbrowser_enabled;
use util::prefs::PREFS;
#[derive(JSTraceable, PartialEq, Copy, Clone, HeapSizeOf)]
enum XMLHttpRequestState {
@ -581,8 +581,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
// story. See https://github.com/servo/servo/issues/9582
if let GlobalRoot::Window(win) = self.global() {
let is_root_pipeline = win.parent_info().is_none();
let is_mozbrowser_enabled = mozbrowser_enabled();
is_root_pipeline && is_mozbrowser_enabled
is_root_pipeline && PREFS.is_mozbrowser_enabled()
} else {
false
}