Closed
Bug 1058237
Opened 11 years ago
Closed 11 years ago
Ctrl-Tab previews should use the PageThumbs API
Categories
(Firefox :: General, defect)
Firefox
General
Tracking
()
People
(Reporter: dao, Assigned: dao)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
12.95 KB,
patch
|
ttaubert
:
review+
|
Details | Diff | Splinter Review |
Ctrl-Tab preview code currently has custom code calling drawWindow. It should instead use the PageThumbs API. This way it can get the previews cached on disk, which has stopped working ever since browser-thumbnails.js started excluding pages that aren't on about:newtab.
Since it looks like drawWindow called from the parent process isn't going to work for remote tabs (bug 698371), this is also a means to get this code e10s ready such at will benefit automatically from bug 863512.
https://tbpl.mozilla.org/?tree=Try&rev=a34858fd6dcb
Attachment #8478550 -
Flags: review?(ttaubert)
Updated•11 years ago
|
Flags: qe-verify-
Comment 1•11 years ago
|
||
Comment on attachment 8478550 [details] [diff] [review]
patch
Review of attachment 8478550 [details] [diff] [review]:
-----------------------------------------------------------------
::: browser/base/content/browser-tabPreviews.js
@@ +59,4 @@
>
> + PageThumbs.captureAndStore(browser, function () {
> + img.src = PageThumbs.getThumbnailURL(uri);
> + });
So why are we capturing and storing here as well? browser-thumbnails.js takes care of that already for top-site thumbnails. Creating a canvas, capturing and returning it should be sufficient, no?
Attachment #8478550 -
Flags: review?(ttaubert) → feedback+
| Assignee | ||
Comment 2•11 years ago
|
||
(In reply to Tim Taubert [:ttaubert] from comment #1)
> Comment on attachment 8478550 [details] [diff] [review]
> patch
>
> Review of attachment 8478550 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: browser/base/content/browser-tabPreviews.js
> @@ +59,4 @@
> >
> > + PageThumbs.captureAndStore(browser, function () {
> > + img.src = PageThumbs.getThumbnailURL(uri);
> > + });
>
> So why are we capturing and storing here as well?
Because otherwise these thumbnails are blank when restoring a session with unloaded tabs. (Except for pages that also happen to be on about:newtab.)
| Assignee | ||
Comment 3•11 years ago
|
||
That's also why this patch adds an expiration filter. This is pointless if PageThumbs doesn't store these thumbnails in the first place.
| Assignee | ||
Updated•11 years ago
|
Attachment #8478550 -
Flags: review?(ttaubert)
Updated•11 years ago
|
Iteration: 34.3 → 35.1
Comment 4•11 years ago
|
||
Comment on attachment 8478550 [details] [diff] [review]
patch
Review of attachment 8478550 [details] [diff] [review]:
-----------------------------------------------------------------
::: browser/base/content/browser-tabPreviews.js
@@ +52,4 @@
>
> + // FIXME: The gBrowserThumbnails._shouldCapture determines whether
> + // thumbnails should be written to disk. This should somehow be part
> + // of the PageThumbs API.
Agreed, if more places need it, it would make sense to move it there.
::: browser/base/content/browser-thumbnails.js
@@ +123,4 @@
> this._timeouts.set(aBrowser, timeout);
> },
>
> _shouldCapture: function Thumbnails_shouldCapture(aBrowser) {
Should probably make this a "public" function.
@@ -127,5 @@
> return false;
>
> - // Only capture about:newtab top sites.
> - if (this._topSiteURLs.indexOf(aBrowser.currentURI.spec) < 0)
> - return false;
Instead of moving this to _capture(), how about adding a second parameter to .shouldCapture() to take options? We could then pass something like {onlyTopSites: false}.
Attachment #8478550 -
Flags: review?(ttaubert)
Attachment #8478550 -
Flags: review+
Attachment #8478550 -
Flags: feedback+
| Assignee | ||
Comment 5•11 years ago
|
||
> ::: browser/base/content/browser-thumbnails.js
> @@ +123,4 @@
> > this._timeouts.set(aBrowser, timeout);
> > },
> >
> > _shouldCapture: function Thumbnails_shouldCapture(aBrowser) {
>
> Should probably make this a "public" function.
>
> @@ -127,5 @@
> > return false;
> >
> > - // Only capture about:newtab top sites.
> > - if (this._topSiteURLs.indexOf(aBrowser.currentURI.spec) < 0)
> > - return false;
>
> Instead of moving this to _capture(), how about adding a second parameter to
> .shouldCapture() to take options? We could then pass something like
> {onlyTopSites: false}.
Since we seem to agree that this should be in PageThumbs, I'd rather file a bug on that than making this method public or adding further parameters to it.
Comment 6•11 years ago
|
||
(In reply to Dão Gottwald [:dao] from comment #5)
> Since we seem to agree that this should be in PageThumbs, I'd rather file a
> bug on that than making this method public or adding further parameters to
> it.
Sure, wfm too.
| Assignee | ||
Comment 7•11 years ago
|
||
Comment 8•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 35
You need to log in
before you can comment on or make changes to this bug.
Description
•