EncodedBufferCache uses a ReentrantMonitor. This allows the same thread to lock the monitor multiple times without deadlocking. If that is unnecessary we should replace it with a regular Mutex. I couldn't see any obvious paths for reentrancy, but it's possible I missed something. I originally noticed this because of the unnecessary forward declaration at http://hg.mozilla.org/mozilla-central/annotate/3ea0cb5a747e/content/media/EncodedBufferCache.h#l17. We should remove that even if the ReentrantMonitor is needed.
umm, I think it can use a mutex to replace the ReentrantMonitor. Protect the mEncodedBuffers/mDataSize.
Please do that :-)
Created attachment 787960 [details] [diff] [review] patch v1 Use MutexAutoLock to replace the ReentrantMonitor.