Closed Bug 414486 Opened 16 years ago Closed 16 years ago

Lazily load stringbundle and lazily load strings for DownloadUtils

Categories

(Toolkit :: Downloads API, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9beta4

People

(Reporter: Mardak, Assigned: Mardak)

Details

(Keywords: perf)

Attachments

(1 file, 1 obsolete file)

Whoever imports DownloadUtils will be taking a hit because we eagerly load the string bundle and strings at import. We can delay this until they're actually used.
Attached patch v1 (obsolete) — Splinter Review
Yay mochi unit tests.

Create getters that lazily loads strings from a lazily-loaded stringbundle.
Assignee: nobody → edilee
Status: NEW → ASSIGNED
Attachment #299913 - Flags: review?(sdwilsh)
Comment on attachment 299913 [details] [diff] [review]
v1

This needs some tests (as discussed on irc).  They should be xpcshell tests living in toolkit/mozapps/downloads/tests/unit/
Attachment #299913 - Flags: review?(sdwilsh) → review-
Attached patch v2Splinter Review
Now with more testcase! :) Works before and after the laziness.
Attachment #299913 - Attachment is obsolete: true
Attachment #299978 - Flags: review?(sdwilsh)
Comment on attachment 299978 [details] [diff] [review]
v2

r=sdwilsh
Attachment #299978 - Flags: review?(sdwilsh)
Attachment #299978 - Flags: review+
Attachment #299978 - Flags: approval1.9?
Comment on attachment 299978 [details] [diff] [review]
v2

Mmm more testcases
Attachment #299978 - Flags: approval1.9? → approval1.9+
Flags: in-testsuite?
Checking in toolkit/mozapps/downloads/src/DownloadUtils.jsm;
/cvsroot/mozilla/toolkit/mozapps/downloads/src/DownloadUtils.jsm,v  <--  DownloadUtils.jsm
new revision: 1.5; previous revision: 1.4
done
Checking in toolkit/mozapps/downloads/tests/Makefile.in;
/cvsroot/mozilla/toolkit/mozapps/downloads/tests/Makefile.in,v  <--  Makefile.in
new revision: 1.2; previous revision: 1.1
done
RCS file: /cvsroot/mozilla/toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js,v
done
Checking in toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js;
/cvsroot/mozilla/toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js,v  <--  test_DownloadUtils.js
initial revision: 1.1
done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Flags: in-testsuite? → in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3 beta4
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: