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

Side by Side Diff: lib/utils.js

Issue 29408710: Issue 5050 - Make legacy extension use WebExtensions I/O (Closed) Base URL: https://hg.adblockplus.org/adblockplus
Patch Set: Created April 10, 2017, 11:23 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
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 selectedItem = subscription; 319 selectedItem = subscription;
320 selectedPrefix = prefix; 320 selectedPrefix = prefix;
321 } 321 }
322 } 322 }
323 } 323 }
324 } 324 }
325 return selectedItem; 325 return selectedItem;
326 }, 326 },
327 327
328 /** 328 /**
329 * Pauses code execution and allows events to be processed. Warning: 329 * DEPRECATED, do not use!
330 * other extension code might execute, the extension might even shut down.
331 */ 330 */
332 yield: function() 331 yield: function()
333 { 332 {
334 let {Prefs} = require("prefs");
335 if (Prefs.please_kill_startup_performance)
336 {
337 this.yield = function() {};
338 return;
339 }
340 return new Promise((resolve, reject) => Utils.runAsync(resolve));
341 }, 333 },
342 334
343 /** 335 /**
344 * Saves sidebar state before detaching/reattaching 336 * Saves sidebar state before detaching/reattaching
345 */ 337 */
346 setParams: function(params) 338 setParams: function(params)
347 { 339 {
348 sidebarParams = params; 340 sidebarParams = params;
349 }, 341 },
350 342
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 Cu.reportError(e); 737 Cu.reportError(e);
746 // Expected, ctypes isn't supported in Gecko 1.9.2 738 // Expected, ctypes isn't supported in Gecko 1.9.2
747 return null; 739 return null;
748 } 740 }
749 }); 741 });
750 742
751 if ("@mozilla.org/messenger/headerparser;1" in Cc) 743 if ("@mozilla.org/messenger/headerparser;1" in Cc)
752 XPCOMUtils.defineLazyServiceGetter(Utils, "headerParser", "@mozilla.org/messen ger/headerparser;1", "nsIMsgHeaderParser"); 744 XPCOMUtils.defineLazyServiceGetter(Utils, "headerParser", "@mozilla.org/messen ger/headerparser;1", "nsIMsgHeaderParser");
753 else 745 else
754 Utils.headerParser = null; 746 Utils.headerParser = null;
OLDNEW

Powered by Google App Engine
This is Rietveld