TOP-1614671-port1456035-4-and-5-61a1-cc.patch 73 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006
  1. # HG changeset patch
  2. # User Ian Neal <iann_cvs@blueyonder.co.uk>
  3. # Date 1581435120 -3600
  4. # Parent 10fa8911ada5a6afab1a7c6f0e9eb849d8c786f8
  5. Bug 1614671 - Port |Bug 1456035 Part 4 - Convert callers of XPCOMUtils.generateQI to ChromeUtils.generateQI|, |Bug 1456035 Part 5 - Convert manual QueryInterface to ChromeUtils.generateQI| and |Bug 1460092 - Add ESLint rule to enforce use of ChromeUtils.generateQI| to SeaMonkey. r=frg
  6. diff --git a/suite/base/content/viewZoomOverlay.js b/suite/base/content/viewZoomOverlay.js
  7. --- a/suite/base/content/viewZoomOverlay.js
  8. +++ b/suite/base/content/viewZoomOverlay.js
  9. @@ -29,20 +29,20 @@ var FullZoom = FullZoom || {
  10. get siteSpecific() {
  11. return this._siteSpecificPref;
  12. },
  13. //**************************************************************************//
  14. // nsISupports
  15. QueryInterface:
  16. - XPCOMUtils.generateQI([Ci.nsIObserver,
  17. - Ci.nsIContentPrefObserver,
  18. - Ci.nsIContentPrefCallback2,
  19. - Ci.nsISupportsWeakReference]),
  20. + ChromeUtils.generateQI([Ci.nsIObserver,
  21. + Ci.nsIContentPrefObserver,
  22. + Ci.nsIContentPrefCallback2,
  23. + Ci.nsISupportsWeakReference]),
  24. //**************************************************************************//
  25. // Initialization & Destruction
  26. init: function FullZoom_init() {
  27. // Listen for scrollwheel events so we can save scrollwheel-based changes.
  28. window.addEventListener("wheel", this, true);
  29. diff --git a/suite/browser/browser-places.js b/suite/browser/browser-places.js
  30. --- a/suite/browser/browser-places.js
  31. +++ b/suite/browser/browser-places.js
  32. @@ -788,17 +788,17 @@ var BookmarkingUI = {
  33. PlacesUtils.bookmarks.removeObserver(this);
  34. }
  35. if (this._pendingUpdate) {
  36. delete this._pendingUpdate;
  37. }
  38. },
  39. - QueryInterface: XPCOMUtils.generateQI([
  40. + QueryInterface: ChromeUtils.generateQI([
  41. Ci.nsINavBookmarkObserver
  42. ]),
  43. get _starredTooltip()
  44. {
  45. delete this._starredTooltip;
  46. return this._starredTooltip =
  47. gNavigatorBundle.getString("starButtonOn.tooltip");
  48. diff --git a/suite/browser/navigator.js b/suite/browser/navigator.js
  49. --- a/suite/browser/navigator.js
  50. +++ b/suite/browser/navigator.js
  51. @@ -48,21 +48,20 @@ var gIgnoreClick = false;
  52. // Listeners for updating zoom value in status bar
  53. var ZoomListeners =
  54. {
  55. // Identifies the setting in the content prefs database.
  56. name: "browser.content.full-zoom",
  57. QueryInterface:
  58. - XPCOMUtils.generateQI([Ci.nsIObserver,
  59. - Ci.nsIContentPrefObserver,
  60. - Ci.nsIContentPrefCallback2,
  61. - Ci.nsISupportsWeakReference,
  62. - Ci.nsISupports]),
  63. + ChromeUtils.generateQI([Ci.nsIObserver,
  64. + Ci.nsIContentPrefObserver,
  65. + Ci.nsIContentPrefCallback2,
  66. + Ci.nsISupportsWeakReference]),
  67. init: function ()
  68. {
  69. Cc["@mozilla.org/content-pref/service;1"]
  70. .getService(Ci.nsIContentPrefService2)
  71. .addObserverForName(this.name, this);
  72. Services.prefs.addObserver("browser.zoom.", this, true);
  73. @@ -175,18 +174,18 @@ var gStatusBarPopupIconPrefListener =
  74. popupIcon.hidden = true;
  75. else if (gBrowser.getNotificationBox().popupCount)
  76. popupIcon.hidden = false;
  77. }
  78. };
  79. var gFormSubmitObserver = {
  80. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIFormSubmitObserver,
  81. - Ci.nsIObserver]),
  82. + QueryInterface: ChromeUtils.generateQI([Ci.nsIFormSubmitObserver,
  83. + Ci.nsIObserver]),
  84. panel: null,
  85. init: function()
  86. {
  87. this.panel = document.getElementById("invalid-form-popup");
  88. },
  89. diff --git a/suite/browser/nsBrowserContentHandler.js b/suite/browser/nsBrowserContentHandler.js
  90. --- a/suite/browser/nsBrowserContentHandler.js
  91. +++ b/suite/browser/nsBrowserContentHandler.js
  92. @@ -214,27 +214,21 @@ function doSearch(aSearchTerm, aFeatures
  93. }
  94. var nsBrowserContentHandler = {
  95. get wrappedJSObject() {
  96. return this;
  97. },
  98. /* nsISupports */
  99. - QueryInterface: function QueryInterface(iid) {
  100. - if (iid.equals(nsISupports) ||
  101. - iid.equals(nsICommandLineHandler) ||
  102. - iid.equals(nsICommandLine) ||
  103. - iid.equals(nsICommandLineValidator) ||
  104. - iid.equals(nsIContentHandler) ||
  105. - iid.equals(nsIFactory))
  106. - return this;
  107. -
  108. - throw Cr.NS_ERROR_NO_INTERFACE;
  109. - },
  110. + QueryInterface: ChromeUtils.generateQI([Ci.nsICommandLineHandler,
  111. + Ci.nsICommandLine,
  112. + Ci.nsICommandLineValidator,
  113. + Ci.nsIContentHandler,
  114. + Ci.nsIFactory]),
  115. _handledURI: null,
  116. /* nsICommandLineHandler */
  117. handle: function handle(cmdLine) {
  118. var features = "chrome,all,dialog=no";
  119. try {
  120. var width = cmdLine.handleFlagWithParam("width", false);
  121. diff --git a/suite/browser/nsBrowserContentListener.js b/suite/browser/nsBrowserContentListener.js
  122. --- a/suite/browser/nsBrowserContentListener.js
  123. +++ b/suite/browser/nsBrowserContentListener.js
  124. @@ -59,25 +59,19 @@ nsBrowserContentListener.prototype =
  125. },
  126. close: function()
  127. {
  128. this.contentWindow = null;
  129. var uriLoader = Cc["@mozilla.org/uriloader;1"].getService(Ci.nsIURILoader);
  130. uriLoader.unRegisterContentListener(this);
  131. },
  132. - QueryInterface: function(iid)
  133. - {
  134. - if (iid.equals(Ci.nsIURIContentListener) ||
  135. - iid.equals(Ci.nsISupportsWeakReference) ||
  136. - iid.equals(Ci.nsISupports))
  137. - return this;
  138. - throw Cr.NS_ERROR_NO_INTERFACE;
  139. - },
  140. + QueryInterface: ChromeUtils.generateQI([Ci.nsIURIContentListener,
  141. + Ci.nsISupportsWeakReference]),
  142. doContent: function(contentType, isContentPreferred, request, contentHandler)
  143. {
  144. // forward the doContent to our content area webshell
  145. var docShell = this.contentWindow.docShell;
  146. if (Services.prefs.getIntPref("browser.link.open_external") == nsIBrowserDOMWindow.OPEN_NEWTAB) {
  147. var newTab = gBrowser.loadOneTab("about:blank", {
  148. inBackground: Services.prefs.getBoolPref("browser.tabs.loadDivertedInBackground")});
  149. diff --git a/suite/browser/nsBrowserStatusHandler.js b/suite/browser/nsBrowserStatusHandler.js
  150. --- a/suite/browser/nsBrowserStatusHandler.js
  151. +++ b/suite/browser/nsBrowserStatusHandler.js
  152. @@ -13,25 +13,19 @@ nsBrowserStatusHandler.prototype =
  153. // Stored Status, Link and Loading values
  154. status : "",
  155. defaultStatus : "",
  156. jsStatus : "",
  157. jsDefaultStatus : "",
  158. overLink : "",
  159. feeds : [],
  160. - QueryInterface : function(aIID)
  161. - {
  162. - if (aIID.equals(Ci.nsIWebProgressListener) ||
  163. - aIID.equals(Ci.nsISupportsWeakReference) ||
  164. - aIID.equals(Ci.nsIXULBrowserWindow) ||
  165. - aIID.equals(Ci.nsISupports))
  166. - return this;
  167. - throw Cr.NS_NOINTERFACE;
  168. - },
  169. + QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener,
  170. + Ci.nsISupportsWeakReference,
  171. + Ci.nsIXULBrowserWindow]),
  172. init : function()
  173. {
  174. this.urlBar = document.getElementById("urlbar");
  175. this.throbberElement = document.getElementById("navigator-throbber");
  176. this.statusMeter = document.getElementById("statusbar-icon");
  177. this.statusPanel = document.getElementById("statusbar-progresspanel");
  178. this.stopButton = document.getElementById("stop-button");
  179. diff --git a/suite/browser/nsTypeAheadFind.js b/suite/browser/nsTypeAheadFind.js
  180. --- a/suite/browser/nsTypeAheadFind.js
  181. +++ b/suite/browser/nsTypeAheadFind.js
  182. @@ -60,17 +60,17 @@ typeAheadFind.prototype = {
  183. mFound: null,
  184. mLinks: false,
  185. mSearchString: "",
  186. mSelection: null,
  187. mTimer: null,
  188. mXULBrowserWindow: null,
  189. /* nsISupports */
  190. - QueryInterface: XPCOMUtils.generateQI([
  191. + QueryInterface: ChromeUtils.generateQI([
  192. Ci.nsISupportsWeakReference,
  193. Ci.nsIObserver,
  194. Ci.nsITimerCallback,
  195. Ci.nsISelectionListener]),
  196. /* nsIObserver */
  197. observe: function(aSubject, aTopic, aData) {
  198. if (aTopic == "app-startup") {
  199. diff --git a/suite/browser/tabbrowser.xml b/suite/browser/tabbrowser.xml
  200. --- a/suite/browser/tabbrowser.xml
  201. +++ b/suite/browser/tabbrowser.xml
  202. @@ -746,24 +746,20 @@
  203. return allowRefresh;
  204. },
  205. addFeed: function(aLink)
  206. {
  207. this.mFeeds.push(aLink);
  208. },
  209. - QueryInterface: function(aIID) {
  210. - if (aIID.equals(Ci.nsIWebProgressListener) ||
  211. - aIID.equals(Ci.nsIWebProgressListener2) ||
  212. - aIID.equals(Ci.nsISupportsWeakReference) ||
  213. - aIID.equals(Ci.nsISupports))
  214. - return this;
  215. - throw Cr.NS_NOINTERFACE;
  216. - }
  217. + QueryInterface: ChromeUtils.generateQI([
  218. + Ci.nsIWebProgressListener,
  219. + Ci.nsIWebProgressListener2,
  220. + Ci.nsISupportsWeakReference]),
  221. });
  222. ]]>
  223. </body>
  224. </method>
  225. <method name="mInstallSH">
  226. <parameter name="aBrowser"/>
  227. <parameter name="aSH"/>
  228. @@ -801,24 +797,19 @@
  229. onStatusChange : function(aWebProgress, aRequest, aStatus, aMessage)
  230. {
  231. },
  232. onSecurityChange : function(aWebProgress, aRequest, aState)
  233. {
  234. },
  235. - QueryInterface : function(aIID)
  236. - {
  237. - if (aIID.equals(Ci.nsIWebProgressListener) ||
  238. - aIID.equals(Ci.nsISupportsWeakReference) ||
  239. - aIID.equals(Ci.nsISupports))
  240. - return this;
  241. - throw Cr.NS_NOINTERFACE;
  242. - }
  243. + QueryInterface : ChromeUtils.generateQI([
  244. + Ci.nsIWebProgressListener,
  245. + Ci.nsISupportsWeakReference]),
  246. });
  247. ]]>
  248. </body>
  249. </method>
  250. <method name="setIcon">
  251. <parameter name="aTab"/>
  252. <parameter name="aURI"/>
  253. diff --git a/suite/browser/test/browser/browser_bug561636.js b/suite/browser/test/browser/browser_bug561636.js
  254. --- a/suite/browser/test/browser/browser_bug561636.js
  255. +++ b/suite/browser/test/browser/browser_bug561636.js
  256. @@ -17,17 +17,17 @@ function checkPopupHide()
  257. function checkPopupMessage(doc)
  258. {
  259. is(gInvalidFormPopup.firstChild.textContent,
  260. doc.getElementById('i').validationMessage,
  261. "The panel should show the message from validationMessage");
  262. }
  263. var gObserver = {
  264. - QueryInterface : XPCOMUtils.generateQI([Ci.nsIFormSubmitObserver]),
  265. + QueryInterface : ChromeUtils.generateQI([Ci.nsIFormSubmitObserver]),
  266. notifyInvalidSubmit : function (aFormElement, aInvalidElements)
  267. {
  268. }
  269. };
  270. function test()
  271. {
  272. diff --git a/suite/browser/test/browser/browser_bug623155.js b/suite/browser/test/browser/browser_bug623155.js
  273. --- a/suite/browser/test/browser/browser_bug623155.js
  274. +++ b/suite/browser/test/browser/browser_bug623155.js
  275. @@ -53,23 +53,18 @@ function test() {
  276. gBrowser.getBrowserForTab(gNewTab)
  277. .webProgress
  278. .addProgressListener(gWebProgressListener,
  279. Ci.nsIWebProgress
  280. .NOTIFY_LOCATION);
  281. }
  282. var gWebProgressListener = {
  283. - QueryInterface: function(aIID) {
  284. - if (aIID.equals(Ci.nsIWebProgressListener) ||
  285. - aIID.equals(Ci.nsISupportsWeakReference) ||
  286. - aIID.equals(Ci.nsISupports))
  287. - return this;
  288. - throw Cr.NS_NOINTERFACE;
  289. - },
  290. + QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener,
  291. + Ci.nsISupportsWeakReference]),
  292. // ---------------------------------------------------------------------------
  293. // NOTIFY_LOCATION mode should work fine without these methods.
  294. //
  295. //onStateChange: function() {},
  296. //onStatusChange: function() {},
  297. //onProgressChange: function() {},
  298. //onSecurityChange: function() {},
  299. diff --git a/suite/components/bindings/findbar.xml b/suite/components/bindings/findbar.xml
  300. --- a/suite/components/bindings/findbar.xml
  301. +++ b/suite/components/bindings/findbar.xml
  302. @@ -41,24 +41,18 @@
  303. prefsvc.getBoolPref("accessibility.typeaheadfind.autostart");
  304. this._useFindbar =
  305. prefsvc.getBoolPref("accessibility.typeaheadfind.usefindbar");
  306. ]]></constructor>
  307. <field name="_suiteObserver"><![CDATA[({
  308. _self: this,
  309. - QueryInterface: function(aIID) {
  310. - if (aIID.equals(Ci.nsIObserver) ||
  311. - aIID.equals(Ci.nsISupportsWeakReference) ||
  312. - aIID.equals(Ci.nsISupports))
  313. - return this;
  314. -
  315. - throw Cr.NS_ERROR_NO_INTERFACE;
  316. - },
  317. + QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
  318. + Ci.nsISupportsWeakReference]),
  319. observe: function(aSubject, aTopic, aPrefName) {
  320. if (aTopic != "nsPref:changed")
  321. return;
  322. var prefsvc =
  323. aSubject.QueryInterface(Ci.nsIPrefBranch);
  324. diff --git a/suite/components/bindings/notification.xml b/suite/components/bindings/notification.xml
  325. --- a/suite/components/bindings/notification.xml
  326. +++ b/suite/components/bindings/notification.xml
  327. @@ -1580,18 +1580,19 @@
  328. optInCB.checked = Services.prefs.getBoolPref("dom.ipc.plugins.reportCrashURL");
  329. }
  330. // If we're showing the link to manually trigger report submission, we'll
  331. // want to be able to update all the instances of the UI for this crash to
  332. // show an updated message when a report is submitted.
  333. if (doPrompt) {
  334. let observer = {
  335. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
  336. - Ci.nsISupportsWeakReference]),
  337. + QueryInterface: ChromeUtils.generateQI([
  338. + Ci.nsIObserver,
  339. + Ci.nsISupportsWeakReference]),
  340. observe: function(subject, topic, data) {
  341. let propertyBag = subject;
  342. if (!(propertyBag instanceof Ci.nsIPropertyBag2))
  343. return;
  344. // Ignore notifications for other crashes.
  345. if (propertyBag.get("minidumpID") != pluginDumpID)
  346. return;
  347. statusDiv.setAttribute("status", data);
  348. diff --git a/suite/components/console/content/consoleBindings.xml b/suite/components/console/content/consoleBindings.xml
  349. --- a/suite/components/console/content/consoleBindings.xml
  350. +++ b/suite/components/console/content/consoleBindings.xml
  351. @@ -389,22 +389,17 @@
  352. <constructor>this.init();</constructor>
  353. <destructor>this.destroy();</destructor>
  354. <!-- Command controller for the copy command -->
  355. <field name="_controller"><![CDATA[({
  356. _outer: this,
  357. - QueryInterface: function(aIID) {
  358. - if (aIID.equals(Ci.nsIController) ||
  359. - aIID.equals(Ci.nsISupports))
  360. - return this;
  361. - throw Cr.NS_NOINTERFACE;
  362. - },
  363. + QueryInterface: ChromeUtils.generateQI([Ci.nsIController]),
  364. supportsCommand: function(aCommand) {
  365. return aCommand == "cmd_copy";
  366. },
  367. isCommandEnabled: function(aCommand) {
  368. return aCommand == "cmd_copy" && this._outer.selectedItem;
  369. },
  370. diff --git a/suite/components/console/jsconsole-clhandler.js b/suite/components/console/jsconsole-clhandler.js
  371. --- a/suite/components/console/jsconsole-clhandler.js
  372. +++ b/suite/components/console/jsconsole-clhandler.js
  373. @@ -22,12 +22,12 @@ jsConsoleHandler.prototype = {
  374. if (cmdLine.state == Ci.nsICommandLine.STATE_REMOTE_AUTO)
  375. cmdLine.preventDefault = true;
  376. },
  377. helpInfo : " --suiteconsole Open the Error console.\n",
  378. classID: Components.ID("{afeee354-8c99-4725-adb1-8502218c5c3c}"),
  379. - QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),
  380. + QueryInterface: ChromeUtils.generateQI([Ci.nsICommandLineHandler]),
  381. };
  382. this.NSGetFactory = XPCOMUtils.generateNSGetFactory([jsConsoleHandler]);
  383. diff --git a/suite/components/dataman/content/dataman.js b/suite/components/dataman/content/dataman.js
  384. --- a/suite/components/dataman/content/dataman.js
  385. +++ b/suite/components/dataman/content/dataman.js
  386. @@ -119,18 +119,18 @@ var gDataman = {
  387. },
  388. debugError: function dataman_debugError(aLogMessage) {
  389. if (this.debug)
  390. Cu.reportError(aLogMessage);
  391. },
  392. // :::::::::: data change observers ::::::::::
  393. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
  394. - Ci.nsIContentPrefObserver]),
  395. + QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
  396. + Ci.nsIContentPrefObserver]),
  397. observe: function co_observe(aSubject, aTopic, aData) {
  398. gDataman.debugMsg("Observed: " + aTopic + " - " + aData);
  399. switch (aTopic) {
  400. case "cookie-changed":
  401. gCookies.reactToChange(aSubject, aData);
  402. break;
  403. case "perm-changed":
  404. diff --git a/suite/components/downloads/DownloadsCommon.jsm b/suite/components/downloads/DownloadsCommon.jsm
  405. --- a/suite/components/downloads/DownloadsCommon.jsm
  406. +++ b/suite/components/downloads/DownloadsCommon.jsm
  407. @@ -67,18 +67,18 @@ const kDownloadsStringsRequiringPluralFo
  408. const kPartialDownloadSuffix = ".part";
  409. const kPrefBranch = Services.prefs.getBranch("browser.download.");
  410. const PREF_DM_BEHAVIOR = "browser.download.manager.behavior";
  411. const PROGRESS_DIALOG_URL = "chrome://communicator/content/downloads/progressDialog.xul";
  412. var PrefObserver = {
  413. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
  414. - Ci.nsISupportsWeakReference]),
  415. + QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
  416. + Ci.nsISupportsWeakReference]),
  417. getPref(name) {
  418. try {
  419. switch (typeof this.prefs[name]) {
  420. case "boolean":
  421. return kPrefBranch.getBoolPref(name);
  422. }
  423. } catch (ex) { }
  424. return this.prefs[name];
  425. diff --git a/suite/components/downloads/content/treeView.js b/suite/components/downloads/content/treeView.js
  426. --- a/suite/components/downloads/content/treeView.js
  427. +++ b/suite/components/downloads/content/treeView.js
  428. @@ -15,17 +15,17 @@ function DownloadTreeView() {
  429. this._searchTerms = [];
  430. this.dateTimeFormatter =
  431. new Services.intl.DateTimeFormat(undefined,
  432. {dateStyle: "short",
  433. timeStyle: "long"});
  434. }
  435. DownloadTreeView.prototype = {
  436. - QueryInterface: XPCOMUtils.generateQI([Ci.nsITreeView]),
  437. + QueryInterface: ChromeUtils.generateQI([Ci.nsITreeView]),
  438. // ***** nsITreeView attributes and methods *****
  439. get rowCount() {
  440. return this._dlList.length;
  441. },
  442. selection: null,
  443. diff --git a/suite/components/downloads/content/uploadProgress.js b/suite/components/downloads/content/uploadProgress.js
  444. --- a/suite/components/downloads/content/uploadProgress.js
  445. +++ b/suite/components/downloads/content/uploadProgress.js
  446. @@ -160,17 +160,17 @@ var gProgressListener = {
  447. onLocationChange: function( aWebProgress, aRequest, aLocation, aFlags ) {
  448. },
  449. onSecurityChange: function( aWebProgress, aRequest, aState ) {
  450. },
  451. // ---------- nsISupports methods ----------
  452. - QueryInterface: XPCOMUtils.generateQI([
  453. + QueryInterface: ChromeUtils.generateQI([
  454. Ci.nsIWebProgressListener2,
  455. Ci.nsIWebProgressListener,
  456. Ci.nsIInterfaceRequestor]),
  457. // ---------- nsIInterfaceRequestor methods ----------
  458. getInterface: function(aIID) {
  459. if (aIID.equals(Ci.nsIPrompt) ||
  460. diff --git a/suite/components/feeds/FeedConverter.js b/suite/components/feeds/FeedConverter.js
  461. --- a/suite/components/feeds/FeedConverter.js
  462. +++ b/suite/components/feeds/FeedConverter.js
  463. @@ -102,17 +102,17 @@ FeedConverter.prototype = {
  464. /**
  465. * Records if the feed was sniffed
  466. */
  467. _sniffed: false,
  468. /**
  469. * See nsISupports.idl
  470. */
  471. - QueryInterface: XPCOMUtils.generateQI(
  472. + QueryInterface: ChromeUtils.generateQI(
  473. [Ci.nsIFeedResultListener,
  474. Ci.nsIStreamConverter,
  475. Ci.nsIStreamListener,
  476. Ci.nsIRequestObserver]),
  477. classID: Components.ID("{88592f45-3866-4c8e-9d8a-ab58b290fcf7}"),
  478. /**
  479. * See nsIStreamConverter.idl
  480. @@ -445,16 +445,16 @@ FeedResultService.prototype = {
  481. // send the holes to the end
  482. resultList.sort();
  483. // and trim the list
  484. resultList.splice(resultList.length - deletions, deletions);
  485. if (resultList.length == 0)
  486. delete this._results[uri.spec];
  487. },
  488. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIFeedResultService]),
  489. + QueryInterface: ChromeUtils.generateQI([Ci.nsIFeedResultService]),
  490. classID: Components.ID("{e5b05e9d-f037-48e4-b9a4-b99476582927}")
  491. };
  492. var components = [FeedConverter,
  493. FeedResultService];
  494. var NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
  495. diff --git a/suite/components/feeds/FeedWriter.js b/suite/components/feeds/FeedWriter.js
  496. --- a/suite/components/feeds/FeedWriter.js
  497. +++ b/suite/components/feeds/FeedWriter.js
  498. @@ -1196,14 +1196,14 @@ FeedWriter.prototype = {
  499. case PREF_VIDEO_SELECTED_ACTION:
  500. case PREF_AUDIO_SELECTED_ACTION:
  501. this._setAlwaysUseCheckedState(feedType);
  502. }
  503. }
  504. },
  505. classID: FEEDWRITER_CID,
  506. - QueryInterface: XPCOMUtils.generateQI([ Ci.nsIDOMGlobalPropertyInitializer,
  507. + QueryInterface: ChromeUtils.generateQI([Ci.nsIDOMGlobalPropertyInitializer,
  508. Ci.nsIObserver])
  509. };
  510. var NSGetFactory = XPCOMUtils.generateNSGetFactory([FeedWriter]);
  511. diff --git a/suite/components/feeds/WebContentConverter.js b/suite/components/feeds/WebContentConverter.js
  512. --- a/suite/components/feeds/WebContentConverter.js
  513. +++ b/suite/components/feeds/WebContentConverter.js
  514. @@ -51,29 +51,29 @@ WebContentConverter.prototype = {
  515. onStopRequest: function onStopRequest() { },
  516. onStartRequest: function onStartRequest(request, context) {
  517. var wccr = Cc[WCCR_CONTRACTID]
  518. .getService(Ci.nsIWebContentConverterService);
  519. wccr.loadPreferredHandler(request);
  520. },
  521. - QueryInterface: XPCOMUtils.generateQI(
  522. + QueryInterface: ChromeUtils.generateQI(
  523. [Ci.nsIStreamConverter,
  524. Ci.nsIStreamListener])
  525. };
  526. var WebContentConverterFactory = {
  527. createInstance: function createInstance(outer, iid) {
  528. if (outer != null)
  529. throw Cr.NS_ERROR_NO_AGGREGATION;
  530. return new WebContentConverter().QueryInterface(iid);
  531. },
  532. - QueryInterface: XPCOMUtils.generateQI(
  533. + QueryInterface: ChromeUtils.generateQI(
  534. [Ci.nsIFactory])
  535. };
  536. function ServiceInfo(contentType, uri, name) {
  537. this._contentType = contentType;
  538. this._uri = uri;
  539. this._name = name;
  540. }
  541. @@ -117,17 +117,17 @@ ServiceInfo.prototype = {
  542. /**
  543. * See nsIWebContentHandlerInfo
  544. */
  545. getHandlerURI: function getHandlerURI(uri) {
  546. return this._uri.replace(/%s/gi, encodeURIComponent(uri));
  547. },
  548. - QueryInterface: XPCOMUtils.generateQI(
  549. + QueryInterface: ChromeUtils.generateQI(
  550. [Ci.nsIWebContentHandlerInfo])
  551. };
  552. function WebContentConverterRegistrar() {
  553. this._contentTypes = { };
  554. this._autoHandleContentTypes = { };
  555. }
  556. @@ -833,16 +833,16 @@ WebContentConverterRegistrar.prototype =
  557. Ci.nsIWebContentHandlerRegistrar,
  558. Ci.nsIObserver,
  559. Ci.nsIFactory],
  560. flags: Ci.nsIClassInfo.DOM_OBJECT}),
  561. /**
  562. * See nsISupports
  563. */
  564. - QueryInterface: XPCOMUtils.generateQI(
  565. + QueryInterface: ChromeUtils.generateQI(
  566. [Ci.nsIWebContentConverterService,
  567. Ci.nsIWebContentHandlerRegistrar,
  568. Ci.nsIObserver,
  569. Ci.nsIFactory])
  570. };
  571. var NSGetFactory = XPCOMUtils.generateNSGetFactory([WebContentConverterRegistrar]);
  572. diff --git a/suite/components/helpviewer/content/help.js b/suite/components/helpviewer/content/help.js
  573. --- a/suite/components/helpviewer/content/help.js
  574. +++ b/suite/components/helpviewer/content/help.js
  575. @@ -574,25 +574,19 @@ nsHelpStatusHandler.prototype = {
  576. onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) {},
  577. onProgressChange : function(aWebProgress, aRequest, aCurSelfProgress,
  578. aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress) {},
  579. onStatusChange : function(aWebProgress, aRequest, aStatus, aMessage) {},
  580. onSecurityChange : function(aWebProgress, aRequest, state) {},
  581. onLocationChange : function(aWebProgress, aRequest, aLocation, aFlags) {
  582. UpdateBackForwardButtons();
  583. },
  584. - QueryInterface : function(aIID) {
  585. - if (aIID.equals(Ci.nsIWebProgressListener) ||
  586. - aIID.equals(Ci.nsISupportsWeakReference) ||
  587. - aIID.equals(Ci.nsIXULBrowserWindow) ||
  588. - aIID.equals(Ci.nsISupports)) {
  589. - return this;
  590. - }
  591. - throw Cr.NS_NOINTERFACE;
  592. - },
  593. + QueryInterface : ChromeUtils.generateQI([Ci.nsIWebProgressListener,
  594. + Ci.nsISupportsWeakReference,
  595. + Ci.nsIXULBrowserWindow]),
  596. init : function() {},
  597. destroy : function() {},
  598. setJSStatus : function(status) {},
  599. setOverLink : function(link, context) {},
  600. onBeforeLinkTraversal: function(originalTarget, linkURI, linkNode, isAppTab) {}
  601. @@ -839,17 +833,11 @@ var helpContentListener = {
  602. isPreferred: function(aContentType, aDesiredContentType) {
  603. return false;
  604. },
  605. canHandleContent: function(aContentType, aIsContentPreferred, aDesiredContentType) {
  606. return false;
  607. },
  608. loadCookie: null,
  609. parentContentListener: null,
  610. - QueryInterface: function (aIID) {
  611. - if (aIID.equals(Ci.nsIURIContentListener) ||
  612. - aIID.equals(Ci.nsISupportsWeakReference) ||
  613. - aIID.equals(Ci.nsISupports))
  614. - return this;
  615. -
  616. - throw Cr.NS_ERROR_NO_INTERFACE;
  617. - }
  618. + QueryInterface: ChromeUtils.generateQI([Ci.nsIURIContentListener,
  619. + Ci.nsISupportsWeakReference]),
  620. };
  621. diff --git a/suite/components/migration/SuiteProfileMigrator.js b/suite/components/migration/SuiteProfileMigrator.js
  622. --- a/suite/components/migration/SuiteProfileMigrator.js
  623. +++ b/suite/components/migration/SuiteProfileMigrator.js
  624. @@ -134,15 +134,15 @@ ProfileMigrator.prototype = {
  625. if (migrator) {
  626. return [key, migrator];
  627. }
  628. }
  629. return ["", null];
  630. },
  631. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIProfileMigrator]),
  632. + QueryInterface: ChromeUtils.generateQI([Ci.nsIProfileMigrator]),
  633. classDescription: "Profile Migrator",
  634. contractID: "@mozilla.org/toolkit/profile-migrator;1",
  635. classID: Components.ID("{d5148b7c-ba4e-4f7a-a80b-1ae48b90b910}"),
  636. };
  637. var NSGetFactory = XPCOMUtils.generateNSGetFactory([ProfileMigrator]);
  638. diff --git a/suite/components/nsGopherProtocolStubHandler.js b/suite/components/nsGopherProtocolStubHandler.js
  639. --- a/suite/components/nsGopherProtocolStubHandler.js
  640. +++ b/suite/components/nsGopherProtocolStubHandler.js
  641. @@ -15,17 +15,17 @@ function GopherProtocol()
  642. {
  643. }
  644. GopherProtocol.prototype = {
  645. classDescription: "Gopher protocol handler stub",
  646. classID: Components.ID("{22042bdb-56e4-47c6-8b12-fdfa859c05a9}"),
  647. // nsISupports
  648. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler]),
  649. + QueryInterface: ChromeUtils.generateQI([Ci.nsIProtocolHandler]),
  650. // nsIProtocolHandler
  651. scheme: "gopher",
  652. defaultPort: 70,
  653. protocolFlags: Ci.nsIProtocolHandler.URI_NORELATIVE |
  654. Ci.nsIProtocolHandler.URI_NOAUTH |
  655. Ci.nsIProtocolHandler.URI_LOADABLE_BY_ANYONE,
  656. diff --git a/suite/components/nsSuiteGlue.js b/suite/components/nsSuiteGlue.js
  657. --- a/suite/components/nsSuiteGlue.js
  658. +++ b/suite/components/nsSuiteGlue.js
  659. @@ -1560,20 +1560,20 @@ SuiteGlue.prototype = {
  660. } catch (e) {
  661. Cu.reportError("Error displaying tab received by Sync: " + e);
  662. }
  663. },
  664. // for XPCOM
  665. classID: Components.ID("{bbbbe845-5a1b-40ee-813c-f84b8faaa07c}"),
  666. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
  667. - Ci.nsIWebProgressListener,
  668. - Ci.nsISupportsWeakReference,
  669. - Ci.nsISuiteGlue])
  670. + QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
  671. + Ci.nsIWebProgressListener,
  672. + Ci.nsISupportsWeakReference,
  673. + Ci.nsISuiteGlue])
  674. }
  675. /**
  676. * ContentPermissionIntegration is responsible for showing the user
  677. * simple permission prompts when content requests additional
  678. * capabilities.
  679. *
  680. @@ -1618,17 +1618,17 @@ var ContentPermissionIntegration = {
  681. },
  682. };
  683. function ContentPermissionPrompt() {}
  684. ContentPermissionPrompt.prototype = {
  685. classID: Components.ID("{9d4c845d-3f09-402a-b66d-50f291d7d50f}"),
  686. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPermissionPrompt]),
  687. + QueryInterface: ChromeUtils.generateQI([Ci.nsIContentPermissionPrompt]),
  688. /**
  689. * This implementation of nsIContentPermissionPrompt.prompt ensures
  690. * that there's only one nsIContentPermissionType in the request,
  691. * and that it's of type nsIContentPermissionType. Failing to
  692. * satisfy either of these conditions will result in this method
  693. * throwing NS_ERRORs. If the combined ContentPermissionIntegration
  694. * cannot construct a prompt for this particular request, an
  695. diff --git a/suite/components/places/content/bookmarkProperties.js b/suite/components/places/content/bookmarkProperties.js
  696. --- a/suite/components/places/content/bookmarkProperties.js
  697. +++ b/suite/components/places/content/bookmarkProperties.js
  698. @@ -367,22 +367,17 @@ var BookmarkPropertiesPanel = {
  699. this._height += -oldHeight + newHeight;
  700. elementsHeight.set(id, newHeight);
  701. }
  702. break;
  703. }
  704. },
  705. // nsISupports
  706. - QueryInterface: function BPP_QueryInterface(aIID) {
  707. - if (aIID.equals(Ci.nsISupports))
  708. - return this;
  709. -
  710. - throw Cr.NS_NOINTERFACE;
  711. - },
  712. + QueryInterface: ChromeUtils.generateQI([]),
  713. _element: function BPP__element(aID) {
  714. return document.getElementById("editBMPanel_" + aID);
  715. },
  716. onDialogUnload() {
  717. // gEditItemOverlay does not exist anymore here, so don't rely on it.
  718. this._mutationObserver.disconnect();
  719. diff --git a/suite/components/places/content/browserPlacesViews.js b/suite/components/places/content/browserPlacesViews.js
  720. --- a/suite/components/places/content/browserPlacesViews.js
  721. +++ b/suite/components/places/content/browserPlacesViews.js
  722. @@ -14,16 +14,19 @@ function PlacesViewBase(aPlace, aOptions
  723. if ("viewElt" in aOptions)
  724. this._viewElt = aOptions.viewElt;
  725. this.options = aOptions;
  726. this._controller = new PlacesController(this);
  727. this.place = aPlace;
  728. this._viewElt.controllers.appendController(this._controller);
  729. }
  730. +PlacesViewBase.interfaces = [Ci.nsINavHistoryResultObserver,
  731. + Ci.nsISupportsWeakReference];
  732. +
  733. PlacesViewBase.prototype = {
  734. // The xul element that holds the entire view.
  735. _viewElt: null,
  736. get viewElt() {
  737. return this._viewElt;
  738. },
  739. get associatedElement() {
  740. @@ -36,19 +39,18 @@ PlacesViewBase.prototype = {
  741. // The xul element that represents the root container.
  742. _rootElt: null,
  743. // Set to true for views that are represented by native widgets (i.e.
  744. // the native mac menu).
  745. _nativeView: false,
  746. - QueryInterface: XPCOMUtils.generateQI(
  747. - [Ci.nsINavHistoryResultObserver,
  748. - Ci.nsISupportsWeakReference]),
  749. + QueryInterface: ChromeUtils.generateQI(
  750. + PlacesViewBase.interfaces),
  751. _place: "",
  752. get place() {
  753. return this._place;
  754. },
  755. set place(val) {
  756. this._place = val;
  757. @@ -997,22 +999,18 @@ function PlacesToolbar(aPlace) {
  758. }
  759. PlacesToolbar.prototype = {
  760. __proto__: PlacesViewBase.prototype,
  761. _cbEvents: ["dragstart", "dragover", "dragexit", "dragend", "drop",
  762. "mousemove", "mouseover", "mouseout"],
  763. - QueryInterface: function PT_QueryInterface(aIID) {
  764. - if (aIID.equals(Ci.nsITimerCallback))
  765. - return this;
  766. -
  767. - return PlacesViewBase.prototype.QueryInterface.apply(this, arguments);
  768. - },
  769. + QueryInterface: ChromeUtils.generateQI([Ci.nsITimerCallback,
  770. + ...PlacesViewBase.interfaces]),
  771. uninit: function PT_uninit() {
  772. this._removeEventListeners(this._viewElt, this._cbEvents, false);
  773. this._removeEventListeners(this._rootElt, ["popupshowing", "popuphidden"],
  774. true);
  775. this._removeEventListeners(this._rootElt, ["overflow", "underflow"], true);
  776. this._removeEventListeners(window, ["resize", "unload"], false);
  777. this._removeEventListeners(gBrowser.tabContainer, ["TabOpen", "TabClose"], false);
  778. @@ -1941,20 +1939,16 @@ function PlacesPanelMenuView(aPlace, aVi
  779. this.options = aOptions;
  780. PlacesViewBase.call(this, aPlace, aOptions);
  781. }
  782. PlacesPanelMenuView.prototype = {
  783. __proto__: PlacesViewBase.prototype,
  784. - QueryInterface: function PAMV_QueryInterface(aIID) {
  785. - return PlacesViewBase.prototype.QueryInterface.apply(this, arguments);
  786. - },
  787. -
  788. uninit: function PAMV_uninit() {
  789. PlacesViewBase.prototype.uninit.apply(this, arguments);
  790. },
  791. _insertNewItem:
  792. function PAMV__insertNewItem(aChild, aInsertionNode, aBefore = null) {
  793. this._domNodes.delete(aChild);
  794. diff --git a/suite/components/places/content/controller.js b/suite/components/places/content/controller.js
  795. --- a/suite/components/places/content/controller.js
  796. +++ b/suite/components/places/content/controller.js
  797. @@ -75,17 +75,17 @@ function PlacesController(aView) {
  798. }
  799. PlacesController.prototype = {
  800. /**
  801. * The places view.
  802. */
  803. _view: null,
  804. - QueryInterface: XPCOMUtils.generateQI([
  805. + QueryInterface: ChromeUtils.generateQI([
  806. Ci.nsIClipboardOwner
  807. ]),
  808. // nsIClipboardOwner
  809. LosingOwnership: function PC_LosingOwnership(aXferable) {
  810. this.cutNodes = [];
  811. },
  812. diff --git a/suite/components/places/content/editBookmarkOverlay.js b/suite/components/places/content/editBookmarkOverlay.js
  813. --- a/suite/components/places/content/editBookmarkOverlay.js
  814. +++ b/suite/components/places/content/editBookmarkOverlay.js
  815. @@ -454,17 +454,17 @@ var gEditItemOverlay = {
  816. this._folderMenuList.selectedIndex);
  817. // Hide the folders-separator if no folder is annotated as recently-used
  818. this._element("foldersSeparator").hidden = (menupopup.childNodes.length <= 6);
  819. this._folderMenuList.disabled = this.readOnly;
  820. },
  821. QueryInterface:
  822. - XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver]),
  823. + ChromeUtils.generateQI([Ci.nsINavBookmarkObserver]),
  824. _element(aID) {
  825. return document.getElementById("editBMPanel_" + aID);
  826. },
  827. uninitPanel(aHideCollapsibleElements) {
  828. if (aHideCollapsibleElements) {
  829. // Hide the folder tree if it was previously visible.
  830. diff --git a/suite/components/places/content/places.js b/suite/components/places/content/places.js
  831. --- a/suite/components/places/content/places.js
  832. +++ b/suite/components/places/content/places.js
  833. @@ -156,22 +156,17 @@ var PlacesOrganizer = {
  834. // remove the "Properties" context-menu item, we've our own details pane
  835. document.getElementById("placesContext")
  836. .removeChild(document.getElementById("placesContext_show:info"));
  837. ContentArea.focus();
  838. },
  839. - QueryInterface: function PO_QueryInterface(aIID) {
  840. - if (aIID.equals(Ci.nsISupports))
  841. - return this;
  842. -
  843. - throw Cr.NS_NOINTERFACE;
  844. - },
  845. + QueryInterface: ChromeUtils.generateQI([]),
  846. handleEvent: function PO_handleEvent(aEvent) {
  847. if (aEvent.type != "AppCommand")
  848. return;
  849. aEvent.stopPropagation();
  850. switch (aEvent.command) {
  851. case "Back":
  852. diff --git a/suite/components/places/content/treeView.js b/suite/components/places/content/treeView.js
  853. --- a/suite/components/places/content/treeView.js
  854. +++ b/suite/components/places/content/treeView.js
  855. @@ -53,17 +53,17 @@ PlacesTreeView.prototype = {
  856. __xulStore: null,
  857. get _xulStore() {
  858. if (!this.__xulStore) {
  859. this.__xulStore = Cc["@mozilla.org/xul/xulstore;1"].getService(Ci.nsIXULStore);
  860. }
  861. return this.__xulStore;
  862. },
  863. - QueryInterface: XPCOMUtils.generateQI(PTV_interfaces),
  864. + QueryInterface: ChromeUtils.generateQI(PTV_interfaces),
  865. // Bug 761494:
  866. // ----------
  867. // Some addons use methods from nsINavHistoryResultObserver and
  868. // nsINavHistoryResultTreeViewer, without QIing to these interfaces first.
  869. // That's not a problem when the view is retrieved through the
  870. // <tree>.view getter (which returns the wrappedJSObject of this object),
  871. // it raises an issue when the view retrieved through the treeBoxObject.view
  872. diff --git a/suite/components/places/nsPlacesAutoComplete.js b/suite/components/places/nsPlacesAutoComplete.js
  873. --- a/suite/components/places/nsPlacesAutoComplete.js
  874. +++ b/suite/components/places/nsPlacesAutoComplete.js
  875. @@ -265,17 +265,17 @@ AutoCompleteStatementCallbackWrapper.pro
  876. {
  877. return this._handle = this._db.executeAsync(aQueries, aQueries.length,
  878. this);
  879. },
  880. //////////////////////////////////////////////////////////////////////////////
  881. //// nsISupports
  882. - QueryInterface: XPCOMUtils.generateQI([
  883. + QueryInterface: ChromeUtils.generateQI([
  884. Ci.mozIStorageStatementCallback,
  885. ])
  886. };
  887. ////////////////////////////////////////////////////////////////////////////////
  888. //// nsPlacesAutoComplete class
  889. //// @mozilla.org/autocomplete/search;1?name=history
  890. @@ -1303,17 +1303,17 @@ nsPlacesAutoComplete.prototype = {
  891. //////////////////////////////////////////////////////////////////////////////
  892. //// nsISupports
  893. classID: Components.ID("d0272978-beab-4adc-a3d4-04b76acfa4e7"),
  894. _xpcom_factory: XPCOMUtils.generateSingletonFactory(nsPlacesAutoComplete),
  895. - QueryInterface: XPCOMUtils.generateQI([
  896. + QueryInterface: ChromeUtils.generateQI([
  897. Ci.nsIAutoCompleteSearch,
  898. Ci.nsIAutoCompleteSimpleResultListener,
  899. Ci.mozIPlacesAutoComplete,
  900. Ci.mozIStorageStatementCallback,
  901. Ci.nsIObserver,
  902. Ci.nsISupportsWeakReference,
  903. ])
  904. };
  905. diff --git a/suite/components/places/tests/autocomplete/head_autocomplete.js b/suite/components/places/tests/autocomplete/head_autocomplete.js
  906. --- a/suite/components/places/tests/autocomplete/head_autocomplete.js
  907. +++ b/suite/components/places/tests/autocomplete/head_autocomplete.js
  908. @@ -33,17 +33,17 @@ AutoCompleteInput.prototype = {
  909. disableAutoComplete: false,
  910. completeDefaultIndex: false,
  911. get popup() { return this; },
  912. onSearchBegin: function() {},
  913. onSearchComplete: function() {},
  914. setSelectedIndex: function() {},
  915. get searchCount() { return this.searches.length; },
  916. getSearchAt: function(aIndex) { return this.searches[aIndex]; },
  917. - QueryInterface: XPCOMUtils.generateQI([
  918. + QueryInterface: ChromeUtils.generateQI([
  919. Ci.nsIAutoCompleteInput,
  920. Ci.nsIAutoCompletePopup,
  921. ])
  922. };
  923. function toURI(aSpec) {
  924. return uri(aSpec);
  925. }
  926. diff --git a/suite/components/places/tests/browser/browser_library_views_liveupdate.js b/suite/components/places/tests/browser/browser_library_views_liveupdate.js
  927. --- a/suite/components/places/tests/browser/browser_library_views_liveupdate.js
  928. +++ b/suite/components/places/tests/browser/browser_library_views_liveupdate.js
  929. @@ -143,17 +143,17 @@ function finishTest() {
  930. finish();
  931. }
  932. /**
  933. * The observer is where magic happens, for every change we do it will look for
  934. * nodes positions in the affected views.
  935. */
  936. var bookmarksObserver = {
  937. - QueryInterface: XPCOMUtils.generateQI([
  938. + QueryInterface: ChromeUtils.generateQI([
  939. Ci.nsINavBookmarkObserver
  940. , Ci.nsIAnnotationObserver
  941. ]),
  942. // nsIAnnotationObserver
  943. onItemAnnotationSet: function() {},
  944. onItemAnnotationRemoved: function() {},
  945. onPageAnnotationSet: function() {},
  946. diff --git a/suite/components/places/tests/head_common.js b/suite/components/places/tests/head_common.js
  947. --- a/suite/components/places/tests/head_common.js
  948. +++ b/suite/components/places/tests/head_common.js
  949. @@ -747,17 +747,17 @@ function NavBookmarkObserver() {}
  950. NavBookmarkObserver.prototype = {
  951. onBeginUpdateBatch: function () {},
  952. onEndUpdateBatch: function () {},
  953. onItemAdded: function () {},
  954. onItemRemoved: function () {},
  955. onItemChanged: function () {},
  956. onItemVisited: function () {},
  957. onItemMoved: function () {},
  958. - QueryInterface: XPCOMUtils.generateQI([
  959. + QueryInterface: ChromeUtils.generateQI([
  960. Ci.nsINavBookmarkObserver,
  961. ])
  962. };
  963. /**
  964. * Generic nsINavHistoryObserver that doesn't implement anything, but provides
  965. * dummy methods to prevent errors about an object not having a certain method.
  966. */
  967. @@ -767,17 +767,17 @@ NavHistoryObserver.prototype = {
  968. onBeginUpdateBatch: function () {},
  969. onEndUpdateBatch: function () {},
  970. onVisit: function () {},
  971. onTitleChanged: function () {},
  972. onDeleteURI: function () {},
  973. onClearHistory: function () {},
  974. onPageChanged: function () {},
  975. onDeleteVisits: function () {},
  976. - QueryInterface: XPCOMUtils.generateQI([
  977. + QueryInterface: ChromeUtils.generateQI([
  978. Ci.nsINavHistoryObserver,
  979. ])
  980. };
  981. /**
  982. * Generic nsINavHistoryResultObserver that doesn't implement anything, but
  983. * provides dummy methods to prevent errors about an object not having a certain
  984. * method.
  985. @@ -796,17 +796,17 @@ NavHistoryResultObserver.prototype = {
  986. nodeKeywordChanged: function () {},
  987. nodeLastModifiedChanged: function () {},
  988. nodeMoved: function () {},
  989. nodeRemoved: function () {},
  990. nodeTagsChanged: function () {},
  991. nodeTitleChanged: function () {},
  992. nodeURIChanged: function () {},
  993. sortingChanged: function () {},
  994. - QueryInterface: XPCOMUtils.generateQI([
  995. + QueryInterface: ChromeUtils.generateQI([
  996. Ci.nsINavHistoryResultObserver,
  997. ])
  998. };
  999. /**
  1000. * Asynchronously check a url is visited.
  1001. *
  1002. * @param aURI The URI.
  1003. diff --git a/suite/components/places/tests/unit/test_PUIU_makeTransaction.js b/suite/components/places/tests/unit/test_PUIU_makeTransaction.js
  1004. --- a/suite/components/places/tests/unit/test_PUIU_makeTransaction.js
  1005. +++ b/suite/components/places/tests/unit/test_PUIU_makeTransaction.js
  1006. @@ -9,17 +9,17 @@ function waitForBookmarkNotification(aNo
  1007. if (aMethodName == aNotification &&
  1008. (!aProperty || aProperty == aData.property)) {
  1009. PlacesUtils.bookmarks.removeObserver(this);
  1010. aCallback(aData);
  1011. }
  1012. },
  1013. // nsINavBookmarkObserver
  1014. - QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver]),
  1015. + QueryInterface: ChromeUtils.generateQI([Ci.nsINavBookmarkObserver]),
  1016. onBeginUpdateBatch: function onBeginUpdateBatch() {
  1017. return this.validate(arguments.callee.name, arguments);
  1018. },
  1019. onEndUpdateBatch: function onEndUpdateBatch() {
  1020. return this.validate(arguments.callee.name, arguments);
  1021. },
  1022. onItemAdded: function onItemAdded(aItemId, aParentId, aIndex, aItemType,
  1023. aURI, aTitle)
  1024. diff --git a/suite/components/places/tests/unit/test_browserGlue_corrupt.js b/suite/components/places/tests/unit/test_browserGlue_corrupt.js
  1025. --- a/suite/components/places/tests/unit/test_browserGlue_corrupt.js
  1026. +++ b/suite/components/places/tests/unit/test_browserGlue_corrupt.js
  1027. @@ -26,17 +26,17 @@ var bookmarksObserver = {
  1028. if (anno.itemHasAnnotation(itemId, "Places/SmartBookmark"))
  1029. continue_test();
  1030. },
  1031. onItemAdded: function() {},
  1032. onItemRemoved: function(id, folder, index, itemType) {},
  1033. onItemChanged: function() {},
  1034. onItemVisited: function(id, visitID, time) {},
  1035. onItemMoved: function() {},
  1036. - QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver])
  1037. + QueryInterface: ChromeUtils.generateQI([Ci.nsINavBookmarkObserver])
  1038. };
  1039. function run_test() {
  1040. do_test_pending();
  1041. // Create our bookmarks.html copying bookmarks.glue.html to the profile
  1042. // folder. It should be ignored.
  1043. create_bookmarks_html("bookmarks.glue.html");
  1044. diff --git a/suite/components/places/tests/unit/test_browserGlue_corrupt_nobackup.js b/suite/components/places/tests/unit/test_browserGlue_corrupt_nobackup.js
  1045. --- a/suite/components/places/tests/unit/test_browserGlue_corrupt_nobackup.js
  1046. +++ b/suite/components/places/tests/unit/test_browserGlue_corrupt_nobackup.js
  1047. @@ -26,17 +26,17 @@ var bookmarksObserver = {
  1048. if (anno.itemHasAnnotation(itemId, "Places/SmartBookmark"))
  1049. continue_test();
  1050. },
  1051. onItemAdded: function() {},
  1052. onItemRemoved: function(id, folder, index, itemType) {},
  1053. onItemChanged: function() {},
  1054. onItemVisited: function(id, visitID, time) {},
  1055. onItemMoved: function() {},
  1056. - QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver])
  1057. + QueryInterface: ChromeUtils.generateQI([Ci.nsINavBookmarkObserver])
  1058. };
  1059. function run_test() {
  1060. do_test_pending();
  1061. // Create bookmarks.html in the profile.
  1062. create_bookmarks_html("bookmarks.glue.html");
  1063. // Remove JSON backup from profile.
  1064. diff --git a/suite/components/places/tests/unit/test_browserGlue_corrupt_nobackup_default.js b/suite/components/places/tests/unit/test_browserGlue_corrupt_nobackup_default.js
  1065. --- a/suite/components/places/tests/unit/test_browserGlue_corrupt_nobackup_default.js
  1066. +++ b/suite/components/places/tests/unit/test_browserGlue_corrupt_nobackup_default.js
  1067. @@ -26,17 +26,17 @@ var bookmarksObserver = {
  1068. if (anno.itemHasAnnotation(itemId, "Places/SmartBookmark"))
  1069. continue_test();
  1070. },
  1071. onItemAdded: function() {},
  1072. onItemRemoved: function(id, folder, index, itemType) {},
  1073. onItemChanged: function() {},
  1074. onItemVisited: function(id, visitID, time) {},
  1075. onItemMoved: function() {},
  1076. - QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver])
  1077. + QueryInterface: ChromeUtils.generateQI([Ci.nsINavBookmarkObserver])
  1078. };
  1079. function run_test() {
  1080. do_test_pending();
  1081. // Remove bookmarks.html from profile.
  1082. remove_bookmarks_html();
  1083. // Remove JSON backup from profile.
  1084. diff --git a/suite/components/places/tests/unit/test_browserGlue_migrate.js b/suite/components/places/tests/unit/test_browserGlue_migrate.js
  1085. --- a/suite/components/places/tests/unit/test_browserGlue_migrate.js
  1086. +++ b/suite/components/places/tests/unit/test_browserGlue_migrate.js
  1087. @@ -27,17 +27,17 @@ var bookmarksObserver = {
  1088. if (anno.itemHasAnnotation(itemId, "Places/SmartBookmark"))
  1089. continue_test();
  1090. },
  1091. onItemAdded: function() {},
  1092. onItemRemoved: function(id, folder, index, itemType) {},
  1093. onItemChanged: function() {},
  1094. onItemVisited: function(id, visitID, time) {},
  1095. onItemMoved: function() {},
  1096. - QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver])
  1097. + QueryInterface: ChromeUtils.generateQI([Ci.nsINavBookmarkObserver])
  1098. };
  1099. const PREF_SMART_BOOKMARKS_VERSION = "browser.places.smartBookmarksVersion";
  1100. function run_test() {
  1101. do_test_pending();
  1102. // Create our bookmarks.html copying bookmarks.glue.html to the profile
  1103. diff --git a/suite/components/places/tests/unit/test_browserGlue_restore.js b/suite/components/places/tests/unit/test_browserGlue_restore.js
  1104. --- a/suite/components/places/tests/unit/test_browserGlue_restore.js
  1105. +++ b/suite/components/places/tests/unit/test_browserGlue_restore.js
  1106. @@ -26,17 +26,17 @@ var bookmarksObserver = {
  1107. if (anno.itemHasAnnotation(itemId, "Places/SmartBookmark"))
  1108. continue_test();
  1109. },
  1110. onItemAdded: function() {},
  1111. onItemRemoved: function(id, folder, index, itemType) {},
  1112. onItemChanged: function() {},
  1113. onItemVisited: function(id, visitID, time) {},
  1114. onItemMoved: function() {},
  1115. - QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver])
  1116. + QueryInterface: ChromeUtils.generateQI([Ci.nsINavBookmarkObserver])
  1117. };
  1118. function run_test() {
  1119. do_test_pending();
  1120. // Create our bookmarks.html copying bookmarks.glue.html to the profile
  1121. // folder. It will be ignored.
  1122. create_bookmarks_html("bookmarks.glue.html");
  1123. diff --git a/suite/components/places/tests/unit/test_browserGlue_smartBookmarks.js b/suite/components/places/tests/unit/test_browserGlue_smartBookmarks.js
  1124. --- a/suite/components/places/tests/unit/test_browserGlue_smartBookmarks.js
  1125. +++ b/suite/components/places/tests/unit/test_browserGlue_smartBookmarks.js
  1126. @@ -21,17 +21,17 @@ const SMART_BOOKMARKS_ANNO = "Places/Sma
  1127. * exception generated when calling ensurePlacesDefaultQueriesInitialized().
  1128. */
  1129. function rebuildSmartBookmarks() {
  1130. let consoleListener = {
  1131. observe: function(aMsg) {
  1132. print("Got console message: " + aMsg.message);
  1133. },
  1134. - QueryInterface: XPCOMUtils.generateQI([
  1135. + QueryInterface: ChromeUtils.generateQI([
  1136. Ci.nsIConsoleListener
  1137. ]),
  1138. };
  1139. Services.console.reset();
  1140. Services.console.registerListener(consoleListener);
  1141. Cc["@mozilla.org/suite/suiteglue;1"].getService(Ci.nsISuiteGlue)
  1142. .ensurePlacesDefaultQueriesInitialized();
  1143. Services.console.unregisterListener(consoleListener);
  1144. diff --git a/suite/components/pref/content/pref-applications.js b/suite/components/pref/content/pref-applications.js
  1145. --- a/suite/components/pref/content/pref-applications.js
  1146. +++ b/suite/components/pref/content/pref-applications.js
  1147. @@ -402,17 +402,17 @@ FeedHandlerInfo.prototype = {
  1148. // A minimal implementation of nsIMutableArray. It only supports the two
  1149. // methods its callers invoke, namely appendElement, nsIArray::enumerate
  1150. // and nsIArray::indexOf.
  1151. this._possibleApplicationHandlers = {
  1152. _inner: [],
  1153. _removed: [],
  1154. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIMutableArray, Ci.nsIArray]),
  1155. + QueryInterface: ChromeUtils.generateQI([Ci.nsIMutableArray, Ci.nsIArray]),
  1156. get length() {
  1157. return this._inner.length;
  1158. },
  1159. enumerate: function() {
  1160. return new ArrayEnumerator(this._inner);
  1161. },
  1162. @@ -759,17 +759,17 @@ var gApplicationsPane = {
  1163. Services.prefs.removeObserver(PREF_AUDIO_FEED_SELECTED_WEB, this);
  1164. Services.prefs.removeObserver(PREF_AUDIO_FEED_SELECTED_ACTION, this);
  1165. },
  1166. //**************************************************************************//
  1167. // nsISupports
  1168. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
  1169. + QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver]),
  1170. //**************************************************************************//
  1171. // nsIObserver
  1172. observe(aSubject, aTopic, aData) {
  1173. // Rebuild the list when there are changes to preferences that influence
  1174. // whether or not to show certain entries in the list.
  1175. if (aTopic == "nsPref:changed" && !this._storingAction) {
  1176. diff --git a/suite/components/pref/content/pref-cache.js b/suite/components/pref/content/pref-cache.js
  1177. --- a/suite/components/pref/content/pref-cache.js
  1178. +++ b/suite/components/pref/content/pref-cache.js
  1179. @@ -23,17 +23,17 @@ var CacheObserver = {
  1180. var sizeStrings = DownloadUtils.convertByteUnits(aConsumption);
  1181. var prefStrBundle = document.getElementById("bundle_prefutilities");
  1182. var sizeStr = prefStrBundle.getFormattedString("cacheSizeInfo",
  1183. sizeStrings);
  1184. actualSizeLabel.textContent = sizeStr;
  1185. },
  1186. /* nsISupports */
  1187. - QueryInterface: XPCOMUtils.generateQI(
  1188. + QueryInterface: ChromeUtils.generateQI(
  1189. [Ci.nsICacheStorageConsumptionObserver,
  1190. Ci.nsISupportsWeakReference])
  1191. };
  1192. // because the cache is in kilobytes, and the UI is in megabytes.
  1193. function ReadCacheDiskCapacity()
  1194. {
  1195. var pref = document.getElementById("browser.cache.disk.capacity");
  1196. diff --git a/suite/components/search/content/search-panel.js b/suite/components/search/content/search-panel.js
  1197. --- a/suite/components/search/content/search-panel.js
  1198. +++ b/suite/components/search/content/search-panel.js
  1199. @@ -68,18 +68,18 @@ function doSearch() {
  1200. }
  1201. var where = Services.prefs.getBoolPref("browser.search.openintab") ? "tab" : "current";
  1202. var submission = Services.search.currentEngine.getSubmission(textValue);
  1203. openUILinkIn(submission.uri.spec, where, null, submission.postData);
  1204. }
  1205. var engineObserver = {
  1206. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
  1207. - Ci.nsISupportsWeakReference]),
  1208. + QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
  1209. + Ci.nsISupportsWeakReference]),
  1210. observe: function(aEngine, aTopic, aVerb) {
  1211. if (aTopic == SEARCH_ENGINE_TOPIC) {
  1212. // Right now, always just rebuild the list after any modification.
  1213. LoadEngineList();
  1214. }
  1215. }
  1216. }
  1217. diff --git a/suite/components/sessionstore/nsSessionStartup.js b/suite/components/sessionstore/nsSessionStartup.js
  1218. --- a/suite/components/sessionstore/nsSessionStartup.js
  1219. +++ b/suite/components/sessionstore/nsSessionStartup.js
  1220. @@ -207,16 +207,16 @@ SessionStartup.prototype = {
  1221. return content.replace(/\r\n?/g, "\n");
  1222. }
  1223. catch (ex) { Cu.reportError(ex); }
  1224. return null;
  1225. },
  1226. /* ........ QueryInterface .............. */
  1227. - QueryInterface : XPCOMUtils.generateQI([Ci.nsIObserver,
  1228. - Ci.nsISupportsWeakReference,
  1229. - Ci.nsISessionStartup]),
  1230. + QueryInterface : ChromeUtils.generateQI([Ci.nsIObserver,
  1231. + Ci.nsISupportsWeakReference,
  1232. + Ci.nsISessionStartup]),
  1233. classID: Components.ID("{4e6c1112-57b6-44ba-adf9-99fb573b0a30}")
  1234. };
  1235. var NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStartup]);
  1236. diff --git a/suite/components/sessionstore/nsSessionStore.js b/suite/components/sessionstore/nsSessionStore.js
  1237. --- a/suite/components/sessionstore/nsSessionStore.js
  1238. +++ b/suite/components/sessionstore/nsSessionStore.js
  1239. @@ -117,19 +117,19 @@ function SessionStoreService() {
  1240. // get crash recovery state from prefs and allow for proper reaction to state changes
  1241. this._prefBranch.addObserver("sessionstore.resume_from_crash", this, true);
  1242. return this._prefBranch.getBoolPref("sessionstore.resume_from_crash");
  1243. });
  1244. }
  1245. SessionStoreService.prototype = {
  1246. classID: Components.ID("{d37ccdf1-496f-4135-9575-037180af010d}"),
  1247. - QueryInterface: XPCOMUtils.generateQI([Ci.nsISessionStore,
  1248. - Ci.nsIObserver,
  1249. - Ci.nsISupportsWeakReference]),
  1250. + QueryInterface: ChromeUtils.generateQI([Ci.nsISessionStore,
  1251. + Ci.nsIObserver,
  1252. + Ci.nsISupportsWeakReference]),
  1253. // xul:tab attributes to (re)store (extensions might want to hook in here);
  1254. // the favicon is always saved for the about:sessionrestore page
  1255. xulAttributes: {"image": true},
  1256. // set default load state
  1257. _loadState: STATE_STOPPED,
  1258. @@ -4144,18 +4144,18 @@ var gRestoreTabsProgressListener = {
  1259. // restored. We need to catch reloads that occur before the tab is restored
  1260. // because otherwise, docShell will reload an old URI (usually about:blank).
  1261. function SessionStoreSHistoryListener(ss, aTab) {
  1262. this.tab = aTab;
  1263. this.ss = ss;
  1264. }
  1265. SessionStoreSHistoryListener.prototype = {
  1266. - QueryInterface: XPCOMUtils.generateQI([Ci.nsISHistoryListener,
  1267. - Ci.nsISupportsWeakReference]),
  1268. + QueryInterface: ChromeUtils.generateQI([Ci.nsISHistoryListener,
  1269. + Ci.nsISupportsWeakReference]),
  1270. browser: null,
  1271. ss: null,
  1272. tab: null,
  1273. OnHistoryNewEntry: function(aNewURI) { },
  1274. OnHistoryGotoIndex: function(aIndex, aGotoURI) { },
  1275. OnHistoryPurge: function(aNumEntries) { },
  1276. OnHistoryReload: function(aReloadURI, aReloadFlags) {
  1277. // On reload, we want to make sure that session history loads the right
  1278. diff --git a/suite/components/shell/nsSetDefault.js b/suite/components/shell/nsSetDefault.js
  1279. --- a/suite/components/shell/nsSetDefault.js
  1280. +++ b/suite/components/shell/nsSetDefault.js
  1281. @@ -41,13 +41,13 @@ nsSetDefault.prototype = {
  1282. },
  1283. helpInfo: " -setDefaultBrowser Set this app as the default browser client.\n" +
  1284. " -setDefaultMail Set this app as the default mail client.\n" +
  1285. " -setDefaultNews Set this app as the default newsreader.\n" +
  1286. " -setDefaultFeed Set this app as the default feedreader.\n",
  1287. classID: Components.ID("{a3d5b950-690a-491f-a881-2c2cdcd241cb}"),
  1288. - QueryInterface: XPCOMUtils.generateQI([nsICommandLineHandler])
  1289. + QueryInterface: ChromeUtils.generateQI([nsICommandLineHandler])
  1290. }
  1291. var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSetDefault]);
  1292. diff --git a/suite/components/sidebar/nsSidebar.js b/suite/components/sidebar/nsSidebar.js
  1293. --- a/suite/components/sidebar/nsSidebar.js
  1294. +++ b/suite/components/sidebar/nsSidebar.js
  1295. @@ -294,17 +294,17 @@ function (aSearchURL)
  1296. nsSidebar.prototype.classInfo = XPCOMUtils.generateCI({
  1297. classID: SIDEBAR_CID,
  1298. contractID: SIDEBAR_CONTRACTID,
  1299. classDescription: "Sidebar",
  1300. interfaces: [nsISidebar],
  1301. flags: nsIClassInfo.DOM_OBJECT});
  1302. nsSidebar.prototype.QueryInterface =
  1303. - XPCOMUtils.generateQI([nsISidebar]);
  1304. + ChromeUtils.generateQI([Ci.nsISidebar]);
  1305. nsSidebar.prototype.classID = SIDEBAR_CID;
  1306. var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSidebar]);
  1307. var gDebugLog;
  1308. /* static functions */
  1309. diff --git a/suite/components/sync/content/syncSetup.js b/suite/components/sync/content/syncSetup.js
  1310. --- a/suite/components/sync/content/syncSetup.js
  1311. +++ b/suite/components/sync/content/syncSetup.js
  1312. @@ -20,18 +20,18 @@ const SETUP_SUCCESS_PAGE = 8;
  1313. const RECAPTCHA_DOMAIN = "https://www.google.com";
  1314. const {Weave} = ChromeUtils.import("resource://services-sync/main.js");
  1315. var {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
  1316. const {PlacesUtils} = ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
  1317. const {PluralForm} = ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
  1318. var gSyncSetup = {
  1319. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
  1320. - Ci.nsISupportsWeakReference]),
  1321. + QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener,
  1322. + Ci.nsISupportsWeakReference]),
  1323. captchaBrowser: null,
  1324. wizard: null,
  1325. _disabledSites: [],
  1326. status: {
  1327. password: false,
  1328. email: false,
  1329. diff --git a/suite/components/sync/content/syncUI.js b/suite/components/sync/content/syncUI.js
  1330. --- a/suite/components/sync/content/syncUI.js
  1331. +++ b/suite/components/sync/content/syncUI.js
  1332. @@ -436,17 +436,17 @@ var gSyncUI = {
  1333. this.initNotifications();
  1334. break;
  1335. case "weave:ui:clear-error":
  1336. this.clearError();
  1337. break;
  1338. }
  1339. },
  1340. - QueryInterface: XPCOMUtils.generateQI([
  1341. + QueryInterface: ChromeUtils.generateQI([
  1342. Ci.nsIObserver,
  1343. Ci.nsISupportsWeakReference
  1344. ])
  1345. };
  1346. XPCOMUtils.defineLazyGetter(gSyncUI, "_stringBundle", function() {
  1347. //XXXzpao these strings should probably be moved from /services to /browser... (bug 583381)
  1348. // but for now just make it work
  1349. diff --git a/suite/components/tests/browser/browser_markPageAsFollowedLink.js b/suite/components/tests/browser/browser_markPageAsFollowedLink.js
  1350. --- a/suite/components/tests/browser/browser_markPageAsFollowedLink.js
  1351. +++ b/suite/components/tests/browser/browser_markPageAsFollowedLink.js
  1352. @@ -25,17 +25,17 @@ var observer = {
  1353. maybeClickLink();
  1354. }
  1355. else if (url == RIGHT_URL ) {
  1356. is(getTransitionForUrl(url), PlacesUtils.history.TRANSITION_FRAMED_LINK,
  1357. "User activated visits should get a FRAMED_LINK transition.");
  1358. finish();
  1359. }
  1360. },
  1361. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver])
  1362. + QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver])
  1363. };
  1364. Services.obs.addObserver(observer, "uri-visit-saved");
  1365. function test()
  1366. {
  1367. waitForExplicitFinish();
  1368. gBrowser.selectedTab = gBrowser.addTab(PAGE_URL);
  1369. let frameCount = 0;
  1370. diff --git a/suite/extensions/debugQA/content/debugQAEditorOverlay.js b/suite/extensions/debugQA/content/debugQAEditorOverlay.js
  1371. --- a/suite/extensions/debugQA/content/debugQAEditorOverlay.js
  1372. +++ b/suite/extensions/debugQA/content/debugQAEditorOverlay.js
  1373. @@ -153,24 +153,17 @@ sampleJSTransaction.prototype = {
  1374. merge: function(aTxn)
  1375. {
  1376. // We don't do any merging!
  1377. return false;
  1378. },
  1379. - QueryInterface: function(aIID, theResult)
  1380. - {
  1381. - if (aIID.equals(Ci.nsITransaction) ||
  1382. - aIID.equals(Ci.nsISupports))
  1383. - return this;
  1384. -
  1385. - throw Cr.NS_ERROR_NO_INTERFACE;
  1386. - },
  1387. + QueryInterface: ChromeUtils.generateQI([Ci.nsITransaction]),
  1388. insert_node_at_point: function(node, container, offset)
  1389. {
  1390. var childList = container.childNodes;
  1391. if (childList.length == 0 || offset >= childList.length)
  1392. container.appendChild(node);
  1393. else
  1394. diff --git a/suite/mailnews/components/compose/content/MsgComposeCommands.js b/suite/mailnews/components/compose/content/MsgComposeCommands.js
  1395. --- a/suite/mailnews/components/compose/content/MsgComposeCommands.js
  1396. +++ b/suite/mailnews/components/compose/content/MsgComposeCommands.js
  1397. @@ -448,25 +448,18 @@ var progressListener = {
  1398. } catch (ex) {}
  1399. },
  1400. onSecurityChange: function(aWebProgress, aRequest, state)
  1401. {
  1402. // we can ignore this notification
  1403. },
  1404. - QueryInterface : function(iid)
  1405. - {
  1406. - if (iid.equals(Ci.nsIWebProgressListener) ||
  1407. - iid.equals(Ci.nsISupportsWeakReference) ||
  1408. - iid.equals(Ci.nsISupports))
  1409. - return this;
  1410. -
  1411. - throw Cr.NS_NOINTERFACE;
  1412. - }
  1413. + QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener,
  1414. + Ci.nsISupportsWeakReference]),
  1415. };
  1416. var defaultController =
  1417. {
  1418. supportsCommand: function(command)
  1419. {
  1420. switch (command)
  1421. {
  1422. @@ -2920,25 +2913,18 @@ function OpenSelectedAttachment()
  1423. }
  1424. function nsAttachmentOpener()
  1425. {
  1426. }
  1427. nsAttachmentOpener.prototype =
  1428. {
  1429. - QueryInterface: function(iid)
  1430. - {
  1431. - if (iid.equals(Ci.nsIURIContentListener) ||
  1432. - iid.equals(Ci.nsIInterfaceRequestor) ||
  1433. - iid.equals(Ci.nsISupports)) {
  1434. - return this;
  1435. - }
  1436. - throw Cr.NS_NOINTERFACE;
  1437. - },
  1438. + QueryInterface: ChromeUtils.generateQI([Ci.nsIURIContentListener,
  1439. + Ci.nsIInterfaceRequestor]),
  1440. doContent: function(contentType, isContentPreferred, request, contentHandler)
  1441. {
  1442. return false;
  1443. },
  1444. isPreferred: function(contentType, desiredContentType)
  1445. {
  1446. diff --git a/suite/mailnews/components/compose/content/addressingWidgetOverlay.js b/suite/mailnews/components/compose/content/addressingWidgetOverlay.js
  1447. --- a/suite/mailnews/components/compose/content/addressingWidgetOverlay.js
  1448. +++ b/suite/mailnews/components/compose/content/addressingWidgetOverlay.js
  1449. @@ -1152,16 +1152,10 @@ AutomatedAutoCompleteHandler.prototype =
  1450. // that will automatically set the focus on a new available row, and make sure it is visible
  1451. awAddRecipient(this.recipientType ? this.recipientType : "addr_to", addressToAdd);
  1452. this.indexIntoNames++;
  1453. this.autoCompleteNextAddress();
  1454. },
  1455. - QueryInterface : function(iid)
  1456. - {
  1457. - if (iid.equals(Ci.nsIAutoCompleteListener) ||
  1458. - iid.equals(Ci.nsISupports))
  1459. - return this;
  1460. - throw Cr.NS_NOINTERFACE;
  1461. - }
  1462. + QueryInterface: ChromeUtils.generateQI([Ci.nsIAutoCompleteListener]),
  1463. }
  1464. diff --git a/suite/mailnews/content/SearchDialog.js b/suite/mailnews/content/SearchDialog.js
  1465. --- a/suite/mailnews/content/SearchDialog.js
  1466. +++ b/suite/mailnews/content/SearchDialog.js
  1467. @@ -498,24 +498,17 @@ nsMsgSearchCommandUpdater.prototype =
  1468. updateNextMessageAfterDelete : function()
  1469. {
  1470. SetNextMessageAfterDelete();
  1471. },
  1472. summarizeSelection: function() {return false},
  1473. - QueryInterface : function(iid)
  1474. - {
  1475. - if (iid.equals(Ci.nsIMsgDBViewCommandUpdater) ||
  1476. - iid.equals(Ci.nsISupports))
  1477. - return this;
  1478. -
  1479. - throw Cr.NS_NOINTERFACE;
  1480. - }
  1481. + QueryInterface: ChromeUtils.generateQI([Ci.nsIMsgDBViewCommandUpdater]),
  1482. }
  1483. function setupDatasource() {
  1484. gDBView = Cc["@mozilla.org/messenger/msgdbview;1?type=search"]
  1485. .createInstance(Ci.nsIMsgDBView);
  1486. var count = new Object;
  1487. var cmdupdator = new nsMsgSearchCommandUpdater();
  1488. diff --git a/suite/mailnews/content/browserRequest.js b/suite/mailnews/content/browserRequest.js
  1489. --- a/suite/mailnews/content/browserRequest.js
  1490. +++ b/suite/mailnews/content/browserRequest.js
  1491. @@ -7,23 +7,18 @@ const wpl = Ci.nsIWebProgressListener;
  1492. var reporterListener = {
  1493. _isBusy: false,
  1494. get securityButton() {
  1495. delete this.securityButton;
  1496. return this.securityButton = document.getElementById("security-button");
  1497. },
  1498. - QueryInterface: function(aIID) {
  1499. - if (aIID.equals(Ci.nsIWebProgressListener) ||
  1500. - aIID.equals(Ci.nsISupportsWeakReference) ||
  1501. - aIID.equals(Ci.nsISupports))
  1502. - return this;
  1503. - throw Cr.NS_NOINTERFACE;
  1504. - },
  1505. + QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener,
  1506. + Ci.nsISupportsWeakReference]),
  1507. onStateChange: function(/*in nsIWebProgress*/ aWebProgress,
  1508. /*in nsIRequest*/ aRequest,
  1509. /*in unsigned long*/ aStateFlags,
  1510. /*in nsresult*/ aStatus) {
  1511. },
  1512. onProgressChange: function(/*in nsIWebProgress*/ aWebProgress,
  1513. diff --git a/suite/mailnews/content/mailTasksOverlay.js b/suite/mailnews/content/mailTasksOverlay.js
  1514. --- a/suite/mailnews/content/mailTasksOverlay.js
  1515. +++ b/suite/mailnews/content/mailTasksOverlay.js
  1516. @@ -223,23 +223,18 @@ nsMsgBadCertHandler.prototype = {
  1517. },
  1518. // nsIInterfaceRequestor
  1519. getInterface: function(iid) {
  1520. return this.QueryInterface(iid);
  1521. },
  1522. // nsISupports
  1523. - QueryInterface: function(iid) {
  1524. - if (!iid.equals(Ci.nsIBadCertListener2) &&
  1525. - !iid.equals(Ci.nsIInterfaceRequestor) &&
  1526. - !iid.equals(Ci.nsISupports))
  1527. - throw Cr.NS_ERROR_NO_INTERFACE;
  1528. - return this;
  1529. - }
  1530. + QueryInterface: ChromeUtils.generateQI([Ci.nsIBadCertListener2,
  1531. + Ci.nsIInterfaceRequestor]),
  1532. };
  1533. function InformUserOfCertError(status, targetSite)
  1534. {
  1535. var params = { exceptionAdded : false,
  1536. sslStatus : status,
  1537. prefetchCert : true,
  1538. location : targetSite };
  1539. diff --git a/suite/mailnews/content/mailWindow.js b/suite/mailnews/content/mailWindow.js
  1540. --- a/suite/mailnews/content/mailWindow.js
  1541. +++ b/suite/mailnews/content/mailWindow.js
  1542. @@ -371,25 +371,19 @@ nsMsgStatusFeedback.prototype =
  1543. },
  1544. // Called before links are navigated to to allow us to retarget them if needed.
  1545. onBeforeLinkTraversal: function(aOriginalTarget, aLinkURI, aLinkNode, aIsAppTab)
  1546. {
  1547. return aOriginalTarget;
  1548. },
  1549. - QueryInterface : function(iid)
  1550. - {
  1551. - if (iid.equals(Ci.nsIMsgStatusFeedback) ||
  1552. - iid.equals(Ci.nsIXULBrowserWindow) ||
  1553. - iid.equals(Ci.nsISupportsWeakReference) ||
  1554. - iid.equals(Ci.nsISupports))
  1555. - return this;
  1556. - throw Cr.NS_NOINTERFACE;
  1557. - },
  1558. + QueryInterface: ChromeUtils.generateQI([Ci.nsIMsgStatusFeedback,
  1559. + Ci.nsIXULBrowserWindow,
  1560. + Ci.nsISupportsWeakReference]),
  1561. // nsIMsgStatusFeedback implementation.
  1562. showStatusString : function(statusText)
  1563. {
  1564. this.ensureStatusFields();
  1565. if ( !statusText.length )
  1566. statusText = this.myDefaultStatus;
  1567. else
  1568. @@ -495,23 +489,17 @@ nsMsgStatusFeedback.prototype =
  1569. function nsMsgWindowCommands()
  1570. {
  1571. }
  1572. nsMsgWindowCommands.prototype =
  1573. {
  1574. - QueryInterface : function(iid)
  1575. - {
  1576. - if (iid.equals(Ci.nsIMsgWindowCommands) ||
  1577. - iid.equals(Ci.nsISupports))
  1578. - return this;
  1579. - throw Cr.NS_NOINTERFACE;
  1580. - },
  1581. + QueryInterface: ChromeUtils.generateQI([Ci.nsIMsgWindowCommands]),
  1582. selectFolder: function(folderUri)
  1583. {
  1584. gFolderTreeView.selectFolder(MailUtils.getFolderForURI(folderUri));
  1585. },
  1586. selectMessage: function(messageUri)
  1587. {
  1588. diff --git a/suite/mailnews/content/mailWindowOverlay.js b/suite/mailnews/content/mailWindowOverlay.js
  1589. --- a/suite/mailnews/content/mailWindowOverlay.js
  1590. +++ b/suite/mailnews/content/mailWindowOverlay.js
  1591. @@ -1197,25 +1197,20 @@ BatchMessageMover.prototype =
  1592. if (aFolder.parent == this._dstFolderParent &&
  1593. aFolder.name == this._dstFolderName) {
  1594. this._dstFolderParent = null;
  1595. this._dstFolderName = null;
  1596. this.continueBatch();
  1597. }
  1598. },
  1599. - QueryInterface(aIID) {
  1600. - if (aIID.equals(Ci.nsIUrlListener) ||
  1601. - aIID.equals(Ci.nsIMsgCopyServiceListener) ||
  1602. - aIID.equals(Ci.nsIMsgFolderListener) ||
  1603. - aIID.equals(Ci.nsIMsgOperationListener) ||
  1604. - aIID.equals(Ci.nsISupports))
  1605. - return this;
  1606. - throw Cr.NS_ERROR_NO_INTERFACE;
  1607. - }
  1608. + QueryInterface: ChromeUtils.generateQI([Ci.nsIUrlListener,
  1609. + Ci.nsIMsgCopyServiceListener,
  1610. + Ci.nsIMsgFolderListener,
  1611. + Ci.nsIMsgOperationListener]),
  1612. }
  1613. function MsgArchiveSelectedMessages(aEvent) {
  1614. let batchMover = new BatchMessageMover();
  1615. batchMover.archiveMessages(gFolderDisplay.selectedMessages);
  1616. }
  1617. diff --git a/suite/mailnews/content/messageWindow.js b/suite/mailnews/content/messageWindow.js
  1618. --- a/suite/mailnews/content/messageWindow.js
  1619. +++ b/suite/mailnews/content/messageWindow.js
  1620. @@ -153,24 +153,17 @@ nsMsgDBViewCommandUpdater.prototype =
  1621. updateNextMessageAfterDelete : function()
  1622. {
  1623. SetNextMessageAfterDelete();
  1624. },
  1625. summarizeSelection: function() {return false},
  1626. - QueryInterface : function(iid)
  1627. - {
  1628. - if (iid.equals(Ci.nsIMsgDBViewCommandUpdater) ||
  1629. - iid.equals(Ci.nsISupports))
  1630. - return this;
  1631. -
  1632. - throw Cr.NS_NOINTERFACE;
  1633. - }
  1634. + QueryInterface: ChromeUtils.generateQI([Ci.nsIMsgDBViewCommandUpdater]),
  1635. }
  1636. function HandleDeleteOrMoveMsgCompleted(folder)
  1637. {
  1638. if ((folder.URI == gCurrentFolderUri) && gCurrentMessageIsDeleted)
  1639. {
  1640. gDBView.onDeleteCompleted(true);
  1641. gCurrentMessageIsDeleted = false;
  1642. diff --git a/suite/mailnews/content/msgHdrViewOverlay.js b/suite/mailnews/content/msgHdrViewOverlay.js
  1643. --- a/suite/mailnews/content/msgHdrViewOverlay.js
  1644. +++ b/suite/mailnews/content/msgHdrViewOverlay.js
  1645. @@ -316,17 +316,17 @@ function OnAddressBookDataChanged(aActio
  1646. }
  1647. });
  1648. }
  1649. // The messageHeaderSink is the class that gets notified of a message's headers as we display the message
  1650. // through our mime converter.
  1651. var messageHeaderSink = {
  1652. - QueryInterface: XPCOMUtils.generateQI(
  1653. + QueryInterface: ChromeUtils.generateQI(
  1654. [Ci.nsIMsgHeaderSink]),
  1655. onStartHeaders: function()
  1656. {
  1657. this.mSaveHdr = null;
  1658. // clear out any pending collected address timers...
  1659. if (gCollectAddressTimer)
  1660. {
  1661. clearTimeout(gCollectAddressTimer);
  1662. @@ -1883,17 +1883,17 @@ var attachmentAreaDNDObserver = {
  1663. };
  1664. function nsFlavorDataProvider()
  1665. {
  1666. }
  1667. nsFlavorDataProvider.prototype =
  1668. {
  1669. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIFlavorDataProvider]),
  1670. + QueryInterface: ChromeUtils.generateQI([Ci.nsIFlavorDataProvider]),
  1671. getFlavorData : function(aTransferable, aFlavor, aData, aDataLen)
  1672. {
  1673. // get the url for the attachment
  1674. if (aFlavor == "application/x-moz-file-promise")
  1675. {
  1676. var urlPrimitive = { };
  1677. var dataSize = { };
  1678. diff --git a/suite/mailnews/content/threadPane.js b/suite/mailnews/content/threadPane.js
  1679. --- a/suite/mailnews/content/threadPane.js
  1680. +++ b/suite/mailnews/content/threadPane.js
  1681. @@ -96,24 +96,17 @@ nsMsgDBViewCommandUpdater.prototype =
  1682. updateNextMessageAfterDelete : function()
  1683. {
  1684. SetNextMessageAfterDelete();
  1685. },
  1686. summarizeSelection: function() {return false},
  1687. - QueryInterface : function(iid)
  1688. - {
  1689. - if (iid.equals(Ci.nsIMsgDBViewCommandUpdater) ||
  1690. - iid.equals(Ci.nsISupports))
  1691. - return this;
  1692. -
  1693. - throw Cr.NS_NOINTERFACE;
  1694. - }
  1695. + QueryInterface: ChromeUtils.generateQI([Ci.nsIMsgDBViewCommandUpdater]),
  1696. }
  1697. function HandleColumnClick(columnID)
  1698. {
  1699. const columnMap = {dateCol: 'byDate',
  1700. receivedCol: 'byReceived',
  1701. senderCol: 'byAuthor',
  1702. recipientCol: 'byRecipient',
  1703. diff --git a/suite/modules/WindowsPreviewPerTab.jsm b/suite/modules/WindowsPreviewPerTab.jsm
  1704. --- a/suite/modules/WindowsPreviewPerTab.jsm
  1705. +++ b/suite/modules/WindowsPreviewPerTab.jsm
  1706. @@ -154,17 +154,17 @@ function PreviewController(win, tab) {
  1707. XPCOMUtils.defineLazyGetter(this, "canvasPreview", function () {
  1708. let canvas = PageThumbs.createCanvas();
  1709. canvas.mozOpaque = true;
  1710. return canvas;
  1711. });
  1712. }
  1713. PreviewController.prototype = {
  1714. - QueryInterface: XPCOMUtils.generateQI([Ci.nsITaskbarPreviewController]),
  1715. + QueryInterface: ChromeUtils.generateQI([Ci.nsITaskbarPreviewController]),
  1716. _cachedWidth: 0,
  1717. _cachedHeight: 0,
  1718. destroy: function () {
  1719. this.tab.removeEventListener("TabAttrModified", this);
  1720. // Break cycles, otherwise we end up leaking the window with everything
  1721. @@ -849,19 +849,19 @@ var AeroPeek = {
  1722. if (tab.getAttribute("image") == newValue) {
  1723. win.onLinkIconAvailable(tab.linkedBrowser, newValue);
  1724. }
  1725. }
  1726. }
  1727. }
  1728. },
  1729. - QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference,
  1730. - Ci.nsINavHistoryObserver,
  1731. - Ci.nsIObserver]),
  1732. + QueryInterface: ChromeUtils.generateQI([Ci.nsISupportsWeakReference,
  1733. + Ci.nsINavHistoryObserver,
  1734. + Ci.nsIObserver]),
  1735. };
  1736. XPCOMUtils.defineLazyGetter(AeroPeek, "cacheTimer", () =>
  1737. Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer)
  1738. );
  1739. XPCOMUtils.defineLazyServiceGetter(AeroPeek, "prefs",
  1740. "@mozilla.org/preferences-service;1",