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

Unified Diff: chrome/content/ui/sendReport.js

Issue 5743717579227136: Get rid of Utils.threadManager (Closed)
Patch Set: Created March 13, 2014, 11:49 a.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 | « no previous file | lib/requestNotifier.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/ui/sendReport.js
===================================================================
--- a/chrome/content/ui/sendReport.js
+++ b/chrome/content/ui/sendReport.js
@@ -376,17 +376,17 @@ let screenshotDataSource =
this._context.lineJoin = "round";
// Reduce colors asynchronously
this._pixelData = this._context.getImageData(this.imageOffset, this.imageOffset,
this._canvas.width - this.imageOffset * 2,
this._canvas.height - this.imageOffset * 2);
this._max = this._pixelData.width * this._pixelData.height * 4;
this._i = 0;
- Utils.threadManager.currentThread.dispatch(this, Ci.nsIEventTarget.DISPATCH_NORMAL);
+ Utils.runAsync(this.run.bind(this));
},
run: function()
{
// Process only 5000 bytes at a time to prevent browser hangs
let endIndex = Math.min(this._i + 5000, this._max);
let i = this._i;
for (; i < endIndex; i++)
@@ -396,17 +396,17 @@ let screenshotDataSource =
{
// Save data back and we are done
this._context.putImageData(this._pixelData, this.imageOffset, this.imageOffset);
this._callback();
}
else
{
this._i = i;
- Utils.threadManager.currentThread.dispatch(this, Ci.nsIEventTarget.DISPATCH_NORMAL);
+ Utils.runAsync(this.run.bind(this));
}
},
get enabled() this._enabled,
set enabled(enabled)
{
if (this._enabled == enabled)
return;
« no previous file with comments | « no previous file | lib/requestNotifier.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld