You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.bs
+34-8Lines changed: 34 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1512,15 +1512,25 @@ A [=blob URL store=] is a [=map=]
1512
1512
where [=map/keys=] are [=valid URL strings=]
1513
1513
and [=map/values=] are [=blob URL Entries=].
1514
1514
1515
-
A <dfn export>blob URL entry</dfn> consists of
1516
-
an <dfn export for="blob URL entry">object</dfn> (of type {{Blob}} or {{MediaSource}}),
1517
-
and an <dfn export for="blob URL entry">environment</dfn> (an [=environment settings object=]).
1518
-
1519
1515
[=map/Keys=] in the [=blob URL store=] (also known as <dfn lt="blob URL|object URL" export>blob URLs</dfn>)
1520
1516
are [=valid URL strings=] that when [=URL parser|parsed=]
1521
1517
result in a [=/URL=] with a [=url/scheme=] equal to "`blob`",
1522
1518
an [=empty host=], and a [=url/path=] consisting of one element itself also a [=valid URL string=].
1523
1519
1520
+
A <dfn export>blob URL entry</dfn> is used to store an object of type {{Blob}} or {{MediaSource}}.
1521
+
1522
+
A [=blob URL entry=] has an <dfn export for="blob URL entry">environment</dfn> (an [=environment settings object=]).
1523
+
1524
+
<div algorithm="obtainBlobObject">
1525
+
To <dfn export id=blob-url-obtain-object>obtain a blob object</dfn> given a [=blob URL entry=] |blobUrlEntry|, an [=environment=] |environment|, and an optional boolean |isNavigation| (default false):
1526
+
1527
+
1. Let |isAuthorized| be true.
1528
+
1. If |isNavigation| is false, let |isAuthorized| be the result of [=checking for same-partition blob URL usage=] with |blobUrlEntry| and |environment|.
1529
+
1. If |isAuthorized| is false, then return failure.
1530
+
1. Return |blobUrlEntry|'s object.
1531
+
1532
+
</div>
1533
+
1524
1534
<div algorithm="createBlobURL">
1525
1535
To <dfn id="unicodeBlobURL" lt="generate a new blob URL|generating a new blob URL">
1526
1536
generate a new blob URL</dfn>, run the following steps:
@@ -1595,6 +1605,22 @@ as the serialization of the origin of the environment that created the blob URL,
1595
1605
but for opaque origins the origin itself might be distinct. This difference isn't
1596
1606
observable though, since a revoked blob URL can't be resolved/fetched anymore anyway.
1597
1607
1608
+
### Access restrictions on blob URLs ### {#partitioningOfBlobUrls}
1609
+
1610
+
<a>Blob URLs</a> can only be fetched from environments where the [=storage key=] matches that of
1611
+
the environment where the <a>blob URL</a> was created. <a>blob URL</a> navigations are not subject
To <dfn export id=blob-url-partition-check>check for same-partition blob URL usage</dfn> given a [=blob URL entry=] |blobUrlEntry| and an [=environment=] |environment|:
1616
+
1617
+
1. Let |blobStorageKey| be the result of [=obtaining a storage key for non-storage purposes=] with |blobUrlEntry|'s [=blob URL entry/environment=].
1618
+
1. Let |environmentStorageKey| be the result of [=obtaining a storage key for non-storage purposes=] with |environment|.
1619
+
1. If |blobStorageKey| is not [=storage key/equal=] to |environmentStorageKey|, then return false.
This specification extends the [=unloading document cleanup steps=] with the following steps:
@@ -1633,12 +1659,12 @@ The <dfn method for=URL id="dfn-revokeObjectURL">revokeObjectURL(|url|)</dfn> st
1633
1659
1. Let |url record| be the result of [=URL parser|parsing=] |url|.
1634
1660
1. If |url record|'s [=url/scheme=] is not "`blob`", return.
1635
1661
1. Let |entry| be |url record|'s [=blob URL entry=].
1636
-
1. Let |blobStorageKey| be the result of [=obtaining a storage key for non-storage purposes=] with |entry|'s [=blob URL entry/environment=].
1637
-
1. Let |currentStorageKey| be the result of [=obtaining a storage key for non-storage purposes=] with the [=current settings object=].
1638
-
1. If |blobStorageKey| is not [=storage key/equal=] to |currentStorageKey|, return.
1662
+
1. If |entry| is null, return.
1663
+
1. Let |isAuthorized| be the result of [=checking for same-partition blob URL usage=] with |entry| and the [=current settings object=].
1664
+
1. If |isAuthorized| is false, return.
1639
1665
1. [=Remove an entry from the Blob URL Store=] for |url|.
1640
1666
1641
-
Note: This means that rather than throwing some kind of error, attempting to revoke a URL that isn't registered or that was registered from an environment with a different storage key will silently fail.
1667
+
Note: This means that rather than throwing some kind of error, attempting to revoke a URL that isn't registered or that was registered from an environment in a different storage partition will silently fail.
1642
1668
User agents might display a message on the error console if this happens.
1643
1669
1644
1670
Note: Attempts to dereference |url| after it has been revoked will result in a [=network error=].
0 commit comments