Both methods need to become cross-platform.
Created attachment 23913 [details] Patch
Comment on attachment 23913 [details] Patch r=me
Fixed in r37067.