Bug 957184 - Replace |.getService() .QueryInterface(iid)| by |.getService(iid)| in comm-central. r=florian, r=Neil, r=mkmelin

This commit is contained in:
Hessam Salehi 2014-04-01 07:57:32 -04:00
Родитель 108524a39e
Коммит 87a6509c36
13 изменённых файлов: 31 добавлений и 34 удалений

Просмотреть файл

@ -717,8 +717,8 @@ function GetExtensionBasedOnMimeType(aMIMEType)
{
try {
var mimeService = null;
mimeService = Components.classes["@mozilla.org/mime;1"].getService();
mimeService = mimeService.QueryInterface(Components.interfaces.nsIMIMEService);
mimeService = Components.classes["@mozilla.org/mime;1"]
.getService(Components.interfaces.nsIMIMEService);
var fileExtension = mimeService.getPrimaryExtension(aMIMEType, null);

Просмотреть файл

@ -292,8 +292,8 @@ function LoadPreviewImage()
let uri = Services.io.newURI(imageSrc, null, null);
if (uri)
{
let imgCacheService = Components.classes["@mozilla.org/image/cache;1"].getService();
let imgCache = imgCacheService.QueryInterface(Components.interfaces.imgICache);
let imgCache = Components.classes["@mozilla.org/image/cache;1"]
.getService(Components.interfaces.imgICache);
// This returns error if image wasn't in the cache; ignore that
imgCache.removeEntry(uri);

Просмотреть файл

@ -425,8 +425,8 @@ EngineView.prototype = {
},
getSourceIndexFromDrag: function () {
var dragService = Cc["@mozilla.org/widget/dragservice;1"].
getService().QueryInterface(Ci.nsIDragService);
var dragService = Cc["@mozilla.org/widget/dragservice;1"]
.getService(Ci.nsIDragService);
var dragSession = dragService.getCurrentSession();
var transfer = Cc["@mozilla.org/widget/transferable;1"].
createInstance(Ci.nsITransferable);

Просмотреть файл

@ -14,8 +14,8 @@ var selectElementIndexTable = null;
var gNumberOfCols = 0;
var gDragService = Components.classes["@mozilla.org/widget/dragservice;1"].getService();
gDragService = gDragService.QueryInterface(Components.interfaces.nsIDragService);
var gDragService = Components.classes["@mozilla.org/widget/dragservice;1"]
.getService(Components.interfaces.nsIDragService);
var test_addresses_sequence = false;

Просмотреть файл

@ -16,8 +16,8 @@ var gSkipFirstRecordButton;
function OnLoadFieldMapImport()
{
top.importService = Components.classes["@mozilla.org/import/import-service;1"].getService();
top.importService = top.importService.QueryInterface(Components.interfaces.nsIImportService);
top.importService = Components.classes["@mozilla.org/import/import-service;1"]
.getService(Components.interfaces.nsIImportService);
// We need a field map object...
// assume we have one passed in? or just make one?

Просмотреть файл

@ -134,8 +134,8 @@ function Init()
}
// Note: set encoding BEFORE setting "ref" (important!)
var RDF = Components.classes[RDFSERVICE_CONTRACTID].getService();
if (RDF) RDF = RDF.QueryInterface(nsIRDFService);
var RDF = Components.classes[RDFSERVICE_CONTRACTID]
.getService(nsIRDFService);
if (RDF) {
loadingArc = RDF.GetResource(NC_LOADING, true);

Просмотреть файл

@ -31,12 +31,12 @@ function Startup() {
// cookieManager
// xpconnect to cookiemanager/permissionmanager/promptservice interfaces
cookiemanager = Components.classes["@mozilla.org/cookiemanager;1"].getService();
cookiemanager = cookiemanager.QueryInterface(Components.interfaces.nsICookieManager);
permissionmanager = Components.classes["@mozilla.org/permissionmanager;1"].getService();
permissionmanager = permissionmanager.QueryInterface(Components.interfaces.nsIPermissionManager);
promptservice = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService();
promptservice = promptservice.QueryInterface(Components.interfaces.nsIPromptService);
cookiemanager = Components.classes["@mozilla.org/cookiemanager;1"]
.getService(Components.interfaces.nsICookieManager);
permissionmanager = Components.classes["@mozilla.org/permissionmanager;1"]
.getService(Components.interfaces.nsIPermissionManager);
promptservice = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
// intialize gDateService
if (!gDateService) {

Просмотреть файл

@ -4,9 +4,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// the rdf service
var RDF = '@mozilla.org/rdf/rdf-service;1'
RDF = Components.classes[RDF].getService();
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService);
var RDF = Components.classes["@mozilla.org/rdf/rdf-service;"]
.getService(Components.interfaces.nsIRDFService);
var NC = "http://home.netscape.com/NC-rdf#";

Просмотреть файл

@ -11,10 +11,8 @@
const CUST_DEBUG = false;
// the rdf service
var RDF = '@mozilla.org/rdf/rdf-service;1'
RDF = Components.classes[RDF].getService();
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService);
var RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"]
.getService(Components.interfaces.nsIRDFService);
var NC = "http://home.netscape.com/NC-rdf#";
var sidebarObj = new Object;

Просмотреть файл

@ -45,9 +45,8 @@ const SB_DEBUG = false;
var gNumTabsInViewPref;
// The rdf service
const RDF_URI = '@mozilla.org/rdf/rdf-service;1';
var RDF = Components.classes[RDF_URI].getService();
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService);
var RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"]
.getService(Components.interfaces.nsIRDFService);
const NC = "http://home.netscape.com/NC-rdf#";

Просмотреть файл

@ -23,8 +23,8 @@ var gBccButton;
var gActivatedButton;
var gDragService = Components.classes["@mozilla.org/widget/dragservice;1"].getService();
gDragService = gDragService.QueryInterface(Components.interfaces.nsIDragService);
var gDragService = Components.classes["@mozilla.org/widget/dragservice;1"]
.getService(Components.interfaces.nsIDragService);
var gSelectAddressesAbViewListener = {
onSelectionChanged: function() {

Просмотреть файл

@ -10,8 +10,9 @@ var selectElementIndexTable = null;
var gNumberOfCols = 0;
var gDragService = Components.classes["@mozilla.org/widget/dragservice;1"].getService();
gDragService = gDragService.QueryInterface(Components.interfaces.nsIDragService);
var gDragService = Components.classes["@mozilla.org/widget/dragservice;1"]
.getService(Components.interfaces.nsIDragService);
var gMimeHeaderParser = null;
/**

Просмотреть файл

@ -221,8 +221,8 @@ function messagePaneOnClick(event)
// not put up a new browser window. we should just let the usual processing
// take place.
try {
var extProtService = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"].getService();
extProtService = extProtService.QueryInterface(Components.interfaces.nsIExternalProtocolService);
var extProtService = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
.getService(Components.interfaces.nsIExternalProtocolService);
var scheme = href.substring(0, href.indexOf(":"));
if (!extProtService.isExposedProtocol(scheme))
return true;