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

Unified Diff: lib/utils.js

Issue 29340852: Issue 3993 - Implement Utils.yield() in a better way (ABP/Firefox part) (Closed)
Patch Set: Finalized revisions and added comment Created April 28, 2016, 12:16 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/io.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/utils.js
===================================================================
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -352,18 +352,17 @@ let Utils = exports.Utils =
yield: function()
{
let {Prefs} = require("prefs");
if (Prefs.please_kill_startup_performance)
{
this.yield = function() {};
return;
}
- let thread = Services.tm.currentThread;
- while (thread.processNextEvent(false));
+ return new Promise((resolve, reject) => Utils.runAsync(resolve));
},
/**
* Saves sidebar state before detaching/reattaching
*/
setParams: function(params)
{
sidebarParams = params;
« no previous file with comments | « lib/io.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld