Closed
Bug 1399372
Opened 6 years ago
Closed 6 years ago
ChannelMediaResource::OnDataAvailable() should update the principal only once
Categories
(Core :: Audio/Video: Playback, enhancement, P3)
Core
Audio/Video: Playback
Tracking
()
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: jwwang, Assigned: jwwang)
References
Details
Attachments
(1 file)
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 | ||
Updated•6 years ago
|
Comment hidden (mozreview-request) |
Assignee | ||
Updated•6 years ago
|
Attachment #8907903 -
Flags: review?(cpearce)
Comment 2•6 years ago
|
||
mozreview-review |
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+
Comment hidden (mozreview-request) |
Assignee | ||
Comment 4•6 years ago
|
||
Thanks!
Pushed by jwwang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9b145214faae update the principal only once per OnDataAvailable() call. r=cpearce
![]() |
||
Comment 6•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9b145214faae
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in
before you can comment on or make changes to this bug.
Description
•