1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 09:27:58 +01:00

Add "io" to the services cache.

This commit is contained in:
Doug Kearns
2009-01-05 21:47:49 +11:00
parent 49e0c091c1
commit 698cdb19c2
5 changed files with 14 additions and 15 deletions

View File

@@ -67,7 +67,7 @@ function IO() //{{{
const EXTENSION_NAME = config.name.toLowerCase(); // "vimperator" or "muttator"
const downloadManager = Cc["@mozilla.org/download-manager;1"].createInstance(Ci.nsIDownloadManager);
const ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
const ioService = services.get("io");
var processDir = services.get("directory").get("CurWorkD", Ci.nsIFile);
var cwd = processDir;

View File

@@ -45,6 +45,7 @@ function Services()
get: function (name) services[name],
create: function (name) classes[name]()
};
self.add("appStartup", "@mozilla.org/toolkit/app-startup;1", Ci.nsIAppStartup);
self.add("autoCompleteSearch", "@mozilla.org/browser/global-history;2", Ci.nsIAutoCompleteSearch);
self.add("browserSearch", "@mozilla.org/browser/search-service;1", Ci.nsIBrowserSearchService);
@@ -55,6 +56,7 @@ function Services()
self.add("extensionManager", "@mozilla.org/extensions/manager;1", Ci.nsIExtensionManager);
self.add("json", "@mozilla.org/dom/json;1", Ci.nsIJSON, "createInstance");
self.add("observer", "@mozilla.org/observer-service;1", Ci.nsIObserverService);
self.add("io", "@mozilla.org/network/io-service;1", Ci.nsIIOService);
self.add("pref", "@mozilla.org/preferences-service;1", [Ci.nsIPrefService, Ci.nsIPrefBranch, Ci.nsIPrefBranch2]);
self.add("profile", "@mozilla.org/toolkit/profile-service;1", Ci.nsIToolkitProfileService);
self.add("sessionStore", "@mozilla.org/browser/sessionstore;1", Ci.nsISessionStore);
@@ -66,8 +68,10 @@ function Services()
self.addClass("file", "@mozilla.org/file/local;1", Ci.nsILocalFile);
self.addClass("find", "@mozilla.org/embedcomp/rangefind;1", Ci.nsIFind);
self.addClass("process", "@mozilla.org/process/util;1", Ci.nsIProcess);
return self;
};
var services = Services();
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -253,7 +253,7 @@ function Styles(name, store, serial)
const sleep = liberator.sleep;
const storage = modules.storage;
const consoleService = Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService);
const ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
const ios = services.get("io");
const sss = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService);
const namespace = '@namespace html "' + XHTML + '";\n' +
'@namespace xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";\n' +

View File

@@ -434,8 +434,7 @@ const util = { //{{{
// FIXME: createURI needed too?
newURI: function (uri)
{
const ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
return ioService.newURI(uri, null, null);
return services.get("io").newURI(uri, null, null);
},
/**

View File

@@ -430,16 +430,12 @@ const config = { //{{{
{
setter: function (value)
{
const ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService2);
const ioService = services.get("io");
ioService.offline = !value;
gPrefService.setBoolPref("browser.offline", ioService.offline);
return value;
},
getter: function ()
{
const ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService2);
return !ioService.offline;
}
getter: function () !services.get("io").offline
});
options.add(["titlestring"],