Bug 809056 - Reduce thumbnailing impact by capturing and storing only top sites. r=markh

This commit is contained in:
Drew Willcoxon 2014-01-07 12:59:18 -08:00
parent ac9ff97905
commit 5814ec2ee9
2 changed files with 7 additions and 1 deletions

View File

@ -4,6 +4,8 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#endif
Cu.import("resource://gre/modules/NewTabUtils.jsm");
/**
* Keeps thumbnails of open web pages up-to-date.
*/
@ -120,6 +122,10 @@ let gBrowserThumbnails = {
},
_shouldCapture: function Thumbnails_shouldCapture(aBrowser) {
// Capture only if it's a top site in about:newtab.
if (NewTabUtils.links.getLinks().indexOf(aBrowser.currentURI.spec) < 0)
return false;
// Capture only if it's the currently selected tab.
if (aBrowser != gBrowser.selectedBrowser)
return false;

View File

@ -621,7 +621,7 @@ let Links = {
let pinnedLinks = Array.slice(PinnedLinks.links);
// Filter blocked and pinned links.
let links = this._links.filter(function (link) {
let links = (this._links || []).filter(function (link) {
return !BlockedLinks.isBlocked(link) && !PinnedLinks.isPinned(link);
});