Closed Bug 889564 Opened 11 years ago Closed 11 years ago

ANR: LightweightTheme.handleMessage can block the Gecko thread

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 25

People

(Reporter: jchen, Assigned: mfinkle)

Details

(Whiteboard: [ANR])

Attachments

(1 file)

Because LightweightTheme.handleMessage runs on the Gecko thread, when it calls BitmapUtils.decodeUrl, the Gecko thread can get blocked as well waiting for the resource. Blocking Gecko is bad and can result in unresponsiveness and ANRs.

I think we should do decodeUrl on the background thread.
Attached patch patchSplinter Review
Uses a background thread. I thought about using UiAsyncTask, but this is the same and we already had mHandler in the code, so just manually making a post to the background thread seemed simpler.
Assignee: nobody → mark.finkle
Attachment #770626 - Flags: review?(sriram)
Attachment #770626 - Flags: review?(sriram) → review+
https://hg.mozilla.org/mozilla-central/rev/de42663c8b44
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 25
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: