Closed
Bug 704922
Opened 13 years ago
Closed 13 years ago
Racy bookmark handling in Tab.java
Categories
(Firefox for Android Graveyard :: General, defect, P2)
Tracking
(firefox11 fixed, firefox12 fixed, fennec11+)
RESOLVED
FIXED
Firefox 12
People
(Reporter: lucasr, Assigned: lucasr)
Details
Attachments
(1 file, 1 obsolete file)
4.06 KB,
patch
|
mfinkle
:
review+
akeybl
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
When Tab URL changes, an AsyncTask is executed to update the bookmark state for the new location. However, the URL for the given tab might change before the AsyncTask ends, in which case we want to cancel any pending bookmark tasks and ignore their result.
Updated•13 years ago
|
Assignee: nobody → lucasr.at.mozilla
Priority: -- → P2
Updated•13 years ago
|
Hardware: All → ARM
Assignee | ||
Comment 1•13 years ago
|
||
Attachment #585693 -
Flags: review?(mark.finkle)
Updated•13 years ago
|
tracking-fennec: --- → 11+
Comment 2•13 years ago
|
||
Comment on attachment 585693 [details] [diff] [review] Fix racy behaviour of bookmark checks in Tab >+ protected void onPostExecute(final Boolean isBookmark) { >+ GeckoApp.mAppContext.runOnUiThread(new Runnable() { >+ public void run() { >+ // Ignore this task if it's not about the current >+ // tab URL anymore. >+ if (!mUrl.equals(getURL())) >+ return; >+ >+ mCheckBookmarkTask = null; >+ setBookmark(isBookmark.booleanValue()); >+ } >+ }); Should we set mCheckBookmarkTask to null no matter what? If not, won't we try to cancel it the next time? r- to address the question, otherwise it looks fine. I do wonder if we could add "cancel" to GeckoAsyncTask, making it more useful.
Attachment #585693 -
Flags: review?(mark.finkle) → review-
Assignee | ||
Comment 3•13 years ago
|
||
(In reply to Mark Finkle (:mfinkle) from comment #2) > Comment on attachment 585693 [details] [diff] [review] > Fix racy behaviour of bookmark checks in Tab > > > >+ protected void onPostExecute(final Boolean isBookmark) { > >+ GeckoApp.mAppContext.runOnUiThread(new Runnable() { > >+ public void run() { > >+ // Ignore this task if it's not about the current > >+ // tab URL anymore. > >+ if (!mUrl.equals(getURL())) > >+ return; > >+ > >+ mCheckBookmarkTask = null; > >+ setBookmark(isBookmark.booleanValue()); > >+ } > >+ }); > > Should we set mCheckBookmarkTask to null no matter what? If not, won't we > try to cancel it the next time? Good catch. Submitting a new patch now. > r- to address the question, otherwise it looks fine. > > I do wonder if we could add "cancel" to GeckoAsyncTask, making it more > useful. I actually think we shouldn't be using GeckoAsyncTask at all. We should simply add an util api that guarantees that AsyncTask's callbacks are called on the right threads.
Assignee | ||
Comment 4•13 years ago
|
||
Added handles the case of cancelled AsyncTask.
Attachment #585693 -
Attachment is obsolete: true
Attachment #588845 -
Flags: review?(mark.finkle)
Updated•13 years ago
|
Attachment #588845 -
Flags: review?(mark.finkle) → review+
Assignee | ||
Comment 5•13 years ago
|
||
Pushed: http://hg.mozilla.org/integration/mozilla-inbound/rev/82ee45c3759e
Assignee | ||
Comment 6•13 years ago
|
||
Comment on attachment 588845 [details] [diff] [review] Fix racy behaviour of bookmark checks in Tab Fix potential broken state on bookmarking UI.
Attachment #588845 -
Flags: approval-mozilla-aurora?
Comment 7•13 years ago
|
||
Holding in the queue until this has had some time on m-c.
Comment 8•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/82ee45c3759e
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 12
Comment 9•13 years ago
|
||
Comment on attachment 588845 [details] [diff] [review] Fix racy behaviour of bookmark checks in Tab [Triage Comment] Mobile only - approved for aurora.
Attachment #588845 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Assignee | ||
Comment 10•13 years ago
|
||
Pushed to mozilla-aurora: https://hg.mozilla.org/releases/mozilla-aurora/rev/3b98406dfe0c
status-firefox11:
--- → fixed
status-firefox12:
--- → fixed
Updated•3 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•