Bug 1706121 Comment 22 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

When we use GMP plugin under the private browsing window, we [won't use the persistent storage](https://searchfox.org/mozilla-central/rev/c34cf367c29601ed56ae4ea51e20b28cd8331f9c/dom/media/gmp/GMPServiceParent.cpp#1362-1385) for the plugin. When persistent state is required by EME, the underlying storage gets created will be a [memory storage](https://searchfox.org/mozilla-central/rev/c34cf367c29601ed56ae4ea51e20b28cd8331f9c/dom/media/gmp/GMPStorageParent.cpp#48) for that, not a disk storage. When Widevine File IO [requests a GMPRecord](https://searchfox.org/mozilla-central/rev/c34cf367c29601ed56ae4ea51e20b28cd8331f9c/dom/media/gmp/widevine-adapter/WidevineFileIO.cpp#21-22), we would use [a correct storage type](https://searchfox.org/mozilla-central/rev/c34cf367c29601ed56ae4ea51e20b28cd8331f9c/dom/media/gmp/GMPPlatform.cpp#174-180) so that Widevine won't create any real file on the disk.

However, the memory storage currently would only be clear after closing Firefox, but it should be clear when the private browsing window is close. That means we probably need to observe `last-pb-context-exited` event to do a proper clean up. In the conclusion, we shouldn't and won't leak anything when using EME on the private browsing window. I will do more testing later and see if the result is as my expectation.
When we use GMP plugin under the private browsing window, we [won't use the persistent storage](https://searchfox.org/mozilla-central/rev/c34cf367c29601ed56ae4ea51e20b28cd8331f9c/dom/media/gmp/GMPServiceParent.cpp#1362-1385) for the plugin. When persistent state is required by EME, the underlying storage created will be a [memory storage](https://searchfox.org/mozilla-central/rev/c34cf367c29601ed56ae4ea51e20b28cd8331f9c/dom/media/gmp/GMPStorageParent.cpp#48) for that, not a disk storage. When Widevine File IO [requests a GMPRecord](https://searchfox.org/mozilla-central/rev/c34cf367c29601ed56ae4ea51e20b28cd8331f9c/dom/media/gmp/widevine-adapter/WidevineFileIO.cpp#21-22), we would use [a correct storage type](https://searchfox.org/mozilla-central/rev/c34cf367c29601ed56ae4ea51e20b28cd8331f9c/dom/media/gmp/GMPPlatform.cpp#174-180) so that Widevine won't create any real file on the disk.

However, the memory storage currently would only be clear after closing Firefox, but it should be clear when the private browsing window is close. That means we probably need to observe `last-pb-context-exited` event to do a proper clean up. In the conclusion, we shouldn't and won't leak anything when using EME on the private browsing window. I will do more testing later and see if the result is as my expectation.
When we use GMP plugin under the private browsing window, we [won't use the persistent storage](https://searchfox.org/mozilla-central/rev/c34cf367c29601ed56ae4ea51e20b28cd8331f9c/dom/media/gmp/GMPServiceParent.cpp#1362-1385) for the plugin. When persistent state is required by EME, the underlying storage created will be a [memory storage](https://searchfox.org/mozilla-central/rev/c34cf367c29601ed56ae4ea51e20b28cd8331f9c/dom/media/gmp/GMPStorageParent.cpp#48), not a disk storage. When Widevine File IO [requests a GMPRecord](https://searchfox.org/mozilla-central/rev/c34cf367c29601ed56ae4ea51e20b28cd8331f9c/dom/media/gmp/widevine-adapter/WidevineFileIO.cpp#21-22), we would use [a correct storage type](https://searchfox.org/mozilla-central/rev/c34cf367c29601ed56ae4ea51e20b28cd8331f9c/dom/media/gmp/GMPPlatform.cpp#174-180) so that Widevine won't create any real file on the disk.

However, the memory storage currently would only be clear after closing Firefox, but it should be clear when the private browsing window is close. That means we probably need to observe `last-pb-context-exited` event to do a proper clean up. In the conclusion, we shouldn't and won't leak anything when using EME on the private browsing window. I will do more testing later and see if the result is as my expectation.

Back to Bug 1706121 Comment 22