Environment:
otoro- 7/24/2012 build
gaia app - Music
Device Storage is returning null.
The repro case is to load audio in /sdcard/Music, and then start the Music app
E/GeckoConsole( 106): Content JS ERROR at app://music.thisdomaindoesnotexist.org/js/MediaDB.js:197 in MediaDB: MediaDB(): can't get DeviceStorage object TypeError: navigator.getDeviceStorage(mediaType) is null
This might also not be a device storage error as much as a permsissions error, unsure, but i verified the permissions to device storage are correct in permissions.sqlite
173|music.thisdomaindoesnotexist.org|indexedDB-unlimited|1|0|0
174|music.thisdomaindoesnotexist.org|webapps-manage|1|0|0
175|music.thisdomaindoesnotexist.org|offline-app|1|0|0
176|music.thisdomaindoesnotexist.org|pin-app|1|0|0
177|music.thisdomaindoesnotexist.org|websettings-read|1|0|0
178|music.thisdomaindoesnotexist.org|websettings-readwrite|1|0|0
179|music.thisdomaindoesnotexist.org|content-camera|1|0|0
180|music.thisdomaindoesnotexist.org|webcontacts-manage|1|0|0
181|music.thisdomaindoesnotexist.org|wifi-manage|1|0|0
182|music.thisdomaindoesnotexist.org|desktop-notification|1|0|0
183|music.thisdomaindoesnotexist.org|geolocation|1|0|0
184|music.thisdomaindoesnotexist.org|device-storage|1|0|0
185|music.thisdomaindoesnotexist.org|alarms|1|0|0

I figured out the problem.
The nsVolumeService class doesn't get instantiated until the very first time that:
do_GetService(NS_VOLUMESERVICE_CONTRACTID)
is called. The nsVolumeService constructor then fires off some IOTHread initialization. If the call to GetVolumeByPath comes in before the iothread has had a chance to finish, then it see no volume.
So I see a few potential solutions:
1 - Have the VolumeManager do a call to do_GetService to have the nsVolumeService instantiated earlier.
2 - Have the nsVolumeService do some type of synchronization so that GetVolumeByPath blocks until the iothread is finished
3 - Move the main thread data out of nsVolumeService and have the main thread data initialized earlier, so that nsVolumeService can access it immediately.
I'm inclined to do #3. Comments?