Skip to content

Commit

Permalink
Bug 1264182: Hide URL.createObjectURL from ServiceWorker r=mrbkap,asuth
Browse files Browse the repository at this point in the history
The appropriate lifetime for URLs created with URL.createObjectURL turned
out to be tricky to define, so it was decided to hide it from service
workers altogether. (w3c/ServiceWorker#688)

This commit implements this change and adds a web platform test to verify it.
It also exposes the MediaSource variant of URL.createObjectURL in DedicatedWorker
and SharedWorker contexts in order to comply with the WebIDL spec (see
w3c/media-source#168 (comment)).

Differential Revision: https://phabricator.services.mozilla.com/D2728

UltraBlame original commit: 40d4999db3191bca0aeb75a50b37537ad78102ed
  • Loading branch information
marco-c committed Oct 3, 2019
1 parent 8688a37 commit c1f3c4b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
15 changes: 9 additions & 6 deletions dom/webidl/URL.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,15 @@ toJSON
;
}
;
[
Exposed
=
(
Window
DedicatedWorker
SharedWorker
)
]
partial
interface
URL
Expand Down Expand Up @@ -316,8 +325,6 @@ DOMString
url
)
;
}
;
/
/
https
Expand Down Expand Up @@ -351,10 +358,6 @@ media
source
.
html
partial
interface
URL
{
[
Throws
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,3 +803,31 @@ exposed
'
)
;
test
(
(
)
=
>
{
assert_false
(
'
createObjectURL
'
in
self
.
URL
)
;
}
'
URL
.
createObjectURL
is
not
exposed
'
)

0 comments on commit c1f3c4b

Please sign in to comment.