1 /* See license.txt for terms of usage */
  2 
  3 function fbXPCOMUtils() {}
  4 
  5 (function() {
  6 
  7 // ************************************************************************************************
  8 // XPCOM Utilities
  9 
 10 var _CI = Components.interfaces;
 11 var _CC = Components.classes;
 12 
 13 this.CCSV = function(cName, ifaceName)
 14 {
 15 	if (_CC[cName])
 16 		return _CC[cName].getService(_CI[ifaceName]);  // if fbs fails to load, the error can be _CC[cName] has no properties
 17 	else
 18 		throw new Error("Firebug CCSV fails for cName:"+cName);
 19 };
 20 
 21 this.CCIN = function(cName, ifaceName)
 22 {
 23     return _CC[cName].createInstance(_CI[ifaceName]);
 24 };
 25 
 26 this.QI = function(obj, iface)
 27 {
 28     return obj.QueryInterface(iface);
 29 };
 30 
 31 // ************************************************************************************************
 32 
 33 }).apply(fbXPCOMUtils);
 34