nsMediaCacheFlusher uses the global Private Browsing status to decide when to flush the media cache

RESOLVED FIXED in mozilla15



7 years ago
7 years ago


(Reporter: jdm, Assigned: Ehsan)


Dependency tree / graph

Firefox Tracking Flags

(Not tracked)



(1 attachment)



7 years ago
The global PB service is going away. We'll probably need to have two separate media caches, since there could be a PB window watching a video and a regular window watching another concurrently.

Comment 1

7 years ago
We can at least clear out the private media cache based on the last-pb-context-destroyed notification in bug 725210.
Depends on: 725210

Comment 2

7 years ago
Robert, what work will be required to allow multiple media caches? I scanned through nsMediaCache for places that use gMediaCache, and it didn't look like a completely straightforward process for someone brand new to the media code.
It's not trivial, but I think it's not hard.

-- Give each nsMediaCacheStream a reference to its nsMediaCache. Make nsMediaCacheStream::Init indicate which cache to use (could just be an enum). Then InitMediaCache would take that enum as a parameter and index into a global array. Or some value of the enum could create a new unique nsMediaCache and add it to the array.
-- Make MaybeShutdown nonstatic.
-- Make nsMediaCacheFlusher iterate through the global array. (Would it still be needed though?)
-- Give each ResourceStreamIterator a reference to its nsMediaCache.
-- Give each UpdateEvent a reference to its nsMediaCache.

Comment 4

7 years ago
OK, so we had talked about this over in bug 572243.  To summarize, the media cache does not include the URL to the media resource.  The data itself might potentially be used to trace the media item back to its source, but the current approach of clearing the cache when the PB mode is over seems to be sufficient in order to defend against that.

The advantage of separating the media cache into two caches is that when leaving the PB mode, the media cache for non-PB media will not get evicted.  I think that's definitely something to strive to do, but it's out of scope for this bug.  As far as this bug is concerned, we should just preserve the existing functionality.

Comment 5

7 years ago
Posted patch Patch (v1)Splinter Review
Assignee: nobody → ehsan
Attachment #615606 - Flags: review?(roc)

Comment 6

7 years ago
Target Milestone: --- → mozilla15

Comment 7

7 years ago
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.