Closed
Bug 1135251
Opened 11 years ago
Closed 10 years ago
[Gallery] ThumbnailList class should not call navigator.mozL10n.ready()
Categories
(Firefox OS Graveyard :: Gaia::Gallery, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: djf, Assigned: pdahiya)
Details
Attachments
(1 file)
gallery/js/thumbnail_list.js calls mozL10n.ready() in its constructor. Currently gallery only ever creates a single ThumbnailList with the same lifetime as the app, so this is okay. But if we ever modified it to create multiple ThumbnailList objects, then this would be a tricky memory leak.
So we should change this. I suggest modifying ThumbnailList to use once() for its initial localization. Then, once Gallery has created its thumbnail list, it can call ready() at the global level to invoke thumbnailList.localize() when the language changes.
See https://bugzilla.mozilla.org/show_bug.cgi?id=1068976#c7 and https://bugzilla.mozilla.org/show_bug.cgi?id=1134436#c6 for more details.
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → pdahiya
Flags: needinfo?(pdahiya)
Assignee | ||
Comment 2•11 years ago
|
||
Thanks for filing, assigning myself to fix after updating Bug 1134436 patch.
Comment 3•11 years ago
|
||
Assignee | ||
Comment 4•11 years ago
|
||
Comment on attachment 8568690 [details] [review]
[gaia] punamdahiya:Bug1135251 > mozilla-b2g:master
Hi David
Please review attached PR updated with ThumbnailList to use once for its initial localization and ready call moved to global level inside startup.js after thumbnails are created. Thanks!
Attachment #8568690 -
Flags: review?(dflanagan)
Reporter | ||
Comment 5•10 years ago
|
||
Comment on attachment 8568690 [details] [review]
[gaia] punamdahiya:Bug1135251 > mozilla-b2g:master
r- because I think this patch can cause the list to be localized twice on startup. If you just do the ready() call right after calling the ThumbnailList constructor (with nothing async in between) then I think that is all that is needed. See my comment on github.
Attachment #8568690 -
Flags: review?(dflanagan) → review-
Assignee | ||
Comment 6•10 years ago
|
||
Comment on attachment 8568690 [details] [review]
[gaia] punamdahiya:Bug1135251 > mozilla-b2g:master
Hi David
I have updated patch with your review feedback. You are right we don't need explicit l10n once call in ThumbnailList constructor if we move ready() call right after creating thumbnailList instance. Thanks
Attachment #8568690 -
Flags: review- → review?(dflanagan)
Reporter | ||
Comment 7•10 years ago
|
||
Comment on attachment 8568690 [details] [review]
[gaia] punamdahiya:Bug1135251 > mozilla-b2g:master
Looks good to me!
Attachment #8568690 -
Flags: review?(dflanagan) → review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Updated•10 years ago
|
Keywords: checkin-needed
Comment 8•10 years ago
|
||
Pull request has landed in master: https://github.com/mozilla-b2g/gaia/commit/27814b20ca2bf33c040f86ee81aa34b562f01150
Updated•10 years ago
|
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•