diff --git a/components/AboutGroup.js b/components/AboutGroup.js index a280cfab..f7a97d84 100644 --- a/components/AboutGroup.js +++ b/components/AboutGroup.js @@ -33,10 +33,8 @@ * * ***** END LICENSE BLOCK ******/ -const IOService = Components.classes['@mozilla.org/network/io-service;1'] - .getService(Components.interfaces.nsIIOService); - Components.utils.import('resource://gre/modules/XPCOMUtils.jsm'); +Components.utils.import('resource://gre/modules/Services.jsm'); function AboutGroup() { @@ -49,7 +47,7 @@ AboutGroup.prototype = { newChannel : function(aURI) { - return IOService.newChannel('chrome://treestyletab/content/group.xul', null, null); + return Services.io.newChannel('chrome://treestyletab/content/group.xul', null, null); }, getURIFlags : function(aURI) diff --git a/modules/tabbarDNDObserver.js b/modules/tabbarDNDObserver.js index ccb891ab..128f07b0 100644 --- a/modules/tabbarDNDObserver.js +++ b/modules/tabbarDNDObserver.js @@ -48,8 +48,7 @@ const SSS = Cc['@mozilla.org/content/style-sheet-service;1'] .getService(Ci.nsIStyleSheetService); const SecMan = Cc['@mozilla.org/scriptsecuritymanager;1'] .getService(Ci.nsIScriptSecurityManager); -const IOService = Services.io; - + function TabbarDNDObserver(aTabBrowser) { this.init(aTabBrowser); @@ -1151,7 +1150,7 @@ catch(e) { .split('\n')[0]]; case 'application/x-moz-file': - let fileHandler = IOService.getProtocolHandler('file') + let fileHandler = Services.io.getProtocolHandler('file') .QueryInterface(Ci.nsIFileProtocolHandler); return [fileHandler.getURLSpecFromFile(aData)]; } diff --git a/modules/utils.js b/modules/utils.js index 9d20936e..73d955ae 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -276,14 +276,6 @@ var TreeStyleTabUtils = { }, _SessionStore : null, - get IOService() { - if (!this._IOService) { - this._IOService = Services.io; - } - return this._IOService; - }, - _IOService : null, - get WindowMediator() { if (!this._WindowMediator) { this._WindowMediator = Services.wm; @@ -1141,13 +1133,13 @@ var TreeStyleTabUtils = { var newURI; aURI = aURI || ''; if (aURI && String(aURI).indexOf('file:') == 0) { - var fileHandler = this.IOService.getProtocolHandler('file').QueryInterface(Ci.nsIFileProtocolHandler); + var fileHandler = Services.io.getProtocolHandler('file').QueryInterface(Ci.nsIFileProtocolHandler); var tempLocalFile = fileHandler.getFileFromURLSpec(aURI); - newURI = this.IOService.newFileURI(tempLocalFile); + newURI = Services.io.newFileURI(tempLocalFile); } else { if (!/^\w+\:/.test(aURI)) aURI = 'http://'+aURI; - newURI = this.IOService.newURI(aURI, null, null); + newURI = Services.io.newURI(aURI, null, null); } return newURI; },