sdwilsh Status Update: 2010-02-05
Done:
- Work on bug 461199
- Work on bug 542592 (learning oh so much about content/)
- CMU career fair
Next:
- Finish (no, really!) bug 461199and bug 542592
sdwilsh Status Update: 2010-02-01
Done:
- Work on bug 461199
Next:
- Work on bug 461199 and a career fair at CMU, so not much is going to get done.
sdwilsh Status Update: 2010-01-23
Done:
- Hammered away on getting tests passing on bug 461199
- Created "New Tabs at the End" add-on for the support team
- Created a control flow diagram of how mozilla::IHistory and mozilla::dom::Link interact to help other folks understand
Next:
- Finish up bug 461199
- Start working on bug 536978 (async cookie writing)
- Refine IO reduction goal criteria to hit more common tasks
sdwilsh Status Update: 2010-01-15
Done:
- Q1 I/O Reduction goal page up and running (https://wiki.mozilla.org/Firefox/Goals/2010Q1/IO_Reduction) with numbers and bugs
- Review queue neutralized
- Bug 461199 (async visited checks) nearly ready. Working on fixing last remaining failing tests. Two more issues remain to be fixed (other than tests).
Next:
- Finish up bug 461199 (bit of a stretch, but we'll see if it can happen)
NetUtil.jsm Just Got More Useful
Recently, a few bugs have landed enabling a bunch of nice things for consumers of NetUtil.jsm:
- NetUtil.newURI can take a string (plus optional character set and base URI) or an nsIFile.
- A new method for creating channels has been created. NetUtil.newChannel can take an nsIURI, a string (plus optional character set and base URI), or an nsIFile.
- NetUtil.asyncFetch can take an nsIChannel, an nsIURI, a string (plus optional character set and base URI), or an nsIFile.
This means, among other things, that it now requires less code to read a file asynchronously than it does synchronously. The old way to do this asynchronously can be seen here on MDC. This would give the consumer a byte array of the data in the file. Compared to the synchronous case, which can be seen here. Both are pretty verbose and clunky to use. The new way looks like this:
NetUtil.asyncFetch(file, function(aInputStream, aResult) {
if (!Components.isSuccessCode(aResult)) {
// Handle Error
return;
}
// Consume input stream
});
One function call, with a callback passed in. There is a slight difference from the old asynchronous method, however. NetUtil.asyncFetch gives the consumer an nsIInputStream instead of a byte array. The input stream is a bit more useful than a raw byte array, although it can be painful to use in JavaScript at times (maybe we need an easy method to convert an input stream to a string?). I look forward to patches using this method to read files instead of doing it synchronously.