-
Notifications
You must be signed in to change notification settings - Fork 473
Issue #7313: Use ThumbnailLoader for the TabViewHolder #7356
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7356 +/- ##
============================================
+ Coverage 77.41% 77.51% +0.09%
+ Complexity 5072 5051 -21
============================================
Files 675 670 -5
Lines 24787 24727 -60
Branches 3663 3659 -4
============================================
- Hits 19190 19168 -22
+ Misses 4090 4051 -39
- Partials 1507 1508 +1
Continue to review full report at Codecov.
|
...ser/thumbnails/src/main/java/mozilla/components/browser/thumbnails/loader/ThumbnailLoader.kt
Outdated
Show resolved
Hide resolved
components/support/images/src/main/java/mozilla/components/support/images/loader/ImageLoader.kt
Outdated
Show resolved
Hide resolved
153bbce
to
dc99982
Compare
We were seeing odd bugs and performance issues from trying to map the disk cache into the TabsTrayPresenter. A better solution, would be to load the thumbnails straight from the cache, and incremental updates via the store.
) | ||
} | ||
}, | ||
delegate: Observable<TabsTray.Observer> = ObserverRegistry() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would putting this parameter after the closure prevent us from using the trailing closures when initializing the TabsAdapter
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@boek I explicitly wanted to avoid that since we've had issues (mozilla-mobile/fenix#10495) where the scope of the trailing closure did not make it obvious it was being invoked during the onCreateViewHolder
call of the adapter and that could cause crashes depending on what work was done in that closure.
I thought it was better to have an explicit named param in that case to avoid regressions.
bors r=gabrielluong,boek |
Build succeeded: |
Instead of trying to inline the thumbnail images from disk into the TabsTrayPresenter, we can load them from the
ThumbnailStorage
via theThumbnailLoader
and rely on theTabsTrayPresenter
to consume new thumbnail updates only from the store.This fixes some perf issues, inconsistencies, and duplicate updates to the tabs tray.
Corresponding Fenix PR: mozilla-mobile/fenix#11510
Pull Request checklist
After merge