Closed Bug 842374 Opened 11 years ago Closed 11 years ago

Use GeckoAsyncTask instead of AsyncTask when removing bookmarks

Categories

(Firefox for Android Graveyard :: Awesomescreen, defect)

15 Branch
x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 22

People

(Reporter: mfinkle, Assigned: mfinkle)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch patch (obsolete) — Splinter Review
When removing a bookmark we execute DB code in some background thread that is not GeckoBackgroundTread. We could easily use GeckoBackgroundThread if the code switched to GeckoAsyncTask, but it does not support "onPreExecute" so it is not a drop in replacement.

This patch adds a simple "onPreExecute" to GeckoAsyncTask and replaces AsyncTask when removing a bookmark.

Like AsyncTask, I am calling onPreExecute on whatever thread creates GeckoAsyncTask.
Attachment #715220 - Flags: review?(bugmail.mozilla)
Note to self: Remember to remove the AsyncTask import
Comment on attachment 715220 [details] [diff] [review]
patch

Review of attachment 715220 [details] [diff] [review]:
-----------------------------------------------------------------

So this seems wrong to me; the general contract of GeckoAsyncTask is that it behaves like AsyncTask, except that it forces the UI thread in place of "whatever random thread the task is created on and/or calls execute()". Which means that onPreExecute() should also always run on the UI thread, rather than the thread that calls execute().
Attachment #715220 - Flags: review?(bugmail.mozilla) → review-
Attached patch patch 2Splinter Review
This patch ensures onPreExecute is run on the UI thread
Assignee: nobody → mark.finkle
Attachment #715220 - Attachment is obsolete: true
Attachment #715600 - Flags: review?(bugmail.mozilla)
Comment on attachment 715600 [details] [diff] [review]
patch 2

Review of attachment 715600 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM
Attachment #715600 - Flags: review?(bugmail.mozilla) → review+
CCing bnicholson as well since one of you will need to rebase for the s/Activity/Handler/ changes.
https://hg.mozilla.org/mozilla-central/rev/208b826dc3d3
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
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: