bug 1077595 - Use DataStoreChangeEvents to update Download API Manager c...

...ache up to date. Move tracking of active downloads into StatusBar instead of DownloadNotifications. r=crdlc,mhenretty
It could be useful here to update the item on update of the data store.
Right now though, there is no one modifying the entries. They receive one
update where they are annotated with and id but that doesn't have any ui
affect.
On Nov 5, 2014 12:34 AM, "Arthur Chen" <notifications@github.com> wrote:

> In apps/settings/js/downloads/downloads_list.js:
>
> > @@ -376,15 +376,26 @@
> >      numberOfCheckedDownloads = 0;
> >    }
> >
> > +  function _downloadApiManagerListener(changeEvent) {
> > +    switch (changeEvent.operation) {
> > +      case 'added':
> > +        // Update the download item with the download item from
> > +        // the download store.
> > +        var element = _getElementForId(changeEvent.downloadApiId);
>
> Based on the code of DownloadApiManager there seem two cases when
> receiving the added event from the datastore. The first one would be the
> cached download object gets updated. The other one is the download object
> does not exist in the cache. We should handle both cases. If the second
> case is impossible, DownloadApiManager should not dispatch the event in
> the beginning.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mozilla-b2g/gaia/pull/25589/files#r19860098>.
>