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

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

Issue 29331914: Issue 2809 - Issue reporter: Handle canvas.drawWindow() failure gracefully (Closed)
Patch Set: Created Dec. 4, 2015, 1:20 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 | « no previous file | no next file » | 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
@@ -361,17 +361,24 @@ let screenshotDataSource =
let copyY = Math.max(Math.min(wnd.scrollY - copyHeight / 2, wndHeight - copyHeight), 0);
let scalingFactor = (this._canvas.width - this.imageOffset * 2) / copyWidth;
this._canvas.height = copyHeight * scalingFactor + this.imageOffset * 2;
this._context.save();
this._context.translate(this.imageOffset, this.imageOffset);
this._context.scale(scalingFactor, scalingFactor);
- this._context.drawWindow(wnd, copyX, copyY, copyWidth, copyHeight, "rgb(255,255,255)");
+ try
+ {
+ this._context.drawWindow(wnd, copyX, copyY, copyWidth, copyHeight, "rgb(255,255,255)");
+ }
+ catch (e)
+ {
+ Cu.reportError(e);
+ }
this._context.restore();
// Init canvas settings
this._context.fillStyle = "rgb(0, 0, 0)";
this._context.strokeStyle = "rgba(255, 0, 0, 0.7)";
this._context.lineWidth = 3;
this._context.lineJoin = "round";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld