59 bytes, text/x-review-board-request
One ChannelMediaResource::OnDataAvailable() call might result in multiple calls into MediaCacheStream::NotifyDataReceived() which will update the principal of the stream. http://searchfox.org/mozilla-central/rev/e76c0fee79a34a3612740b33508276f4b37c3ee8/dom/media/MediaCache.cpp#1891 We should just update the principal only once per OnDataAvailable() call.
Assignee: nobody → jwwang
Priority: -- → P3
Attachment #8907903 - Flags: review?(cpearce)
Comment on attachment 8907903 [details] Bug 1399372 - update the principal only once per OnDataAvailable() call. https://reviewboard.mozilla.org/r/179582/#review184798 ::: dom/media/MediaCache.h:265 (Diff revision 1) > // Notifies the cache that data has been received. The stream already > // knows the offset because data is received in sequence and > // the starting offset is known via NotifyDataStarted or because > // the cache requested the offset in > // ChannelMediaResource::CacheClientSeek, or because it defaulted to 0. > // We pass in the principal that was used to load this data. The comment here still mentions the principal. ::: dom/media/MediaResource.cpp:469 (Diff revision 1) > // This might happen off the main thread. > NS_ASSERTION(mChannel.get() == aRequest, "Wrong channel!"); > > + // Update principals before putting the data in the cache. This is important, > + // we want to make sure all principals are updated before any consumer. > + // TODO: Handle the case where OnDataAvailable() runs off the main thread. You clipped off "// can see the new data." from the end of this comment when you moved it. Please can you add it back, as I want to be sure we leave the warning here as we don't want our developers accidentally adding privacy leaks to the code.
Attachment #8907903 - Flags: review?(cpearce) → review+
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/9b145214faae update the principal only once per OnDataAvailable() call. r=cpearce
You need to log in before you can comment on or make changes to this bug.