Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #12782 from alivedise/bugzilla/925609/remove-windo…
Browse files Browse the repository at this point in the history
…wmanager-screenshots

Bug 925609 - Remove WindowManager.screenshots, r=timdream
  • Loading branch information
alivedise committed Oct 13, 2013
2 parents e0f8bd9 + 62a4ff6 commit 0ee3a34
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
5 changes: 1 addition & 4 deletions apps/system/js/cards_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,7 @@ var CardsView = (function() {
// before we remove it. Otherwise the rendering is not smooth.
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=844245
setTimeout(function() {

// Override the cached image
URL.revokeObjectURL(cachedLayer);
WindowManager.screenshots[origin] = objectURL;
app.saveCachedScreenshot(objectURL);
}, 200);
}
};
Expand Down
13 changes: 6 additions & 7 deletions apps/system/js/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,6 @@

if (!this.iframe.classList.contains('hidden'))
this._hideFrame();

// XXX: we ought not to change screenshots at Window Manager
// here. In the long run Window Manager should replace
// its screenshots variable with appWindow._screenshotURL.
if (WindowManager.screenshots[this.origin]) {
URL.revokeObjectURL(WindowManager.screenshots[this.origin]);
}
}.bind(this));
};

Expand All @@ -286,6 +279,9 @@
// Save and update screenshot URL.
AppWindow.prototype.saveCachedScreenshot =
function aw_saveScreenshot(screenshot) {
if (this._screenshotURL) {
URL.revokeObjectURL(this._screenshotURL);
}
this._screenshotURL = screenshot;
};

Expand Down Expand Up @@ -319,6 +315,9 @@

req.onsuccess = function gotScreenshotFromFrame(evt) {
var result = evt.target.result;
if (self._screenshotURL) {
URL.revokeObjectURL(self._screenshotURL);
}
self._screenshotURL = URL.createObjectURL(result);
callback(result);
};
Expand Down

0 comments on commit 0ee3a34

Please sign in to comment.