Closed Bug 721208 Opened 14 years ago Closed 14 years ago

Tab screenshots can hose the gecko event loop

Categories

(Firefox for Android Graveyard :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(firefox11 fixed, firefox12 fixed, fennec11+)

RESOLVED FIXED
Firefox 12
Tracking Status
firefox11 --- fixed
firefox12 --- fixed
fennec 11+ ---

People

(Reporter: blassey, Assigned: blassey)

Details

(Whiteboard: [inbound])

Attachments

(1 file)

Attached patch patch — — Splinter Review
No description provided.
Attachment #591604 - Flags: review?(mark.finkle)
Comment on attachment 591604 [details] [diff] [review] patch I'm not a big fan of the actual impl, but I understand the reason we would need this. This pass is a "can I make myself like this better" review >diff -r 5f6d25767d30 -r e6336e3e1e8c mobile/android/base/TabsTray.java >+ GeckoAppShell.sendEventToGecko(new GeckoEvent("Tab:CancelScreenshots","")); nit: "Tab:Screenshot:Cancel" >diff -r 5f6d25767d30 -r e6336e3e1e8c mobile/android/chrome/content/browser.js > Services.obs.addObserver(this, "Tab:Screenshot", false); >+ Services.obs.addObserver(this, "Tab:ScreenshotNext", false); I'd like to switch to use the thread manager and dispatching to continue the queue, so let's remove this, but you do need to add "Tab:Screenshot:Cancel" > screenshotTab: function screenshotTab(aData) { >+ if (this.screenshotQueue == null) { >+ this.screenShotQueue = new Array(); nit: use [] this.screenShotQueue = []; >+ doNextScreenshot: function() { >+ if (this.screenshotQueue == null || this.screenshotQueue.length == 0) { >+ this.screenshotQueue = null; >+ return nit: add ; >+ } else if (aTopic == "Tab:ScreenshotNext") { >+ this.doNextScreenshot(); Remove >+ } else if (aTopic == "Tab:CancelScreenshots") { "Tab:Screenshot:Cancel" > sendMessageToJava(message); >+ Services.obs.notifyObservers(this, "Tab:ScreenshotNext", ""); This is kinda convenient, but it's also a bit of an abuse. Can we use this code instead: Services.tm.mainThread.dispatch(function() { BrowserApp.doNextScreenshot() }, Ci.nsIThread.DISPATCH_NORMAL); r+, but I'll keep thinking of ways to make this impl more likable
Attachment #591604 - Flags: review?(mark.finkle) → review+
Like maybe making a simple JS class for the ScreenshotQueue instead of adding it to BrowserApp
Assignee: nobody → blassey.bugs
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 12
Comment on attachment 591604 [details] [diff] [review] patch [Approval Request Comment] Regression caused by (bug #): User impact if declined: the gecko event loop can be bogged down by the screenshot creation even when is no longer needed Testing completed (on m-c, etc.): Risk to taking this patch (and alternatives if risky): pretty safe, but if something were to go wrong, the we'd have blank thumbnails.
Attachment #591604 - Flags: approval-mozilla-aurora?
Comment on attachment 591604 [details] [diff] [review] patch [Triage Comment] Mobile only - approved for Aurora.
Attachment #591604 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
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: