Closed Bug 1387446 Opened 7 years ago Closed 6 years ago

Make the Downloads API methods that handle annotations asynchronous

Categories

(Toolkit :: Downloads API, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: Paolo, Assigned: standard8)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxperf:p3][fxsearch])

Attachments

(2 files)

Methods like getPlacesMetaDataFor and the annotations cache in the DownloadHistory module are currently synchronous. It should not be too difficult to change them to have asynchronous signatures, in preparation for making the Places annotations API asynchronous.
Priority: -- → P3
Whiteboard: [fxperf]
Whiteboard: [fxperf] → [fxperf:p3]
Whiteboard: [fxperf:p3] → [fxperf:p3][fxsearch]
Blocks: 1468972
Depends on: 1468980
No longer blocks: removeAnnotations
This has been partly fixed in bug 1468980, and only getPlacesMetaDataFor remains, right? Nice job in bug 1468980, by the way. Thanks for simplifying the code!
(In reply to :Paolo Amadini from comment #1) > This has been partly fixed in bug 1468980, and only getPlacesMetaDataFor > remains, right? I believe so, yes. I also have a patch ready for getPlacesMetaDataFor, but I'm just completing another patch to go with it before I upload that. > Nice job in bug 1468980, by the way. Thanks for simplifying the code! Thanks, no problem! It certainly seemed clearer that way when working with the newer APIs :-)
Assignee: nobody → standard8
Not just getPlacesMetaDataFor unfortunately, gCachedPlacesMetaData is still synchronous and uses getAnnotationsWithName that should go away.
obviously the 2 things can be splitted into separate bugs to keep things simpler.
Depends on: 1480049
From discussion with Marco on irc, the idea is to make gCachedPlacesMetaData be initialised asynchronously (which bug 1480049 is now likely to enable), and then we can add an API to history which will fetch all pages with certain annotations, e.g. history.getAnnotatedPages(arrayOfAnnos) return Map("anno1" => [{page, content}, {page, content}]), "anno2" => ....);
So, gCachedPlacesMetaData would be initialized once asynchronously, for example when getList is called, then it would be the only place from which we read the metadata, and any changes would be written synchronously to gCachedPlacesMetaData and also asynchronously to the Places database, for the next session. Correct?
(In reply to :Paolo Amadini from comment #6) > So, gCachedPlacesMetaData would be initialized once asynchronously, for > example when getList is called, then it would be the only place from which > we read the metadata, and any changes would be written synchronously to > gCachedPlacesMetaData and also asynchronously to the Places database, for > the next session. Correct? Yes, that's what I'm heading towards. The obvious slight compromise is that we have to keep annotation details in memory, but that seems easier than the other options.
Depends on: 1485113
Depends on D4062
Comment on attachment 9003407 [details] Bug 1387446 - Replace getAnnotationsWithName calls in DownloadHistory with new asynchronous PlacesUtils.history.fetchAnnotatedPages. :Paolo Amadini has approved the revision.
Attachment #9003407 - Flags: review+
Comment on attachment 9003408 [details] Bug 1387446 - Remove nsIAnnotationService.getAnnotationsWithName. Lina Cambridge (she/her) [:lina] has approved the revision.
Attachment #9003408 - Flags: review+
Comment on attachment 9003407 [details] Bug 1387446 - Replace getAnnotationsWithName calls in DownloadHistory with new asynchronous PlacesUtils.history.fetchAnnotatedPages. Lina Cambridge (she/her) [:lina] has approved the revision.
Attachment #9003407 - Flags: review+
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e1734b0648a9 Replace getAnnotationsWithName calls in DownloadHistory with new asynchronous PlacesUtils.history.fetchAnnotatedPages. r=paolo,lina
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f7c5d8d8be89 Remove nsIAnnotationService.getAnnotationsWithName. r=lina
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: