mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-26 11:45:37 +00:00
Bug 539991 - minor memoization (r=ehsan)
This commit is contained in:
parent
f32be26e5b
commit
0a4e5e3635
@ -87,6 +87,8 @@ const STATE_RESTORE_FINISHED = 3;
|
||||
//// PrivateBrowsingService
|
||||
|
||||
function PrivateBrowsingService() {
|
||||
this._obs = Cc["@mozilla.org/observer-service;1"].
|
||||
getService(Ci.nsIObserverService);
|
||||
this._obs.addObserver(this, "profile-after-change", true);
|
||||
this._obs.addObserver(this, "quit-application-granted", true);
|
||||
this._obs.addObserver(this, "private-browsing", true);
|
||||
@ -95,22 +97,12 @@ function PrivateBrowsingService() {
|
||||
}
|
||||
|
||||
PrivateBrowsingService.prototype = {
|
||||
// Observer Service
|
||||
__obs: null,
|
||||
get _obs() {
|
||||
if (!this.__obs)
|
||||
this.__obs = Cc["@mozilla.org/observer-service;1"].
|
||||
getService(Ci.nsIObserverService);
|
||||
return this.__obs;
|
||||
},
|
||||
|
||||
// Preferences Service
|
||||
__prefs: null,
|
||||
get _prefs() {
|
||||
if (!this.__prefs)
|
||||
this.__prefs = Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefBranch);
|
||||
return this.__prefs;
|
||||
let prefs = Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefBranch);
|
||||
this.__defineGetter__("_prefs", function() prefs);
|
||||
return this._prefs;
|
||||
},
|
||||
|
||||
// Whether the private browsing mode is currently active or not.
|
||||
|
Loading…
Reference in New Issue
Block a user