Bug 1085186. Don't readahead more than 30s of media data per resource on mobile/B2G. r=cpearce

--HG--
extra : rebase_source : 6fce6b5390d0eb76463db04f7dd72f79b97d39c5
Bug 1092543. Intersect bufferRect with visibleRect to ensure that the gralloc buffer offset is taken into account. r=sotaro
The patch in bug 1073252 assumed that the gralloc buffer is always at
(0,0,w,h) in layer coordinates, which is incorrect. When intersecting
the gralloc buffer bounds with the visible rect, we need to take the gralloc
buffer's offset (state.mOffset) into account. Fortunately bufferRect already
contains this, so let's just use that.

--HG--
extra : rebase_source : 6187200b29ed2913e335d5a710f1ba38d7b1cf18