Closed Bug 726929 Opened 12 years ago Closed 12 years ago

large session restore screenshots taken too often

Categories

(Firefox for Android Graveyard :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 13

People

(Reporter: blassey, Assigned: blassey)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch patch (obsolete) — Splinter Review
This is slowing down several things, including the tabs tray and various dialogs
Attachment #596937 - Flags: review?(mark.finkle)
Comment on attachment 596937 [details] [diff] [review]
patch


>+                ViewportMetrics viewportMetrics = mSoftwareLayerClient.getGeckoViewportMetrics();
>+                String viewportJSON = null;
>+                if (viewportMetrics != null)
>+                    viewportJSON = viewportMetrics.toJSON();
>+                if (viewportJSON == null || viewportJSON.equals(mLastViewport) &&
>+                    mLastTitle.equals(lastHistoryEntry.mTitle) &&
>+                    mLastSnapshotUri.equals(lastHistoryEntry.mUri))
>                     return;

Can we drop the mLastTitle check and move the mLastSnapshotUri check into it's own if-block above the viewportMetrics check?
Attachment #596937 - Flags: review?(mark.finkle) → review+
(In reply to Mark Finkle (:mfinkle) from comment #1)
> Comment on attachment 596937 [details] [diff] [review]
> patch
> 
> 
> >+                ViewportMetrics viewportMetrics = mSoftwareLayerClient.getGeckoViewportMetrics();
> >+                String viewportJSON = null;
> >+                if (viewportMetrics != null)
> >+                    viewportJSON = viewportMetrics.toJSON();
> >+                if (viewportJSON == null || viewportJSON.equals(mLastViewport) &&
> >+                    mLastTitle.equals(lastHistoryEntry.mTitle) &&
> >+                    mLastSnapshotUri.equals(lastHistoryEntry.mUri))
> >                     return;
> 
> Can we drop the mLastTitle check and move the mLastSnapshotUri check into
> it's own if-block above the viewportMetrics check?

My thought was that if the title changed, our screenshot was probably stale. Also, now that I look at this it was supposed to be:


> >+    if ((viewportJSON == null || viewportJSON.equals(mLastViewport)) &&
> >+        mLastTitle.equals(lastHistoryEntry.mTitle) &&
> >+        mLastSnapshotUri.equals(lastHistoryEntry.mUri))
> >             return;
(In reply to Brad Lassey [:blassey] from comment #2)
> My thought was that if the title changed, our screenshot was probably stale.
> Also, now that I look at this it was supposed to be:
> 
> 
> > >+    if ((viewportJSON == null || viewportJSON.equals(mLastViewport)) &&
> > >+        mLastTitle.equals(lastHistoryEntry.mTitle) &&
> > >+        mLastSnapshotUri.equals(lastHistoryEntry.mUri))
> > >             return;

Actually, scratch that. What's in the patch is right. Also, this apparently needs a comment since it confused me.
re-requesting review since I didn't drop the title check
Assignee: nobody → blassey.bugs
Attachment #596937 - Attachment is obsolete: true
Attachment #597172 - Flags: review?(mark.finkle)
Attachment #597172 - Flags: review?(mark.finkle) → review+
https://hg.mozilla.org/mozilla-central/rev/f28fe2f0fe66
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 13
From IRC discussion, here are more options for improvement:

1) reducing the number of spurious document-stop events we're getting (~20-30 on CNN)
2) better coalescing of the screenshot runnables
3) not screenshotting during a pan
4) fixing getBitmap() to work with OGL layers
(In reply to Kartikaya Gupta (:kats) from comment #7)
> From IRC discussion, here are more options for improvement:
> 
> 1) reducing the number of spurious document-stop events we're getting
> (~20-30 on CNN)
> 2) better coalescing of the screenshot runnables
> 3) not screenshotting during a pan
> 4) fixing getBitmap() to work with OGL layers

Kats, can you please file follow up bugs for each of those?
I filed bug 727701 and bug 727703 for the first two items on the list. The third one actually shouldn't be a problem; if the (one and only) document-stop event happens while the user is panning, there shouldn't be a problem with using that image as the thumbnail, and the runnable-coalescing should prevent grabbing multiple useless screenshots because the user is panning.

For the 4th item on the list, there's already bug 725120 which seems like a general catch-all for getBitmap(), so I'll add a comment there.
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: