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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028
  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/nsAbout.js b/suite/components/nsAbout.js
  639. --- a/suite/components/nsAbout.js
  640. +++ b/suite/components/nsAbout.js
  641. @@ -30,17 +30,17 @@ About.prototype = {
  642. rightsFlags: SCRIPT | UNTRUSTED,
  643. rightsURI: "chrome://branding/content/aboutRights.xhtml",
  644. sessionrestoreFlags: SCRIPT | HIDE,
  645. sessionrestoreURI: "chrome://communicator/content/aboutSessionRestore.xhtml",
  646. // synctabsFlags: SCRIPT,
  647. // synctabsURI: "chrome://communicator/content/aboutSyncTabs.xul",
  648. classID: Components.ID("{d54f2c89-8fd6-4eeb-a7a4-51d4dcdf460f}"),
  649. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
  650. + QueryInterface: ChromeUtils.generateQI([Ci.nsIAboutModule]),
  651. getModule: function(aURI) {
  652. return aURI.pathQueryRef.replace(/-|\W.*$/g, "").toLowerCase();
  653. },
  654. getURIFlags: function(aURI) {
  655. return this[this.getModule(aURI) + "Flags"];
  656. },
  657. diff --git a/suite/components/nsGopherProtocolStubHandler.js b/suite/components/nsGopherProtocolStubHandler.js
  658. --- a/suite/components/nsGopherProtocolStubHandler.js
  659. +++ b/suite/components/nsGopherProtocolStubHandler.js
  660. @@ -15,17 +15,17 @@ function GopherProtocol()
  661. {
  662. }
  663. GopherProtocol.prototype = {
  664. classDescription: "Gopher protocol handler stub",
  665. classID: Components.ID("{22042bdb-56e4-47c6-8b12-fdfa859c05a9}"),
  666. // nsISupports
  667. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler]),
  668. + QueryInterface: ChromeUtils.generateQI([Ci.nsIProtocolHandler]),
  669. // nsIProtocolHandler
  670. scheme: "gopher",
  671. defaultPort: 70,
  672. protocolFlags: Ci.nsIProtocolHandler.URI_NORELATIVE |
  673. Ci.nsIProtocolHandler.URI_NOAUTH |
  674. Ci.nsIProtocolHandler.URI_LOADABLE_BY_ANYONE,
  675. diff --git a/suite/components/nsSuiteGlue.js b/suite/components/nsSuiteGlue.js
  676. --- a/suite/components/nsSuiteGlue.js
  677. +++ b/suite/components/nsSuiteGlue.js
  678. @@ -1560,20 +1560,20 @@ SuiteGlue.prototype = {
  679. } catch (e) {
  680. Cu.reportError("Error displaying tab received by Sync: " + e);
  681. }
  682. },
  683. // for XPCOM
  684. classID: Components.ID("{bbbbe845-5a1b-40ee-813c-f84b8faaa07c}"),
  685. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
  686. - Ci.nsIWebProgressListener,
  687. - Ci.nsISupportsWeakReference,
  688. - Ci.nsISuiteGlue])
  689. + QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
  690. + Ci.nsIWebProgressListener,
  691. + Ci.nsISupportsWeakReference,
  692. + Ci.nsISuiteGlue])
  693. }
  694. /**
  695. * ContentPermissionIntegration is responsible for showing the user
  696. * simple permission prompts when content requests additional
  697. * capabilities.
  698. *
  699. @@ -1618,17 +1618,17 @@ var ContentPermissionIntegration = {
  700. },
  701. };
  702. function ContentPermissionPrompt() {}
  703. ContentPermissionPrompt.prototype = {
  704. classID: Components.ID("{9d4c845d-3f09-402a-b66d-50f291d7d50f}"),
  705. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPermissionPrompt]),
  706. + QueryInterface: ChromeUtils.generateQI([Ci.nsIContentPermissionPrompt]),
  707. /**
  708. * This implementation of nsIContentPermissionPrompt.prompt ensures
  709. * that there's only one nsIContentPermissionType in the request,
  710. * and that it's of type nsIContentPermissionType. Failing to
  711. * satisfy either of these conditions will result in this method
  712. * throwing NS_ERRORs. If the combined ContentPermissionIntegration
  713. * cannot construct a prompt for this particular request, an
  714. diff --git a/suite/components/places/content/bookmarkProperties.js b/suite/components/places/content/bookmarkProperties.js
  715. --- a/suite/components/places/content/bookmarkProperties.js
  716. +++ b/suite/components/places/content/bookmarkProperties.js
  717. @@ -367,22 +367,17 @@ var BookmarkPropertiesPanel = {
  718. this._height += -oldHeight + newHeight;
  719. elementsHeight.set(id, newHeight);
  720. }
  721. break;
  722. }
  723. },
  724. // nsISupports
  725. - QueryInterface: function BPP_QueryInterface(aIID) {
  726. - if (aIID.equals(Ci.nsISupports))
  727. - return this;
  728. -
  729. - throw Cr.NS_NOINTERFACE;
  730. - },
  731. + QueryInterface: ChromeUtils.generateQI([]),
  732. _element: function BPP__element(aID) {
  733. return document.getElementById("editBMPanel_" + aID);
  734. },
  735. onDialogUnload() {
  736. // gEditItemOverlay does not exist anymore here, so don't rely on it.
  737. this._mutationObserver.disconnect();
  738. diff --git a/suite/components/places/content/browserPlacesViews.js b/suite/components/places/content/browserPlacesViews.js
  739. --- a/suite/components/places/content/browserPlacesViews.js
  740. +++ b/suite/components/places/content/browserPlacesViews.js
  741. @@ -14,16 +14,19 @@ function PlacesViewBase(aPlace, aOptions
  742. if ("viewElt" in aOptions)
  743. this._viewElt = aOptions.viewElt;
  744. this.options = aOptions;
  745. this._controller = new PlacesController(this);
  746. this.place = aPlace;
  747. this._viewElt.controllers.appendController(this._controller);
  748. }
  749. +PlacesViewBase.interfaces = [Ci.nsINavHistoryResultObserver,
  750. + Ci.nsISupportsWeakReference];
  751. +
  752. PlacesViewBase.prototype = {
  753. // The xul element that holds the entire view.
  754. _viewElt: null,
  755. get viewElt() {
  756. return this._viewElt;
  757. },
  758. get associatedElement() {
  759. @@ -36,19 +39,18 @@ PlacesViewBase.prototype = {
  760. // The xul element that represents the root container.
  761. _rootElt: null,
  762. // Set to true for views that are represented by native widgets (i.e.
  763. // the native mac menu).
  764. _nativeView: false,
  765. - QueryInterface: XPCOMUtils.generateQI(
  766. - [Ci.nsINavHistoryResultObserver,
  767. - Ci.nsISupportsWeakReference]),
  768. + QueryInterface: ChromeUtils.generateQI(
  769. + PlacesViewBase.interfaces),
  770. _place: "",
  771. get place() {
  772. return this._place;
  773. },
  774. set place(val) {
  775. this._place = val;
  776. @@ -997,22 +999,18 @@ function PlacesToolbar(aPlace) {
  777. }
  778. PlacesToolbar.prototype = {
  779. __proto__: PlacesViewBase.prototype,
  780. _cbEvents: ["dragstart", "dragover", "dragexit", "dragend", "drop",
  781. "mousemove", "mouseover", "mouseout"],
  782. - QueryInterface: function PT_QueryInterface(aIID) {
  783. - if (aIID.equals(Ci.nsITimerCallback))
  784. - return this;
  785. -
  786. - return PlacesViewBase.prototype.QueryInterface.apply(this, arguments);
  787. - },
  788. + QueryInterface: ChromeUtils.generateQI([Ci.nsITimerCallback,
  789. + ...PlacesViewBase.interfaces]),
  790. uninit: function PT_uninit() {
  791. this._removeEventListeners(this._viewElt, this._cbEvents, false);
  792. this._removeEventListeners(this._rootElt, ["popupshowing", "popuphidden"],
  793. true);
  794. this._removeEventListeners(this._rootElt, ["overflow", "underflow"], true);
  795. this._removeEventListeners(window, ["resize", "unload"], false);
  796. this._removeEventListeners(gBrowser.tabContainer, ["TabOpen", "TabClose"], false);
  797. @@ -1941,20 +1939,16 @@ function PlacesPanelMenuView(aPlace, aVi
  798. this.options = aOptions;
  799. PlacesViewBase.call(this, aPlace, aOptions);
  800. }
  801. PlacesPanelMenuView.prototype = {
  802. __proto__: PlacesViewBase.prototype,
  803. - QueryInterface: function PAMV_QueryInterface(aIID) {
  804. - return PlacesViewBase.prototype.QueryInterface.apply(this, arguments);
  805. - },
  806. -
  807. uninit: function PAMV_uninit() {
  808. PlacesViewBase.prototype.uninit.apply(this, arguments);
  809. },
  810. _insertNewItem:
  811. function PAMV__insertNewItem(aChild, aInsertionNode, aBefore = null) {
  812. this._domNodes.delete(aChild);
  813. diff --git a/suite/components/places/content/controller.js b/suite/components/places/content/controller.js
  814. --- a/suite/components/places/content/controller.js
  815. +++ b/suite/components/places/content/controller.js
  816. @@ -75,17 +75,17 @@ function PlacesController(aView) {
  817. }
  818. PlacesController.prototype = {
  819. /**
  820. * The places view.
  821. */
  822. _view: null,
  823. - QueryInterface: XPCOMUtils.generateQI([
  824. + QueryInterface: ChromeUtils.generateQI([
  825. Ci.nsIClipboardOwner
  826. ]),
  827. // nsIClipboardOwner
  828. LosingOwnership: function PC_LosingOwnership(aXferable) {
  829. this.cutNodes = [];
  830. },
  831. diff --git a/suite/components/places/content/editBookmarkOverlay.js b/suite/components/places/content/editBookmarkOverlay.js
  832. --- a/suite/components/places/content/editBookmarkOverlay.js
  833. +++ b/suite/components/places/content/editBookmarkOverlay.js
  834. @@ -454,17 +454,17 @@ var gEditItemOverlay = {
  835. this._folderMenuList.selectedIndex);
  836. // Hide the folders-separator if no folder is annotated as recently-used
  837. this._element("foldersSeparator").hidden = (menupopup.childNodes.length <= 6);
  838. this._folderMenuList.disabled = this.readOnly;
  839. },
  840. QueryInterface:
  841. - XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver]),
  842. + ChromeUtils.generateQI([Ci.nsINavBookmarkObserver]),
  843. _element(aID) {
  844. return document.getElementById("editBMPanel_" + aID);
  845. },
  846. uninitPanel(aHideCollapsibleElements) {
  847. if (aHideCollapsibleElements) {
  848. // Hide the folder tree if it was previously visible.
  849. diff --git a/suite/components/places/content/places.js b/suite/components/places/content/places.js
  850. --- a/suite/components/places/content/places.js
  851. +++ b/suite/components/places/content/places.js
  852. @@ -156,22 +156,17 @@ var PlacesOrganizer = {
  853. // remove the "Properties" context-menu item, we've our own details pane
  854. document.getElementById("placesContext")
  855. .removeChild(document.getElementById("placesContext_show:info"));
  856. ContentArea.focus();
  857. },
  858. - QueryInterface: function PO_QueryInterface(aIID) {
  859. - if (aIID.equals(Ci.nsISupports))
  860. - return this;
  861. -
  862. - throw Cr.NS_NOINTERFACE;
  863. - },
  864. + QueryInterface: ChromeUtils.generateQI([]),
  865. handleEvent: function PO_handleEvent(aEvent) {
  866. if (aEvent.type != "AppCommand")
  867. return;
  868. aEvent.stopPropagation();
  869. switch (aEvent.command) {
  870. case "Back":
  871. diff --git a/suite/components/places/content/treeView.js b/suite/components/places/content/treeView.js
  872. --- a/suite/components/places/content/treeView.js
  873. +++ b/suite/components/places/content/treeView.js
  874. @@ -53,17 +53,17 @@ PlacesTreeView.prototype = {
  875. __xulStore: null,
  876. get _xulStore() {
  877. if (!this.__xulStore) {
  878. this.__xulStore = Cc["@mozilla.org/xul/xulstore;1"].getService(Ci.nsIXULStore);
  879. }
  880. return this.__xulStore;
  881. },
  882. - QueryInterface: XPCOMUtils.generateQI(PTV_interfaces),
  883. + QueryInterface: ChromeUtils.generateQI(PTV_interfaces),
  884. // Bug 761494:
  885. // ----------
  886. // Some addons use methods from nsINavHistoryResultObserver and
  887. // nsINavHistoryResultTreeViewer, without QIing to these interfaces first.
  888. // That's not a problem when the view is retrieved through the
  889. // <tree>.view getter (which returns the wrappedJSObject of this object),
  890. // it raises an issue when the view retrieved through the treeBoxObject.view
  891. diff --git a/suite/components/places/nsPlacesAutoComplete.js b/suite/components/places/nsPlacesAutoComplete.js
  892. --- a/suite/components/places/nsPlacesAutoComplete.js
  893. +++ b/suite/components/places/nsPlacesAutoComplete.js
  894. @@ -265,17 +265,17 @@ AutoCompleteStatementCallbackWrapper.pro
  895. {
  896. return this._handle = this._db.executeAsync(aQueries, aQueries.length,
  897. this);
  898. },
  899. //////////////////////////////////////////////////////////////////////////////
  900. //// nsISupports
  901. - QueryInterface: XPCOMUtils.generateQI([
  902. + QueryInterface: ChromeUtils.generateQI([
  903. Ci.mozIStorageStatementCallback,
  904. ])
  905. };
  906. ////////////////////////////////////////////////////////////////////////////////
  907. //// nsPlacesAutoComplete class
  908. //// @mozilla.org/autocomplete/search;1?name=history
  909. @@ -1303,17 +1303,17 @@ nsPlacesAutoComplete.prototype = {
  910. //////////////////////////////////////////////////////////////////////////////
  911. //// nsISupports
  912. classID: Components.ID("d0272978-beab-4adc-a3d4-04b76acfa4e7"),
  913. _xpcom_factory: XPCOMUtils.generateSingletonFactory(nsPlacesAutoComplete),
  914. - QueryInterface: XPCOMUtils.generateQI([
  915. + QueryInterface: ChromeUtils.generateQI([
  916. Ci.nsIAutoCompleteSearch,
  917. Ci.nsIAutoCompleteSimpleResultListener,
  918. Ci.mozIPlacesAutoComplete,
  919. Ci.mozIStorageStatementCallback,
  920. Ci.nsIObserver,
  921. Ci.nsISupportsWeakReference,
  922. ])
  923. };
  924. diff --git a/suite/components/places/tests/autocomplete/head_autocomplete.js b/suite/components/places/tests/autocomplete/head_autocomplete.js
  925. --- a/suite/components/places/tests/autocomplete/head_autocomplete.js
  926. +++ b/suite/components/places/tests/autocomplete/head_autocomplete.js
  927. @@ -33,17 +33,17 @@ AutoCompleteInput.prototype = {
  928. disableAutoComplete: false,
  929. completeDefaultIndex: false,
  930. get popup() { return this; },
  931. onSearchBegin: function() {},
  932. onSearchComplete: function() {},
  933. setSelectedIndex: function() {},
  934. get searchCount() { return this.searches.length; },
  935. getSearchAt: function(aIndex) { return this.searches[aIndex]; },
  936. - QueryInterface: XPCOMUtils.generateQI([
  937. + QueryInterface: ChromeUtils.generateQI([
  938. Ci.nsIAutoCompleteInput,
  939. Ci.nsIAutoCompletePopup,
  940. ])
  941. };
  942. function toURI(aSpec) {
  943. return uri(aSpec);
  944. }
  945. diff --git a/suite/components/places/tests/browser/browser_library_views_liveupdate.js b/suite/components/places/tests/browser/browser_library_views_liveupdate.js
  946. --- a/suite/components/places/tests/browser/browser_library_views_liveupdate.js
  947. +++ b/suite/components/places/tests/browser/browser_library_views_liveupdate.js
  948. @@ -143,17 +143,17 @@ function finishTest() {
  949. finish();
  950. }
  951. /**
  952. * The observer is where magic happens, for every change we do it will look for
  953. * nodes positions in the affected views.
  954. */
  955. var bookmarksObserver = {
  956. - QueryInterface: XPCOMUtils.generateQI([
  957. + QueryInterface: ChromeUtils.generateQI([
  958. Ci.nsINavBookmarkObserver
  959. , Ci.nsIAnnotationObserver
  960. ]),
  961. // nsIAnnotationObserver
  962. onItemAnnotationSet: function() {},
  963. onItemAnnotationRemoved: function() {},
  964. onPageAnnotationSet: function() {},
  965. diff --git a/suite/components/places/tests/head_common.js b/suite/components/places/tests/head_common.js
  966. --- a/suite/components/places/tests/head_common.js
  967. +++ b/suite/components/places/tests/head_common.js
  968. @@ -747,17 +747,17 @@ function NavBookmarkObserver() {}
  969. NavBookmarkObserver.prototype = {
  970. onBeginUpdateBatch: function () {},
  971. onEndUpdateBatch: function () {},
  972. onItemAdded: function () {},
  973. onItemRemoved: function () {},
  974. onItemChanged: function () {},
  975. onItemVisited: function () {},
  976. onItemMoved: function () {},
  977. - QueryInterface: XPCOMUtils.generateQI([
  978. + QueryInterface: ChromeUtils.generateQI([
  979. Ci.nsINavBookmarkObserver,
  980. ])
  981. };
  982. /**
  983. * Generic nsINavHistoryObserver that doesn't implement anything, but provides
  984. * dummy methods to prevent errors about an object not having a certain method.
  985. */
  986. @@ -767,17 +767,17 @@ NavHistoryObserver.prototype = {
  987. onBeginUpdateBatch: function () {},
  988. onEndUpdateBatch: function () {},
  989. onVisit: function () {},
  990. onTitleChanged: function () {},
  991. onDeleteURI: function () {},
  992. onClearHistory: function () {},
  993. onPageChanged: function () {},
  994. onDeleteVisits: function () {},
  995. - QueryInterface: XPCOMUtils.generateQI([
  996. + QueryInterface: ChromeUtils.generateQI([
  997. Ci.nsINavHistoryObserver,
  998. ])
  999. };
  1000. /**
  1001. * Generic nsINavHistoryResultObserver that doesn't implement anything, but
  1002. * provides dummy methods to prevent errors about an object not having a certain
  1003. * method.
  1004. @@ -796,17 +796,17 @@ NavHistoryResultObserver.prototype = {
  1005. nodeKeywordChanged: function () {},
  1006. nodeLastModifiedChanged: function () {},
  1007. nodeMoved: function () {},
  1008. nodeRemoved: function () {},
  1009. nodeTagsChanged: function () {},
  1010. nodeTitleChanged: function () {},
  1011. nodeURIChanged: function () {},
  1012. sortingChanged: function () {},
  1013. - QueryInterface: XPCOMUtils.generateQI([
  1014. + QueryInterface: ChromeUtils.generateQI([
  1015. Ci.nsINavHistoryResultObserver,
  1016. ])
  1017. };
  1018. /**
  1019. * Asynchronously check a url is visited.
  1020. *
  1021. * @param aURI The URI.
  1022. diff --git a/suite/components/places/tests/unit/test_PUIU_makeTransaction.js b/suite/components/places/tests/unit/test_PUIU_makeTransaction.js
  1023. --- a/suite/components/places/tests/unit/test_PUIU_makeTransaction.js
  1024. +++ b/suite/components/places/tests/unit/test_PUIU_makeTransaction.js
  1025. @@ -9,17 +9,17 @@ function waitForBookmarkNotification(aNo
  1026. if (aMethodName == aNotification &&
  1027. (!aProperty || aProperty == aData.property)) {
  1028. PlacesUtils.bookmarks.removeObserver(this);
  1029. aCallback(aData);
  1030. }
  1031. },
  1032. // nsINavBookmarkObserver
  1033. - QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver]),
  1034. + QueryInterface: ChromeUtils.generateQI([Ci.nsINavBookmarkObserver]),
  1035. onBeginUpdateBatch: function onBeginUpdateBatch() {
  1036. return this.validate(arguments.callee.name, arguments);
  1037. },
  1038. onEndUpdateBatch: function onEndUpdateBatch() {
  1039. return this.validate(arguments.callee.name, arguments);
  1040. },
  1041. onItemAdded: function onItemAdded(aItemId, aParentId, aIndex, aItemType,
  1042. aURI, aTitle)
  1043. diff --git a/suite/components/places/tests/unit/test_browserGlue_corrupt.js b/suite/components/places/tests/unit/test_browserGlue_corrupt.js
  1044. --- a/suite/components/places/tests/unit/test_browserGlue_corrupt.js
  1045. +++ b/suite/components/places/tests/unit/test_browserGlue_corrupt.js
  1046. @@ -26,17 +26,17 @@ var bookmarksObserver = {
  1047. if (anno.itemHasAnnotation(itemId, "Places/SmartBookmark"))
  1048. continue_test();
  1049. },
  1050. onItemAdded: function() {},
  1051. onItemRemoved: function(id, folder, index, itemType) {},
  1052. onItemChanged: function() {},
  1053. onItemVisited: function(id, visitID, time) {},
  1054. onItemMoved: function() {},
  1055. - QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver])
  1056. + QueryInterface: ChromeUtils.generateQI([Ci.nsINavBookmarkObserver])
  1057. };
  1058. function run_test() {
  1059. do_test_pending();
  1060. // Create our bookmarks.html copying bookmarks.glue.html to the profile
  1061. // folder. It should be ignored.
  1062. create_bookmarks_html("bookmarks.glue.html");
  1063. diff --git a/suite/components/places/tests/unit/test_browserGlue_corrupt_nobackup.js b/suite/components/places/tests/unit/test_browserGlue_corrupt_nobackup.js
  1064. --- a/suite/components/places/tests/unit/test_browserGlue_corrupt_nobackup.js
  1065. +++ b/suite/components/places/tests/unit/test_browserGlue_corrupt_nobackup.js
  1066. @@ -26,17 +26,17 @@ var bookmarksObserver = {
  1067. if (anno.itemHasAnnotation(itemId, "Places/SmartBookmark"))
  1068. continue_test();
  1069. },
  1070. onItemAdded: function() {},
  1071. onItemRemoved: function(id, folder, index, itemType) {},
  1072. onItemChanged: function() {},
  1073. onItemVisited: function(id, visitID, time) {},
  1074. onItemMoved: function() {},
  1075. - QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver])
  1076. + QueryInterface: ChromeUtils.generateQI([Ci.nsINavBookmarkObserver])
  1077. };
  1078. function run_test() {
  1079. do_test_pending();
  1080. // Create bookmarks.html in the profile.
  1081. create_bookmarks_html("bookmarks.glue.html");
  1082. // Remove JSON backup from profile.
  1083. 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
  1084. --- a/suite/components/places/tests/unit/test_browserGlue_corrupt_nobackup_default.js
  1085. +++ b/suite/components/places/tests/unit/test_browserGlue_corrupt_nobackup_default.js
  1086. @@ -26,17 +26,17 @@ var bookmarksObserver = {
  1087. if (anno.itemHasAnnotation(itemId, "Places/SmartBookmark"))
  1088. continue_test();
  1089. },
  1090. onItemAdded: function() {},
  1091. onItemRemoved: function(id, folder, index, itemType) {},
  1092. onItemChanged: function() {},
  1093. onItemVisited: function(id, visitID, time) {},
  1094. onItemMoved: function() {},
  1095. - QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver])
  1096. + QueryInterface: ChromeUtils.generateQI([Ci.nsINavBookmarkObserver])
  1097. };
  1098. function run_test() {
  1099. do_test_pending();
  1100. // Remove bookmarks.html from profile.
  1101. remove_bookmarks_html();
  1102. // Remove JSON backup from profile.
  1103. diff --git a/suite/components/places/tests/unit/test_browserGlue_migrate.js b/suite/components/places/tests/unit/test_browserGlue_migrate.js
  1104. --- a/suite/components/places/tests/unit/test_browserGlue_migrate.js
  1105. +++ b/suite/components/places/tests/unit/test_browserGlue_migrate.js
  1106. @@ -27,17 +27,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. const PREF_SMART_BOOKMARKS_VERSION = "browser.places.smartBookmarksVersion";
  1119. function run_test() {
  1120. do_test_pending();
  1121. // Create our bookmarks.html copying bookmarks.glue.html to the profile
  1122. diff --git a/suite/components/places/tests/unit/test_browserGlue_restore.js b/suite/components/places/tests/unit/test_browserGlue_restore.js
  1123. --- a/suite/components/places/tests/unit/test_browserGlue_restore.js
  1124. +++ b/suite/components/places/tests/unit/test_browserGlue_restore.js
  1125. @@ -26,17 +26,17 @@ var bookmarksObserver = {
  1126. if (anno.itemHasAnnotation(itemId, "Places/SmartBookmark"))
  1127. continue_test();
  1128. },
  1129. onItemAdded: function() {},
  1130. onItemRemoved: function(id, folder, index, itemType) {},
  1131. onItemChanged: function() {},
  1132. onItemVisited: function(id, visitID, time) {},
  1133. onItemMoved: function() {},
  1134. - QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver])
  1135. + QueryInterface: ChromeUtils.generateQI([Ci.nsINavBookmarkObserver])
  1136. };
  1137. function run_test() {
  1138. do_test_pending();
  1139. // Create our bookmarks.html copying bookmarks.glue.html to the profile
  1140. // folder. It will be ignored.
  1141. create_bookmarks_html("bookmarks.glue.html");
  1142. diff --git a/suite/components/places/tests/unit/test_browserGlue_smartBookmarks.js b/suite/components/places/tests/unit/test_browserGlue_smartBookmarks.js
  1143. --- a/suite/components/places/tests/unit/test_browserGlue_smartBookmarks.js
  1144. +++ b/suite/components/places/tests/unit/test_browserGlue_smartBookmarks.js
  1145. @@ -21,17 +21,17 @@ const SMART_BOOKMARKS_ANNO = "Places/Sma
  1146. * exception generated when calling ensurePlacesDefaultQueriesInitialized().
  1147. */
  1148. function rebuildSmartBookmarks() {
  1149. let consoleListener = {
  1150. observe: function(aMsg) {
  1151. print("Got console message: " + aMsg.message);
  1152. },
  1153. - QueryInterface: XPCOMUtils.generateQI([
  1154. + QueryInterface: ChromeUtils.generateQI([
  1155. Ci.nsIConsoleListener
  1156. ]),
  1157. };
  1158. Services.console.reset();
  1159. Services.console.registerListener(consoleListener);
  1160. Cc["@mozilla.org/suite/suiteglue;1"].getService(Ci.nsISuiteGlue)
  1161. .ensurePlacesDefaultQueriesInitialized();
  1162. Services.console.unregisterListener(consoleListener);
  1163. diff --git a/suite/components/pref/content/pref-applications.js b/suite/components/pref/content/pref-applications.js
  1164. --- a/suite/components/pref/content/pref-applications.js
  1165. +++ b/suite/components/pref/content/pref-applications.js
  1166. @@ -402,17 +402,17 @@ FeedHandlerInfo.prototype = {
  1167. // A minimal implementation of nsIMutableArray. It only supports the two
  1168. // methods its callers invoke, namely appendElement, nsIArray::enumerate
  1169. // and nsIArray::indexOf.
  1170. this._possibleApplicationHandlers = {
  1171. _inner: [],
  1172. _removed: [],
  1173. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIMutableArray, Ci.nsIArray]),
  1174. + QueryInterface: ChromeUtils.generateQI([Ci.nsIMutableArray, Ci.nsIArray]),
  1175. get length() {
  1176. return this._inner.length;
  1177. },
  1178. enumerate: function() {
  1179. return new ArrayEnumerator(this._inner);
  1180. },
  1181. @@ -759,17 +759,17 @@ var gApplicationsPane = {
  1182. Services.prefs.removeObserver(PREF_AUDIO_FEED_SELECTED_WEB, this);
  1183. Services.prefs.removeObserver(PREF_AUDIO_FEED_SELECTED_ACTION, this);
  1184. },
  1185. //**************************************************************************//
  1186. // nsISupports
  1187. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
  1188. + QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver]),
  1189. //**************************************************************************//
  1190. // nsIObserver
  1191. observe(aSubject, aTopic, aData) {
  1192. // Rebuild the list when there are changes to preferences that influence
  1193. // whether or not to show certain entries in the list.
  1194. if (aTopic == "nsPref:changed" && !this._storingAction) {
  1195. diff --git a/suite/components/pref/content/pref-cache.js b/suite/components/pref/content/pref-cache.js
  1196. --- a/suite/components/pref/content/pref-cache.js
  1197. +++ b/suite/components/pref/content/pref-cache.js
  1198. @@ -23,17 +23,17 @@ var CacheObserver = {
  1199. var sizeStrings = DownloadUtils.convertByteUnits(aConsumption);
  1200. var prefStrBundle = document.getElementById("bundle_prefutilities");
  1201. var sizeStr = prefStrBundle.getFormattedString("cacheSizeInfo",
  1202. sizeStrings);
  1203. actualSizeLabel.textContent = sizeStr;
  1204. },
  1205. /* nsISupports */
  1206. - QueryInterface: XPCOMUtils.generateQI(
  1207. + QueryInterface: ChromeUtils.generateQI(
  1208. [Ci.nsICacheStorageConsumptionObserver,
  1209. Ci.nsISupportsWeakReference])
  1210. };
  1211. // because the cache is in kilobytes, and the UI is in megabytes.
  1212. function ReadCacheDiskCapacity()
  1213. {
  1214. var pref = document.getElementById("browser.cache.disk.capacity");
  1215. diff --git a/suite/components/search/content/search-panel.js b/suite/components/search/content/search-panel.js
  1216. --- a/suite/components/search/content/search-panel.js
  1217. +++ b/suite/components/search/content/search-panel.js
  1218. @@ -68,18 +68,18 @@ function doSearch() {
  1219. }
  1220. var where = Services.prefs.getBoolPref("browser.search.openintab") ? "tab" : "current";
  1221. var submission = Services.search.currentEngine.getSubmission(textValue);
  1222. openUILinkIn(submission.uri.spec, where, null, submission.postData);
  1223. }
  1224. var engineObserver = {
  1225. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
  1226. - Ci.nsISupportsWeakReference]),
  1227. + QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
  1228. + Ci.nsISupportsWeakReference]),
  1229. observe: function(aEngine, aTopic, aVerb) {
  1230. if (aTopic == SEARCH_ENGINE_TOPIC) {
  1231. // Right now, always just rebuild the list after any modification.
  1232. LoadEngineList();
  1233. }
  1234. }
  1235. }
  1236. diff --git a/suite/components/sessionstore/nsSessionStartup.js b/suite/components/sessionstore/nsSessionStartup.js
  1237. --- a/suite/components/sessionstore/nsSessionStartup.js
  1238. +++ b/suite/components/sessionstore/nsSessionStartup.js
  1239. @@ -207,16 +207,16 @@ SessionStartup.prototype = {
  1240. return content.replace(/\r\n?/g, "\n");
  1241. }
  1242. catch (ex) { Cu.reportError(ex); }
  1243. return null;
  1244. },
  1245. /* ........ QueryInterface .............. */
  1246. - QueryInterface : XPCOMUtils.generateQI([Ci.nsIObserver,
  1247. - Ci.nsISupportsWeakReference,
  1248. - Ci.nsISessionStartup]),
  1249. + QueryInterface : ChromeUtils.generateQI([Ci.nsIObserver,
  1250. + Ci.nsISupportsWeakReference,
  1251. + Ci.nsISessionStartup]),
  1252. classID: Components.ID("{4e6c1112-57b6-44ba-adf9-99fb573b0a30}")
  1253. };
  1254. var NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStartup]);
  1255. diff --git a/suite/components/sessionstore/nsSessionStore.js b/suite/components/sessionstore/nsSessionStore.js
  1256. --- a/suite/components/sessionstore/nsSessionStore.js
  1257. +++ b/suite/components/sessionstore/nsSessionStore.js
  1258. @@ -117,19 +117,19 @@ function SessionStoreService() {
  1259. // get crash recovery state from prefs and allow for proper reaction to state changes
  1260. this._prefBranch.addObserver("sessionstore.resume_from_crash", this, true);
  1261. return this._prefBranch.getBoolPref("sessionstore.resume_from_crash");
  1262. });
  1263. }
  1264. SessionStoreService.prototype = {
  1265. classID: Components.ID("{d37ccdf1-496f-4135-9575-037180af010d}"),
  1266. - QueryInterface: XPCOMUtils.generateQI([Ci.nsISessionStore,
  1267. - Ci.nsIObserver,
  1268. - Ci.nsISupportsWeakReference]),
  1269. + QueryInterface: ChromeUtils.generateQI([Ci.nsISessionStore,
  1270. + Ci.nsIObserver,
  1271. + Ci.nsISupportsWeakReference]),
  1272. // xul:tab attributes to (re)store (extensions might want to hook in here);
  1273. // the favicon is always saved for the about:sessionrestore page
  1274. xulAttributes: {"image": true},
  1275. // set default load state
  1276. _loadState: STATE_STOPPED,
  1277. @@ -4144,18 +4144,18 @@ var gRestoreTabsProgressListener = {
  1278. // restored. We need to catch reloads that occur before the tab is restored
  1279. // because otherwise, docShell will reload an old URI (usually about:blank).
  1280. function SessionStoreSHistoryListener(ss, aTab) {
  1281. this.tab = aTab;
  1282. this.ss = ss;
  1283. }
  1284. SessionStoreSHistoryListener.prototype = {
  1285. - QueryInterface: XPCOMUtils.generateQI([Ci.nsISHistoryListener,
  1286. - Ci.nsISupportsWeakReference]),
  1287. + QueryInterface: ChromeUtils.generateQI([Ci.nsISHistoryListener,
  1288. + Ci.nsISupportsWeakReference]),
  1289. browser: null,
  1290. ss: null,
  1291. tab: null,
  1292. OnHistoryNewEntry: function(aNewURI) { },
  1293. OnHistoryGotoIndex: function(aIndex, aGotoURI) { },
  1294. OnHistoryPurge: function(aNumEntries) { },
  1295. OnHistoryReload: function(aReloadURI, aReloadFlags) {
  1296. // On reload, we want to make sure that session history loads the right
  1297. diff --git a/suite/components/shell/nsSetDefault.js b/suite/components/shell/nsSetDefault.js
  1298. --- a/suite/components/shell/nsSetDefault.js
  1299. +++ b/suite/components/shell/nsSetDefault.js
  1300. @@ -41,13 +41,13 @@ nsSetDefault.prototype = {
  1301. },
  1302. helpInfo: " -setDefaultBrowser Set this app as the default browser client.\n" +
  1303. " -setDefaultMail Set this app as the default mail client.\n" +
  1304. " -setDefaultNews Set this app as the default newsreader.\n" +
  1305. " -setDefaultFeed Set this app as the default feedreader.\n",
  1306. classID: Components.ID("{a3d5b950-690a-491f-a881-2c2cdcd241cb}"),
  1307. - QueryInterface: XPCOMUtils.generateQI([nsICommandLineHandler])
  1308. + QueryInterface: ChromeUtils.generateQI([nsICommandLineHandler])
  1309. }
  1310. var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSetDefault]);
  1311. diff --git a/suite/components/sidebar/nsSidebar.js b/suite/components/sidebar/nsSidebar.js
  1312. --- a/suite/components/sidebar/nsSidebar.js
  1313. +++ b/suite/components/sidebar/nsSidebar.js
  1314. @@ -294,17 +294,17 @@ function (aSearchURL)
  1315. nsSidebar.prototype.classInfo = XPCOMUtils.generateCI({
  1316. classID: SIDEBAR_CID,
  1317. contractID: SIDEBAR_CONTRACTID,
  1318. classDescription: "Sidebar",
  1319. interfaces: [nsISidebar],
  1320. flags: nsIClassInfo.DOM_OBJECT});
  1321. nsSidebar.prototype.QueryInterface =
  1322. - XPCOMUtils.generateQI([nsISidebar]);
  1323. + ChromeUtils.generateQI([Ci.nsISidebar]);
  1324. nsSidebar.prototype.classID = SIDEBAR_CID;
  1325. var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSidebar]);
  1326. var gDebugLog;
  1327. /* static functions */
  1328. diff --git a/suite/components/sync/content/syncSetup.js b/suite/components/sync/content/syncSetup.js
  1329. --- a/suite/components/sync/content/syncSetup.js
  1330. +++ b/suite/components/sync/content/syncSetup.js
  1331. @@ -20,18 +20,18 @@ const SETUP_SUCCESS_PAGE = 8;
  1332. const RECAPTCHA_DOMAIN = "https://www.google.com";
  1333. const {Weave} = ChromeUtils.import("resource://services-sync/main.js");
  1334. var {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
  1335. const {PlacesUtils} = ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
  1336. const {PluralForm} = ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
  1337. var gSyncSetup = {
  1338. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
  1339. - Ci.nsISupportsWeakReference]),
  1340. + QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener,
  1341. + Ci.nsISupportsWeakReference]),
  1342. captchaBrowser: null,
  1343. wizard: null,
  1344. _disabledSites: [],
  1345. status: {
  1346. password: false,
  1347. email: false,
  1348. diff --git a/suite/components/sync/content/syncUI.js b/suite/components/sync/content/syncUI.js
  1349. --- a/suite/components/sync/content/syncUI.js
  1350. +++ b/suite/components/sync/content/syncUI.js
  1351. @@ -436,17 +436,17 @@ var gSyncUI = {
  1352. this.initNotifications();
  1353. break;
  1354. case "weave:ui:clear-error":
  1355. this.clearError();
  1356. break;
  1357. }
  1358. },
  1359. - QueryInterface: XPCOMUtils.generateQI([
  1360. + QueryInterface: ChromeUtils.generateQI([
  1361. Ci.nsIObserver,
  1362. Ci.nsISupportsWeakReference
  1363. ])
  1364. };
  1365. XPCOMUtils.defineLazyGetter(gSyncUI, "_stringBundle", function() {
  1366. //XXXzpao these strings should probably be moved from /services to /browser... (bug 583381)
  1367. // but for now just make it work
  1368. diff --git a/suite/components/tests/browser/browser_markPageAsFollowedLink.js b/suite/components/tests/browser/browser_markPageAsFollowedLink.js
  1369. --- a/suite/components/tests/browser/browser_markPageAsFollowedLink.js
  1370. +++ b/suite/components/tests/browser/browser_markPageAsFollowedLink.js
  1371. @@ -25,17 +25,17 @@ var observer = {
  1372. maybeClickLink();
  1373. }
  1374. else if (url == RIGHT_URL ) {
  1375. is(getTransitionForUrl(url), PlacesUtils.history.TRANSITION_FRAMED_LINK,
  1376. "User activated visits should get a FRAMED_LINK transition.");
  1377. finish();
  1378. }
  1379. },
  1380. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver])
  1381. + QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver])
  1382. };
  1383. Services.obs.addObserver(observer, "uri-visit-saved");
  1384. function test()
  1385. {
  1386. waitForExplicitFinish();
  1387. gBrowser.selectedTab = gBrowser.addTab(PAGE_URL);
  1388. let frameCount = 0;
  1389. diff --git a/suite/extensions/debugQA/content/debugQAEditorOverlay.js b/suite/extensions/debugQA/content/debugQAEditorOverlay.js
  1390. --- a/suite/extensions/debugQA/content/debugQAEditorOverlay.js
  1391. +++ b/suite/extensions/debugQA/content/debugQAEditorOverlay.js
  1392. @@ -153,24 +153,17 @@ sampleJSTransaction.prototype = {
  1393. merge: function(aTxn)
  1394. {
  1395. // We don't do any merging!
  1396. return false;
  1397. },
  1398. - QueryInterface: function(aIID, theResult)
  1399. - {
  1400. - if (aIID.equals(Ci.nsITransaction) ||
  1401. - aIID.equals(Ci.nsISupports))
  1402. - return this;
  1403. -
  1404. - throw Cr.NS_ERROR_NO_INTERFACE;
  1405. - },
  1406. + QueryInterface: ChromeUtils.generateQI([Ci.nsITransaction]),
  1407. insert_node_at_point: function(node, container, offset)
  1408. {
  1409. var childList = container.childNodes;
  1410. if (childList.length == 0 || offset >= childList.length)
  1411. container.appendChild(node);
  1412. else
  1413. diff --git a/suite/mailnews/components/compose/content/MsgComposeCommands.js b/suite/mailnews/components/compose/content/MsgComposeCommands.js
  1414. --- a/suite/mailnews/components/compose/content/MsgComposeCommands.js
  1415. +++ b/suite/mailnews/components/compose/content/MsgComposeCommands.js
  1416. @@ -448,25 +448,18 @@ var progressListener = {
  1417. } catch (ex) {}
  1418. },
  1419. onSecurityChange: function(aWebProgress, aRequest, state)
  1420. {
  1421. // we can ignore this notification
  1422. },
  1423. - QueryInterface : function(iid)
  1424. - {
  1425. - if (iid.equals(Ci.nsIWebProgressListener) ||
  1426. - iid.equals(Ci.nsISupportsWeakReference) ||
  1427. - iid.equals(Ci.nsISupports))
  1428. - return this;
  1429. -
  1430. - throw Cr.NS_NOINTERFACE;
  1431. - }
  1432. + QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener,
  1433. + Ci.nsISupportsWeakReference]),
  1434. };
  1435. var defaultController =
  1436. {
  1437. supportsCommand: function(command)
  1438. {
  1439. switch (command)
  1440. {
  1441. @@ -2920,25 +2913,18 @@ function OpenSelectedAttachment()
  1442. }
  1443. function nsAttachmentOpener()
  1444. {
  1445. }
  1446. nsAttachmentOpener.prototype =
  1447. {
  1448. - QueryInterface: function(iid)
  1449. - {
  1450. - if (iid.equals(Ci.nsIURIContentListener) ||
  1451. - iid.equals(Ci.nsIInterfaceRequestor) ||
  1452. - iid.equals(Ci.nsISupports)) {
  1453. - return this;
  1454. - }
  1455. - throw Cr.NS_NOINTERFACE;
  1456. - },
  1457. + QueryInterface: ChromeUtils.generateQI([Ci.nsIURIContentListener,
  1458. + Ci.nsIInterfaceRequestor]),
  1459. doContent: function(contentType, isContentPreferred, request, contentHandler)
  1460. {
  1461. return false;
  1462. },
  1463. isPreferred: function(contentType, desiredContentType)
  1464. {
  1465. diff --git a/suite/mailnews/components/compose/content/addressingWidgetOverlay.js b/suite/mailnews/components/compose/content/addressingWidgetOverlay.js
  1466. --- a/suite/mailnews/components/compose/content/addressingWidgetOverlay.js
  1467. +++ b/suite/mailnews/components/compose/content/addressingWidgetOverlay.js
  1468. @@ -1152,16 +1152,10 @@ AutomatedAutoCompleteHandler.prototype =
  1469. // that will automatically set the focus on a new available row, and make sure it is visible
  1470. awAddRecipient(this.recipientType ? this.recipientType : "addr_to", addressToAdd);
  1471. this.indexIntoNames++;
  1472. this.autoCompleteNextAddress();
  1473. },
  1474. - QueryInterface : function(iid)
  1475. - {
  1476. - if (iid.equals(Ci.nsIAutoCompleteListener) ||
  1477. - iid.equals(Ci.nsISupports))
  1478. - return this;
  1479. - throw Cr.NS_NOINTERFACE;
  1480. - }
  1481. + QueryInterface: ChromeUtils.generateQI([Ci.nsIAutoCompleteListener]),
  1482. }
  1483. diff --git a/suite/mailnews/content/SearchDialog.js b/suite/mailnews/content/SearchDialog.js
  1484. --- a/suite/mailnews/content/SearchDialog.js
  1485. +++ b/suite/mailnews/content/SearchDialog.js
  1486. @@ -498,24 +498,17 @@ nsMsgSearchCommandUpdater.prototype =
  1487. updateNextMessageAfterDelete : function()
  1488. {
  1489. SetNextMessageAfterDelete();
  1490. },
  1491. summarizeSelection: function() {return false},
  1492. - QueryInterface : function(iid)
  1493. - {
  1494. - if (iid.equals(Ci.nsIMsgDBViewCommandUpdater) ||
  1495. - iid.equals(Ci.nsISupports))
  1496. - return this;
  1497. -
  1498. - throw Cr.NS_NOINTERFACE;
  1499. - }
  1500. + QueryInterface: ChromeUtils.generateQI([Ci.nsIMsgDBViewCommandUpdater]),
  1501. }
  1502. function setupDatasource() {
  1503. gDBView = Cc["@mozilla.org/messenger/msgdbview;1?type=search"]
  1504. .createInstance(Ci.nsIMsgDBView);
  1505. var count = new Object;
  1506. var cmdupdator = new nsMsgSearchCommandUpdater();
  1507. diff --git a/suite/mailnews/content/browserRequest.js b/suite/mailnews/content/browserRequest.js
  1508. --- a/suite/mailnews/content/browserRequest.js
  1509. +++ b/suite/mailnews/content/browserRequest.js
  1510. @@ -7,23 +7,18 @@ const wpl = Ci.nsIWebProgressListener;
  1511. var reporterListener = {
  1512. _isBusy: false,
  1513. get securityButton() {
  1514. delete this.securityButton;
  1515. return this.securityButton = document.getElementById("security-button");
  1516. },
  1517. - QueryInterface: function(aIID) {
  1518. - if (aIID.equals(Ci.nsIWebProgressListener) ||
  1519. - aIID.equals(Ci.nsISupportsWeakReference) ||
  1520. - aIID.equals(Ci.nsISupports))
  1521. - return this;
  1522. - throw Cr.NS_NOINTERFACE;
  1523. - },
  1524. + QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener,
  1525. + Ci.nsISupportsWeakReference]),
  1526. onStateChange: function(/*in nsIWebProgress*/ aWebProgress,
  1527. /*in nsIRequest*/ aRequest,
  1528. /*in unsigned long*/ aStateFlags,
  1529. /*in nsresult*/ aStatus) {
  1530. },
  1531. onProgressChange: function(/*in nsIWebProgress*/ aWebProgress,
  1532. diff --git a/suite/mailnews/content/mailTasksOverlay.js b/suite/mailnews/content/mailTasksOverlay.js
  1533. --- a/suite/mailnews/content/mailTasksOverlay.js
  1534. +++ b/suite/mailnews/content/mailTasksOverlay.js
  1535. @@ -223,23 +223,18 @@ nsMsgBadCertHandler.prototype = {
  1536. },
  1537. // nsIInterfaceRequestor
  1538. getInterface: function(iid) {
  1539. return this.QueryInterface(iid);
  1540. },
  1541. // nsISupports
  1542. - QueryInterface: function(iid) {
  1543. - if (!iid.equals(Ci.nsIBadCertListener2) &&
  1544. - !iid.equals(Ci.nsIInterfaceRequestor) &&
  1545. - !iid.equals(Ci.nsISupports))
  1546. - throw Cr.NS_ERROR_NO_INTERFACE;
  1547. - return this;
  1548. - }
  1549. + QueryInterface: ChromeUtils.generateQI([Ci.nsIBadCertListener2,
  1550. + Ci.nsIInterfaceRequestor]),
  1551. };
  1552. function InformUserOfCertError(status, targetSite)
  1553. {
  1554. var params = { exceptionAdded : false,
  1555. sslStatus : status,
  1556. prefetchCert : true,
  1557. location : targetSite };
  1558. diff --git a/suite/mailnews/content/mailWindow.js b/suite/mailnews/content/mailWindow.js
  1559. --- a/suite/mailnews/content/mailWindow.js
  1560. +++ b/suite/mailnews/content/mailWindow.js
  1561. @@ -371,25 +371,19 @@ nsMsgStatusFeedback.prototype =
  1562. },
  1563. // Called before links are navigated to to allow us to retarget them if needed.
  1564. onBeforeLinkTraversal: function(aOriginalTarget, aLinkURI, aLinkNode, aIsAppTab)
  1565. {
  1566. return aOriginalTarget;
  1567. },
  1568. - QueryInterface : function(iid)
  1569. - {
  1570. - if (iid.equals(Ci.nsIMsgStatusFeedback) ||
  1571. - iid.equals(Ci.nsIXULBrowserWindow) ||
  1572. - iid.equals(Ci.nsISupportsWeakReference) ||
  1573. - iid.equals(Ci.nsISupports))
  1574. - return this;
  1575. - throw Cr.NS_NOINTERFACE;
  1576. - },
  1577. + QueryInterface: ChromeUtils.generateQI([Ci.nsIMsgStatusFeedback,
  1578. + Ci.nsIXULBrowserWindow,
  1579. + Ci.nsISupportsWeakReference]),
  1580. // nsIMsgStatusFeedback implementation.
  1581. showStatusString : function(statusText)
  1582. {
  1583. this.ensureStatusFields();
  1584. if ( !statusText.length )
  1585. statusText = this.myDefaultStatus;
  1586. else
  1587. @@ -495,23 +489,17 @@ nsMsgStatusFeedback.prototype =
  1588. function nsMsgWindowCommands()
  1589. {
  1590. }
  1591. nsMsgWindowCommands.prototype =
  1592. {
  1593. - QueryInterface : function(iid)
  1594. - {
  1595. - if (iid.equals(Ci.nsIMsgWindowCommands) ||
  1596. - iid.equals(Ci.nsISupports))
  1597. - return this;
  1598. - throw Cr.NS_NOINTERFACE;
  1599. - },
  1600. + QueryInterface: ChromeUtils.generateQI([Ci.nsIMsgWindowCommands]),
  1601. selectFolder: function(folderUri)
  1602. {
  1603. gFolderTreeView.selectFolder(MailUtils.getFolderForURI(folderUri));
  1604. },
  1605. selectMessage: function(messageUri)
  1606. {
  1607. diff --git a/suite/mailnews/content/mailWindowOverlay.js b/suite/mailnews/content/mailWindowOverlay.js
  1608. --- a/suite/mailnews/content/mailWindowOverlay.js
  1609. +++ b/suite/mailnews/content/mailWindowOverlay.js
  1610. @@ -1197,25 +1197,20 @@ BatchMessageMover.prototype =
  1611. if (aFolder.parent == this._dstFolderParent &&
  1612. aFolder.name == this._dstFolderName) {
  1613. this._dstFolderParent = null;
  1614. this._dstFolderName = null;
  1615. this.continueBatch();
  1616. }
  1617. },
  1618. - QueryInterface(aIID) {
  1619. - if (aIID.equals(Ci.nsIUrlListener) ||
  1620. - aIID.equals(Ci.nsIMsgCopyServiceListener) ||
  1621. - aIID.equals(Ci.nsIMsgFolderListener) ||
  1622. - aIID.equals(Ci.nsIMsgOperationListener) ||
  1623. - aIID.equals(Ci.nsISupports))
  1624. - return this;
  1625. - throw Cr.NS_ERROR_NO_INTERFACE;
  1626. - }
  1627. + QueryInterface: ChromeUtils.generateQI([Ci.nsIUrlListener,
  1628. + Ci.nsIMsgCopyServiceListener,
  1629. + Ci.nsIMsgFolderListener,
  1630. + Ci.nsIMsgOperationListener]),
  1631. }
  1632. function MsgArchiveSelectedMessages(aEvent) {
  1633. let batchMover = new BatchMessageMover();
  1634. batchMover.archiveMessages(gFolderDisplay.selectedMessages);
  1635. }
  1636. diff --git a/suite/mailnews/content/messageWindow.js b/suite/mailnews/content/messageWindow.js
  1637. --- a/suite/mailnews/content/messageWindow.js
  1638. +++ b/suite/mailnews/content/messageWindow.js
  1639. @@ -153,24 +153,17 @@ nsMsgDBViewCommandUpdater.prototype =
  1640. updateNextMessageAfterDelete : function()
  1641. {
  1642. SetNextMessageAfterDelete();
  1643. },
  1644. summarizeSelection: function() {return false},
  1645. - QueryInterface : function(iid)
  1646. - {
  1647. - if (iid.equals(Ci.nsIMsgDBViewCommandUpdater) ||
  1648. - iid.equals(Ci.nsISupports))
  1649. - return this;
  1650. -
  1651. - throw Cr.NS_NOINTERFACE;
  1652. - }
  1653. + QueryInterface: ChromeUtils.generateQI([Ci.nsIMsgDBViewCommandUpdater]),
  1654. }
  1655. function HandleDeleteOrMoveMsgCompleted(folder)
  1656. {
  1657. if ((folder.URI == gCurrentFolderUri) && gCurrentMessageIsDeleted)
  1658. {
  1659. gDBView.onDeleteCompleted(true);
  1660. gCurrentMessageIsDeleted = false;
  1661. diff --git a/suite/mailnews/content/msgHdrViewOverlay.js b/suite/mailnews/content/msgHdrViewOverlay.js
  1662. --- a/suite/mailnews/content/msgHdrViewOverlay.js
  1663. +++ b/suite/mailnews/content/msgHdrViewOverlay.js
  1664. @@ -316,17 +316,17 @@ function OnAddressBookDataChanged(aActio
  1665. }
  1666. });
  1667. }
  1668. // The messageHeaderSink is the class that gets notified of a message's headers as we display the message
  1669. // through our mime converter.
  1670. var messageHeaderSink = {
  1671. - QueryInterface: XPCOMUtils.generateQI(
  1672. + QueryInterface: ChromeUtils.generateQI(
  1673. [Ci.nsIMsgHeaderSink]),
  1674. onStartHeaders: function()
  1675. {
  1676. this.mSaveHdr = null;
  1677. // clear out any pending collected address timers...
  1678. if (gCollectAddressTimer)
  1679. {
  1680. clearTimeout(gCollectAddressTimer);
  1681. @@ -1883,17 +1883,17 @@ var attachmentAreaDNDObserver = {
  1682. };
  1683. function nsFlavorDataProvider()
  1684. {
  1685. }
  1686. nsFlavorDataProvider.prototype =
  1687. {
  1688. - QueryInterface: XPCOMUtils.generateQI([Ci.nsIFlavorDataProvider]),
  1689. + QueryInterface: ChromeUtils.generateQI([Ci.nsIFlavorDataProvider]),
  1690. getFlavorData : function(aTransferable, aFlavor, aData, aDataLen)
  1691. {
  1692. // get the url for the attachment
  1693. if (aFlavor == "application/x-moz-file-promise")
  1694. {
  1695. var urlPrimitive = { };
  1696. var dataSize = { };
  1697. diff --git a/suite/mailnews/content/threadPane.js b/suite/mailnews/content/threadPane.js
  1698. --- a/suite/mailnews/content/threadPane.js
  1699. +++ b/suite/mailnews/content/threadPane.js
  1700. @@ -96,24 +96,17 @@ nsMsgDBViewCommandUpdater.prototype =
  1701. updateNextMessageAfterDelete : function()
  1702. {
  1703. SetNextMessageAfterDelete();
  1704. },
  1705. summarizeSelection: function() {return false},
  1706. - QueryInterface : function(iid)
  1707. - {
  1708. - if (iid.equals(Ci.nsIMsgDBViewCommandUpdater) ||
  1709. - iid.equals(Ci.nsISupports))
  1710. - return this;
  1711. -
  1712. - throw Cr.NS_NOINTERFACE;
  1713. - }
  1714. + QueryInterface: ChromeUtils.generateQI([Ci.nsIMsgDBViewCommandUpdater]),
  1715. }
  1716. function HandleColumnClick(columnID)
  1717. {
  1718. const columnMap = {dateCol: 'byDate',
  1719. receivedCol: 'byReceived',
  1720. senderCol: 'byAuthor',
  1721. recipientCol: 'byRecipient',
  1722. diff --git a/suite/modules/WindowsPreviewPerTab.jsm b/suite/modules/WindowsPreviewPerTab.jsm
  1723. --- a/suite/modules/WindowsPreviewPerTab.jsm
  1724. +++ b/suite/modules/WindowsPreviewPerTab.jsm
  1725. @@ -154,17 +154,17 @@ function PreviewController(win, tab) {
  1726. XPCOMUtils.defineLazyGetter(this, "canvasPreview", function () {
  1727. let canvas = PageThumbs.createCanvas();
  1728. canvas.mozOpaque = true;
  1729. return canvas;
  1730. });
  1731. }
  1732. PreviewController.prototype = {
  1733. - QueryInterface: XPCOMUtils.generateQI([Ci.nsITaskbarPreviewController]),
  1734. + QueryInterface: ChromeUtils.generateQI([Ci.nsITaskbarPreviewController]),
  1735. _cachedWidth: 0,
  1736. _cachedHeight: 0,
  1737. destroy: function () {
  1738. this.tab.removeEventListener("TabAttrModified", this);
  1739. // Break cycles, otherwise we end up leaking the window with everything
  1740. @@ -849,19 +849,19 @@ var AeroPeek = {
  1741. if (tab.getAttribute("image") == newValue) {
  1742. win.onLinkIconAvailable(tab.linkedBrowser, newValue);
  1743. }
  1744. }
  1745. }
  1746. }
  1747. },
  1748. - QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference,
  1749. - Ci.nsINavHistoryObserver,
  1750. - Ci.nsIObserver]),
  1751. + QueryInterface: ChromeUtils.generateQI([Ci.nsISupportsWeakReference,
  1752. + Ci.nsINavHistoryObserver,
  1753. + Ci.nsIObserver]),
  1754. };
  1755. XPCOMUtils.defineLazyGetter(AeroPeek, "cacheTimer", () =>
  1756. Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer)
  1757. );
  1758. XPCOMUtils.defineLazyServiceGetter(AeroPeek, "prefs",
  1759. "@mozilla.org/preferences-service;1",