Closed Bug 1147668 Opened 9 years ago Closed 9 years ago

Correctly reflect "video" and "track" RequestContext values

Categories

(Core :: DOM: Service Workers, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

Details

Attachments

(1 file, 1 obsolete file)

Request.context can reflect "audio" and "video" separately, so we should split TYPE_MEDIA into two for this to be reflected correctly.
(Forgot about "track")
Summary: Split nsIContentPolicy::TYPE_MEDIA into TYPE_AUDIO and TYPE_VIDEO so that Request.context can reflect the correct value → Split nsIContentPolicy::TYPE_MEDIA into TYPE_AUDIO and TYPE_VIDEO and TYPE_TRACK so that Request.context can reflect the correct value
Comment on attachment 8584726 [details] [diff] [review]
Split nsIContentPolicy::TYPE_MEDIA into TYPE_AUDIO and TYPE_VIDEO and TYPE_TRACK so that Request.context can reflect the correct value

>+  MOZ_ASSERT(IsHTMLElement(nsGkAtoms::audio) ||
>+             IsHTMLElement(nsGkAtoms::video));

Nit, You could use the rather nice helper method
IsAnyOfHTMLElements(nsGkAtoms::audio, nsGkAtoms::video);
Same also elsewhere.
Attachment #8584726 - Flags: review?(bugs) → review+
Assignee: nobody → ehsan
The new plan is to use the TYPE_INTERNAL_* content policy types I added in bug 1174307.
Component: DOM → DOM: Service Workers
Summary: Split nsIContentPolicy::TYPE_MEDIA into TYPE_AUDIO and TYPE_VIDEO and TYPE_TRACK so that Request.context can reflect the correct value → Correctly reflect "video" and "track" RequestContext values
Attachment #8584726 - Attachment is obsolete: true
Comment on attachment 8622686 [details] [diff] [review]
Correctly reflect video and track RequestContext values

Oh, we map _INTERNAL_ to something else before calling CP
Attachment #8622686 - Flags: review?(bugs) → review+
(In reply to Olli Pettay [:smaug] from comment #6)
> Comment on attachment 8622686 [details] [diff] [review]
> Correctly reflect video and track RequestContext values
> 
> Oh, we map _INTERNAL_ to something else before calling CP

Yes, indeed.  This function provides the mapping: <https://hg.mozilla.org/integration/mozilla-inbound/file/b7e3bb16f653/dom/base/nsContentUtils.cpp#l7818>
Depends on: 1175114
(In reply to :Ehsan Akhgari (not reading bugmail, needinfo? me!) from comment #9)
> This triggered an assertion, so I backed it out:
> 
> http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/mozilla-
> inbound-linux64-debug/1434420561/mozilla-inbound_ubuntu64_vm-debug_test-
> mochitest-3-bm117-tests1-linux64-build320.txt.gz

Bug 1175114 fixes this.  This patch can be relanded with that.
Flags: needinfo?(ehsan)
Depends on: 1175299
This was busted the second time as well.  Bug 1175299 fixes that.
https://hg.mozilla.org/mozilla-central/rev/28bbcf8f9e1a
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: