Bug 25902 change expiration from Date to unrestricted double
authorMark Watson <watsonm@netflix.com>
Tue, 24 Jun 2014 14:03:42 -0700
changeset 355 78799a7b0a9d
parent 354 36c3987ed943
child 356 c02fbe3a2c13
Bug 25902 change expiration from Date to unrestricted double
encrypted-media/encrypted-media.html
encrypted-media/encrypted-media.xml
--- a/encrypted-media/encrypted-media.html	Tue Jun 24 13:47:32 2014 -0700
+++ b/encrypted-media/encrypted-media.html	Tue Jun 24 14:03:42 2014 -0700
@@ -368,7 +368,7 @@
 <p class=""><a href="#dom-usablekeyids">usableKeyIds</a> is not WebIDL-compliant. See <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=25594">Bug 25594</a>.</p>
 </div>
   readonly attribute Array&lt;ArrayBuffer&gt; <a href="#dom-usablekeyids">usableKeyIds</a>;
-  readonly attribute Date <a href="#dom-expiration">expiration</a>;
+  readonly attribute unrestricted double <a href="#dom-expiration">expiration</a>;
   readonly attribute Promise&lt;any&gt; <a href="#dom-closed">closed</a>;
 
   // session operations
@@ -519,7 +519,7 @@
               <li><p>Set the <code><a href="#dom-error">error</a></code> attribute to null.</p></li>
               <li><p>Set the <code><a href="#dom-sessionid">sessionId</a></code> attribute to <var title="true">session ID</var>.</p></li>
               <li><p>Set the <code><a href="#dom-usablekeyids">usableKeyIds</a></code> attribute to an empty Array.</p></li>
-              <li><p>Let <code><a href="#dom-expiration">expiration</a></code> be <code>undefined</code>.</p></li>
+              <li><p>Let <code><a href="#dom-expiration">expiration</a></code> be <code>NaN</code>.</p></li>
               <li><p>Let <code><a href="#dom-closed">closed</a></code> be a new promise.</p></li>
               <li><p>Let the session type be <var title="true">sessionType</var>.</p></li>
               <li><p>Let the session initData be the <var title="true">initDataType</var>-<var>init data</var> pair.</p></li>
@@ -547,7 +547,7 @@
 <p>If the <var title="true">list of active session IDs</var> for this object includes an entry for <var title="true">sessionId</var>, resolve <var>promise</var> with <code>null</code>.</p>
             <p class="non-normative">In other words, do not create a session if a non-closed session already exists for this <var title="true">sessionId</var>.</p>
           </li>
-          <li><p>Let <var title="true">expiration time</var> be <code>undefined</code>.</p></li>
+          <li><p>Let <var title="true">expiration time</var> be <code>NaN</code>.</p></li>
           <li><p>Let <var title="true">request</var> be null.</p></li>
           <li><p>Let <var title="true">destination URL</var> be null.</p></li>
           <li><p>Let <var title="true">origin</var> be the <a href="http://www.w3.org/TR/html5/browsers.html#origin-0">origin</a> of the <code><a href="#dom-mediakeys">MediaKeys</a></code> object's <code><a href="http://www.w3.org/TR/dom/#document">Document</a></code>.</p></li>
@@ -559,7 +559,7 @@
               <li><p>Let <var title="true">session data</var> be the data stored for the <var title="true">sessionId</var> in the <var title="true">origin</var>.
               This must not include data from other origin(s) or that is not associated with an origin.</p></li>
               <li><p>Load the <var title="true">session data</var>.</p></li>
-              <li><p>If the <var title="true">session data</var> indicates an expiration time for the session, let <var title="true">expiration time</var> be a Date object representing that time.</p></li>
+              <li><p>If the <var title="true">session data</var> indicates an expiration time for the session, let <var title="true">expiration time</var> be the expiration time in milliseconds since 01 January 1970 UTC.</p></li>
               <li>
 <p>If a message exchange is required:</p>
                 <ol>
@@ -721,8 +721,7 @@
       Each element must be unique.
     </p>
 
-    <p>The <dfn id="dom-expiration"><code>expiration</code></dfn> attribute is the time, if any, at which the the key(s) in the session will no longer be usable usable to decrypt <a href="http://www.w3.org/TR/html5/embedded-content-0.html#media-data">media data</a> as determined by the CDM.
-      It may be <code>undefined</code>.
+    <p>The <dfn id="dom-expiration"><code>expiration</code></dfn> attribute is the time, in milliseconds since since 01 January, 1970 UTC, at which the the key(s) in the session will no longer be usable usable to decrypt <a href="http://www.w3.org/TR/html5/embedded-content-0.html#media-data">media data</a>, or <code>NaN</code> if no such time exists, as determined by the CDM.
     </p>
 
     <p>The <dfn id="dom-closed"><code>closed</code></dfn> attribute signals when object becomes closed as a result of the <a href="#algorithms-session-close">Session Close</a> algorithm being run.
@@ -1281,13 +1280,13 @@
     <h3 id="algorithms-update-expiration">4.6. Update Expiration</h3>
     <p>The Update Expiration algorithm is run when the CDM changes the expiration time of a session.
     This can happen as the result of an <code><a href="#dom-update">update()</a></code> call or some other event.
-    Requests to run this algorithm include a target <code><a href="#dom-mediakeysession">MediaKeySession</a></code> object and the new expiration time, which may be <code>undefined</code>.
+    Requests to run this algorithm include a target <code><a href="#dom-mediakeysession">MediaKeySession</a></code> object and the new expiration time, which may be <code>NaN</code>.
     </p>
     <p>The following steps are run:</p>
     <ol>
       <li><p>Let the <var title="true">session</var> be the associated <code><a href="#dom-mediakeysession">MediaKeySession</a></code> object.</p></li>
-      <li><p>Let <var title="true">expiration time</var> be <code>undefined</code>.</p></li>
-      <li><p>If the new expiration time is not <code>undefined</code>, let <var title="true">expiration time</var> be a Date object representing the new expiration time.</p></li>
+      <li><p>Let <var title="true">expiration time</var> be <code>NaN</code>.</p></li>
+      <li><p>If the new expiration time is not <code>NaN</code>, let <var title="true">expiration time</var> be the new expiration time in milliseconds since 01 January 1970 UTC.</p></li>
       <li><p>Set the <var title="true">session</var>'s <code><a href="#dom-expiration">expiration</a></code> attribute to <var title="true">expiration time</var>.</p></li>
     </ol>
 
@@ -1377,7 +1376,7 @@
       </li>
       <li><p>The <code><a href="#dom-sessionid">sessionId</a></code> attribute is a numerical value representable by a 32-bit integer.</p></li>
       <li><p>The <code><a href="#dom-usablekeyids">usableKeyIds</a></code> attribute is always all key IDs that have been provided via <code><a href="#dom-update">update()</a></code>.</p></li>
-      <li><p>The <code><a href="#dom-expiration">expiration</a></code> attribute is always <code>undefined</code>.</p></li>
+      <li><p>The <code><a href="#dom-expiration">expiration</a></code> attribute is always <code>NaN</code>.</p></li>
       <li>
 <p>In the <code><a href="#dom-update">update()</a></code> algorithm:</p>
         <ul>
--- a/encrypted-media/encrypted-media.xml	Tue Jun 24 13:47:32 2014 -0700
+++ b/encrypted-media/encrypted-media.xml	Tue Jun 24 14:03:42 2014 -0700
@@ -362,7 +362,7 @@
   readonly attribute DOMString <precoderef>sessionId</precoderef>;
   <div class="issue"><div class="issue-title"><span>Issue 7</span></div><p class=""><precoderef>usableKeyIds</precoderef> is not WebIDL-compliant. See <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=25594">Bug 25594</a>.</p></div>
   readonly attribute Array&lt;ArrayBuffer&gt; <precoderef>usableKeyIds</precoderef>;
-  readonly attribute Date <precoderef>expiration</precoderef>;
+  readonly attribute unrestricted double <precoderef>expiration</precoderef>;
   readonly attribute Promise&lt;any&gt; <precoderef>closed</precoderef>;
 
   // session operations
@@ -498,7 +498,7 @@
               <li><p>Set the <coderef>error</coderef> attribute to null.</p></li>
               <li><p>Set the <coderef>sessionId</coderef> attribute to <var title="true">session ID</var>.</p></li>
               <li><p>Set the <coderef>usableKeyIds</coderef> attribute to an empty Array.</p></li>
-              <li><p>Let <coderef>expiration</coderef> be <code>undefined</code>.</p></li>
+              <li><p>Let <coderef>expiration</coderef> be <code>NaN</code>.</p></li>
               <li><p>Let <coderef>closed</coderef> be a new promise.</p></li>
               <li><p>Let the session type be <var title="true">sessionType</var>.</p></li>
               <li><p>Let the session initData be the <var title="true">initDataType</var>-<var>init data</var> pair.</p></li>
@@ -524,7 +524,7 @@
           <li><p>If the <var title="true">list of active session IDs</var> for this object includes an entry for <var title="true">sessionId</var>, resolve <var>promise</var> with <code>null</code>.</p>
             <p class="non-normative">In other words, do not create a session if a non-closed session already exists for this <var title="true">sessionId</var>.</p>
           </li>
-          <li><p>Let <var title="true">expiration time</var> be <code>undefined</code>.</p></li>
+          <li><p>Let <var title="true">expiration time</var> be <code>NaN</code>.</p></li>
           <li><p>Let <var title="true">request</var> be null.</p></li>
           <li><p>Let <var title="true">destination URL</var> be null.</p></li>
           <li><p>Let <var title="true">origin</var> be the <a href="http://www.w3.org/TR/html5/browsers.html#origin-0">origin</a> of the <coderef>MediaKeys</coderef> object's <code><dom4ref name="document">Document</dom4ref></code>.</p></li>
@@ -535,7 +535,7 @@
               <li><p>Let <var title="true">session data</var> be the data stored for the <var title="true">sessionId</var> in the <var title="true">origin</var>.
               This must not include data from other origin(s) or that is not associated with an origin.</p></li>
               <li><p>Load the <var title="true">session data</var>.</p></li>
-              <li><p>If the <var title="true">session data</var> indicates an expiration time for the session, let <var title="true">expiration time</var> be a Date object representing that time.</p></li>
+              <li><p>If the <var title="true">session data</var> indicates an expiration time for the session, let <var title="true">expiration time</var> be the expiration time in milliseconds since 01 January 1970 UTC.</p></li>
               <li><p>If a message exchange is required:</p>
                 <ol>
                   <li><p>Let <var title="true">request</var> be a request generated by the <a href="#cdm">CDM</a> based on the <var title="true">session data</var>.</p></li>
@@ -679,8 +679,7 @@
       Each element must be unique.
     </p>
 
-    <p>The <codedfn>expiration</codedfn> attribute is the time, if any, at which the the key(s) in the session will no longer be usable usable to decrypt <videoanchor name="media-data">media data</videoanchor> as determined by the CDM.
-      It may be <code>undefined</code>.
+    <p>The <codedfn>expiration</codedfn> attribute is the time, in milliseconds since since 01 January, 1970 UTC, at which the the key(s) in the session will no longer be usable usable to decrypt <videoanchor name="media-data">media data</videoanchor>, or <code>NaN</code> if no such time exists, as determined by the CDM.
     </p>
 
     <p>The <codedfn>closed</codedfn> attribute signals when object becomes closed as a result of the <a href="#algorithms-session-close">Session Close</a> algorithm being run.
@@ -1206,13 +1205,13 @@
     <h3 id="algorithms-update-expiration">4.6. Update Expiration</h3>
     <p>The Update Expiration algorithm is run when the CDM changes the expiration time of a session.
     This can happen as the result of an <methodref>update</methodref> call or some other event.
-    Requests to run this algorithm include a target <coderef>MediaKeySession</coderef> object and the new expiration time, which may be <code>undefined</code>.
+    Requests to run this algorithm include a target <coderef>MediaKeySession</coderef> object and the new expiration time, which may be <code>NaN</code>.
     </p>
     <p>The following steps are run:</p>
     <ol>
       <li><p>Let the <var title="true">session</var> be the associated <coderef>MediaKeySession</coderef> object.</p></li>
-      <li><p>Let <var title="true">expiration time</var> be <code>undefined</code>.</p></li>
-      <li><p>If the new expiration time is not <code>undefined</code>, let <var title="true">expiration time</var> be a Date object representing the new expiration time.</p></li>
+      <li><p>Let <var title="true">expiration time</var> be <code>NaN</code>.</p></li>
+      <li><p>If the new expiration time is not <code>NaN</code>, let <var title="true">expiration time</var> be the new expiration time in milliseconds since 01 January 1970 UTC.</p></li>
       <li><p>Set the <var title="true">session</var>'s <coderef>expiration</coderef> attribute to <var title="true">expiration time</var>.</p></li>
     </ol>
 
@@ -1299,7 +1298,7 @@
       </li>
       <li><p>The <coderef>sessionId</coderef> attribute is a numerical value representable by a 32-bit integer.</p></li>
       <li><p>The <coderef>usableKeyIds</coderef> attribute is always all key IDs that have been provided via <methodref>update</methodref>.</p></li>
-      <li><p>The <coderef>expiration</coderef> attribute is always <code>undefined</code>.</p></li>
+      <li><p>The <coderef>expiration</coderef> attribute is always <code>NaN</code>.</p></li>
       <li><p>In the <methodref>update</methodref> algorithm:</p>
         <ul>
           <li><p>The <var title="true">response</var> parameter is a JWK Set as described in <a href="#clear-key-licese-format">License Format</a>.</p></li>