Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/utils.js

Issue 5743717579227136: Get rid of Utils.threadManager (Closed)
Patch Set: Removed a line that is no longer in use Created March 13, 2014, 11:52 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/requestNotifier.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 */ 218 */
219 runAsync: function(/**Function*/ callback, /**Object*/ thisPtr) 219 runAsync: function(/**Function*/ callback, /**Object*/ thisPtr)
220 { 220 {
221 let params = Array.prototype.slice.call(arguments, 2); 221 let params = Array.prototype.slice.call(arguments, 2);
222 let runnable = { 222 let runnable = {
223 run: function() 223 run: function()
224 { 224 {
225 callback.apply(thisPtr, params); 225 callback.apply(thisPtr, params);
226 } 226 }
227 }; 227 };
228 Utils.threadManager.currentThread.dispatch(runnable, Ci.nsIEventTarget.DISPA TCH_NORMAL); 228 Services.tm.currentThread.dispatch(runnable, Ci.nsIEventTarget.DISPATCH_NORM AL);
229 }, 229 },
230 230
231 /** 231 /**
232 * Gets the DOM window associated with a particular request (if any). 232 * Gets the DOM window associated with a particular request (if any).
233 */ 233 */
234 getRequestWindow: function(/**nsIChannel*/ channel) /**nsIDOMWindow*/ 234 getRequestWindow: function(/**nsIChannel*/ channel) /**nsIDOMWindow*/
235 { 235 {
236 try 236 try
237 { 237 {
238 if (channel.notificationCallbacks) 238 if (channel.notificationCallbacks)
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 { 578 {
579 this._ringBuffer = new Array(this._ringBuffer.length); 579 this._ringBuffer = new Array(this._ringBuffer.length);
580 this.data = {__proto__: null}; 580 this.data = {__proto__: null};
581 } 581 }
582 } 582 }
583 583
584 // Getters for common services, this should be replaced by Services.jsm in futur e 584 // Getters for common services, this should be replaced by Services.jsm in futur e
585 585
586 XPCOMUtils.defineLazyServiceGetter(Utils, "categoryManager", "@mozilla.org/categ orymanager;1", "nsICategoryManager"); 586 XPCOMUtils.defineLazyServiceGetter(Utils, "categoryManager", "@mozilla.org/categ orymanager;1", "nsICategoryManager");
587 XPCOMUtils.defineLazyServiceGetter(Utils, "ioService", "@mozilla.org/network/io- service;1", "nsIIOService"); 587 XPCOMUtils.defineLazyServiceGetter(Utils, "ioService", "@mozilla.org/network/io- service;1", "nsIIOService");
588 XPCOMUtils.defineLazyServiceGetter(Utils, "threadManager", "@mozilla.org/thread- manager;1", "nsIThreadManager");
589 XPCOMUtils.defineLazyServiceGetter(Utils, "promptService", "@mozilla.org/embedco mp/prompt-service;1", "nsIPromptService"); 588 XPCOMUtils.defineLazyServiceGetter(Utils, "promptService", "@mozilla.org/embedco mp/prompt-service;1", "nsIPromptService");
590 XPCOMUtils.defineLazyServiceGetter(Utils, "effectiveTLD", "@mozilla.org/network/ effective-tld-service;1", "nsIEffectiveTLDService"); 589 XPCOMUtils.defineLazyServiceGetter(Utils, "effectiveTLD", "@mozilla.org/network/ effective-tld-service;1", "nsIEffectiveTLDService");
591 XPCOMUtils.defineLazyServiceGetter(Utils, "netUtils", "@mozilla.org/network/util ;1", "nsINetUtil"); 590 XPCOMUtils.defineLazyServiceGetter(Utils, "netUtils", "@mozilla.org/network/util ;1", "nsINetUtil");
592 XPCOMUtils.defineLazyServiceGetter(Utils, "styleService", "@mozilla.org/content/ style-sheet-service;1", "nsIStyleSheetService"); 591 XPCOMUtils.defineLazyServiceGetter(Utils, "styleService", "@mozilla.org/content/ style-sheet-service;1", "nsIStyleSheetService");
593 XPCOMUtils.defineLazyServiceGetter(Utils, "prefService", "@mozilla.org/preferenc es-service;1", "nsIPrefService"); 592 XPCOMUtils.defineLazyServiceGetter(Utils, "prefService", "@mozilla.org/preferenc es-service;1", "nsIPrefService");
594 XPCOMUtils.defineLazyServiceGetter(Utils, "versionComparator", "@mozilla.org/xpc om/version-comparator;1", "nsIVersionComparator"); 593 XPCOMUtils.defineLazyServiceGetter(Utils, "versionComparator", "@mozilla.org/xpc om/version-comparator;1", "nsIVersionComparator");
595 XPCOMUtils.defineLazyServiceGetter(Utils, "windowMediator", "@mozilla.org/appshe ll/window-mediator;1", "nsIWindowMediator"); 594 XPCOMUtils.defineLazyServiceGetter(Utils, "windowMediator", "@mozilla.org/appshe ll/window-mediator;1", "nsIWindowMediator");
596 XPCOMUtils.defineLazyServiceGetter(Utils, "windowWatcher", "@mozilla.org/embedco mp/window-watcher;1", "nsIWindowWatcher"); 595 XPCOMUtils.defineLazyServiceGetter(Utils, "windowWatcher", "@mozilla.org/embedco mp/window-watcher;1", "nsIWindowWatcher");
597 XPCOMUtils.defineLazyServiceGetter(Utils, "chromeRegistry", "@mozilla.org/chrome /chrome-registry;1", "nsIXULChromeRegistry"); 596 XPCOMUtils.defineLazyServiceGetter(Utils, "chromeRegistry", "@mozilla.org/chrome /chrome-registry;1", "nsIXULChromeRegistry");
598 XPCOMUtils.defineLazyServiceGetter(Utils, "systemPrincipal", "@mozilla.org/syste mprincipal;1", "nsIPrincipal"); 597 XPCOMUtils.defineLazyServiceGetter(Utils, "systemPrincipal", "@mozilla.org/syste mprincipal;1", "nsIPrincipal");
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 Cu.reportError(e); 762 Cu.reportError(e);
764 // Expected, ctypes isn't supported in Gecko 1.9.2 763 // Expected, ctypes isn't supported in Gecko 1.9.2
765 return null; 764 return null;
766 } 765 }
767 }); 766 });
768 767
769 if ("@mozilla.org/messenger/headerparser;1" in Cc) 768 if ("@mozilla.org/messenger/headerparser;1" in Cc)
770 XPCOMUtils.defineLazyServiceGetter(Utils, "headerParser", "@mozilla.org/messen ger/headerparser;1", "nsIMsgHeaderParser"); 769 XPCOMUtils.defineLazyServiceGetter(Utils, "headerParser", "@mozilla.org/messen ger/headerparser;1", "nsIMsgHeaderParser");
771 else 770 else
772 Utils.headerParser = null; 771 Utils.headerParser = null;
OLDNEW
« no previous file with comments | « lib/requestNotifier.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld