(Doing the extra ProcessBlock for the sake of downstream nodes was unnecessary
even before the inactive check was delayed until after their processing, because
downstream nodes would have only had null chunks to process anyway.)
--HG--
extra : rebase_source : d1dd8a228a23520a23e77e29ae3d5040e6505eb8
Since changes for bug 1217625, the node and downstream nodes won't be made
inactive until after downstream nodes have done their processing, and so there
is no need to wait for the first silent output block.
This essentially reverts 5c607f3f39d55544838f3111ede9e11a00d3c25e.
--HG--
extra : rebase_source : f449c427b580239f9072cc7c580585f10b69608f
Sometimes we'll need an initial suspended count of 2, which is not supported
by this API, but this is not necessary anyway.
--HG--
extra : rebase_source : 56ecca7c14025ea7e18ba9a20e0b7725a610b429
This will allow streams to be suspended when they are discovered inactive.
Suspending is not possible while iterating over stream lists for processing.
The approach of delaying the transition to inactive state may result in a
couple of extra processing iterations, but can save on the number of messages
that need to be created when compared to the approach of traversing downstream
nodes during stream processing.
--HG--
extra : rebase_source : b6707da5afa9323058b3f70b7743c13380618dad
I tried to keep the changes to existing tests as minimal as
possible. There were a few exceptions, though:
* test_update_ignorecompat.js was completely broken. I couldn't
figure out why it was suddenly failing after I changed it to use
`add_test`, and it turned out that it had been failing all along,
but in a way that the harness didn't pick up.
* I changed most of the `do_throw` in update callbacks to `ok(false`
because it took me about an hour to figure out where the test was
failing when I hit one of them.
* I made some changes to sync `test_update.js` and `test_update_ignorecompat.js`
where one appeared to have been changed without updating the
other.
* I made `promiseFindAddonUpdates` a bit more generic, because I was
planning to convert most of `test_update.js` to use it, rather
than nested callbacks. I changed my mind a quarter of the way
through, but decided to keep the changes, since they'll probably
be useful elsewhere.
--HG--
extra : commitid : 2jBJ2yUht46
extra : rebase_source : a123db431a26b29f3deb81e6b961bf556005c2a6
extra : source : 90e625ac70b2071f1c2430725892f7c266928521
I tried to keep the changes to existing tests as minimal as
possible. There were a few exceptions, though:
* test_update_ignorecompat.js was completely broken. I couldn't
figure out why it was suddenly failing after I changed it to use
`add_test`, and it turned out that it had been failing all along,
but in a way that the harness didn't pick up.
* I changed most of the `do_throw` in update callbacks to `ok(false`
because it took me about an hour to figure out where the test was
failing when I hit one of them.
* I made some changes to sync `test_update.js` and `test_update_ignorecompat.js`
where one appeared to have been changed without updating the
other.
* I made `promiseFindAddonUpdates` a bit more generic, because I was
planning to convert most of `test_update.js` to use it, rather
than nested callbacks. I changed my mind a quarter of the way
through, but decided to keep the changes, since they'll probably
be useful elsewhere.
--HG--
extra : commitid : 84oLUw4ZPOg
extra : rebase_source : 2bd6c921c6b677e4d487d0ee9c33b1130163bc39
Looking at a preference file read with strace typically looks like:
open("...", O_RDONLY) = X
...
read(X, "...", SIZE) = SIZE
read(X, "...", SIZE) = 0
...
There's no reason to call Read() and make another syscall to determine
there's no data left for reading. We can keep track of how much we've
read at minimal cost and thus determine for ourselves when we are done.
Calling nsIInputStream::Available on nsIFileInputStreams is relatively
expensive, as it requires three system calls: one to determine the
current file position, one to seek to the end file position, and one to
rewind to the previous file position.
We can do better by asking the file for its size directly, prior to
opening the stream. This only requires one system call, stat, and is
thus superior--at least in considering the number of system calls.