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

Undo certain parts from the unfortunate "service" commit, to unbreak Muttator. @Kris: Please try not to

commit unconnected things at once, as it's much harder to revert such commits :( I'll have to revert
the service -> Cc/Ci manually now, as I got lots of conflicts in reverting, and if i didn't, i wouldn't
want to undo the other parts of that commit (like VIMPERATOR_RUNTIME or the added comments)
This commit is contained in:
Martin Stubenschrott
2008-12-23 03:10:01 +01:00
parent 90d7eb0d17
commit feeccb23d2
10 changed files with 72 additions and 59 deletions

View File

@@ -1,35 +1,34 @@
/** @scope modules */
let (cc = function (class, iface, meth) { try { return Cc[class][meth || "getService"](iface) } catch (e) {} })
let (cc = function (class, iface, meth) { try { return Components.classes[class][meth || "getService"](iface) } catch (e) {} })
{
// var Ci = Components.interfaces; // quick fix for muttator, will change/remove service.js anyway after the vacation
/**
* Cached XPCOM services and instances.
*
* @singleton
*/
const service = {
appStartup: cc("@mozilla.org/toolkit/app-startup;1", Ci.nsIAppStartup),
autoCompleteSearch: cc("@mozilla.org/browser/global-history;2", Ci.nsIAutoCompleteSearch),
browserSearch: cc("@mozilla.org/browser/search-service;1", Ci.nsIBrowserSearchService),
cache: cc("@mozilla.org/network/cache-service;1", Ci.nsICacheService),
console: cc("@mozilla.org/consoleservice;1", Ci.nsIConsoleService),
directory: cc("@mozilla.org/file/directory_service;1", Ci.nsIProperties),
environment: cc("@mozilla.org/process/environment;1", Ci.nsIEnvironment),
extensionManager: cc("@mozilla.org/extensions/manager;1", Ci.nsIExtensionManager),
io: cc("@mozilla.org/network/io-service;1", Ci.nsIIOService).QueryInterface(Ci.nsIIOService2),
json: cc("@mozilla.org/dom/json;1", Ci.nsIJSON, "createInstance"),
observer: cc("@mozilla.org/observer-service;1", Ci.nsIObserverService),
profile: cc("@mozilla.org/toolkit/profile-service;1", Ci.nsIToolkitProfileService),
pref: cc("@mozilla.org/preferences-service;1", Ci.nsIPrefService)
.QueryInterface(Ci.nsIPrefBranch).QueryInterface(Ci.nsIPrefBranch2),
sessionStore: cc("@mozilla.org/browser/sessionstore;1", Ci.nsISessionStore),
subscriptLoader: cc("@mozilla.org/moz/jssubscript-loader;1", Ci.mozIJSSubScriptLoader),
threadManager: cc("@mozilla.org/thread-manager;1", Ci.nsIThreadManager),
windowMediator: cc("@mozilla.org/appshell/window-mediator;1", Ci.nsIWindowMediator),
windowWatcher: cc("@mozilla.org/embedcomp/window-watcher;1", Ci.nsIWindowWatcher),
getFile: function () Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile),
getFind: function () Cc["@mozilla.org/embedcomp/rangefind;1"].createInstance(Ci.nsIFind),
getProcess: function () Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess)
appStartup: cc("@mozilla.org/toolkit/app-startup;1", Components.interfaces.nsIAppStartup),
autoCompleteSearch: cc("@mozilla.org/browser/global-history;2", Components.interfaces.nsIAutoCompleteSearch),
browserSearch: cc("@mozilla.org/browser/search-service;1", Components.interfaces.nsIBrowserSearchService),
cache: cc("@mozilla.org/network/cache-service;1", Components.interfaces.nsICacheService),
console: cc("@mozilla.org/consoleservice;1", Components.interfaces.nsIConsoleService),
directory: cc("@mozilla.org/file/directory_service;1", Components.interfaces.nsIProperties),
environment: cc("@mozilla.org/process/environment;1", Components.interfaces.nsIEnvironment),
extensionManager: cc("@mozilla.org/extensions/manager;1", Components.interfaces.nsIExtensionManager),
json: cc("@mozilla.org/dom/json;1", Components.interfaces.nsIJSON, "createInstance"),
observer: cc("@mozilla.org/observer-service;1", Components.interfaces.nsIObserverService),
profile: cc("@mozilla.org/toolkit/profile-service;1", Components.interfaces.nsIToolkitProfileService),
sessionStore: cc("@mozilla.org/browser/sessionstore;1", Components.interfaces.nsISessionStore),
subscriptLoader: cc("@mozilla.org/moz/jssubscript-loader;1", Components.interfaces.mozIJSSubScriptLoader),
threadManager: cc("@mozilla.org/thread-manager;1", Components.interfaces.nsIThreadManager),
windowMediator: cc("@mozilla.org/appshell/window-mediator;1", Components.interfaces.nsIWindowMediator),
windowWatcher: cc("@mozilla.org/embedcomp/window-watcher;1", Components.interfaces.nsIWindowWatcher),
getFile: function () Cc["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile),
getFind: function () Cc["@mozilla.org/embedcomp/rangefind;1"].createInstance(Components.interfaces.nsIFind),
getProcess: function () Cc["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess)
};
};