Commit 8c4db617 authored by jrummell@chromium.org's avatar jrummell@chromium.org

Add MediaKeySession.expiration attribute.

BUG=358271
TEST=existing EME tests still pass + private tests

Review URL: https://codereview.chromium.org/621903003

git-svn-id: svn://svn.chromium.org/blink/trunk@183708 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 513bbecd
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
#include "public/platform/WebURL.h" #include "public/platform/WebURL.h"
#include "wtf/ArrayBuffer.h" #include "wtf/ArrayBuffer.h"
#include "wtf/ArrayBufferView.h" #include "wtf/ArrayBufferView.h"
#include <cmath>
#include <limits>
namespace { namespace {
...@@ -236,6 +238,7 @@ MediaKeySession::MediaKeySession(ScriptState* scriptState, MediaKeys* mediaKeys, ...@@ -236,6 +238,7 @@ MediaKeySession::MediaKeySession(ScriptState* scriptState, MediaKeys* mediaKeys,
, m_asyncEventQueue(GenericEventQueue::create(this)) , m_asyncEventQueue(GenericEventQueue::create(this))
, m_mediaKeys(mediaKeys) , m_mediaKeys(mediaKeys)
, m_sessionType(sessionType) , m_sessionType(sessionType)
, m_expiration(std::numeric_limits<double>::quiet_NaN())
, m_isUninitialized(true) , m_isUninitialized(true)
, m_isCallable(false) , m_isCallable(false)
, m_isClosed(false) , m_isClosed(false)
...@@ -256,7 +259,7 @@ MediaKeySession::MediaKeySession(ScriptState* scriptState, MediaKeys* mediaKeys, ...@@ -256,7 +259,7 @@ MediaKeySession::MediaKeySession(ScriptState* scriptState, MediaKeys* mediaKeys,
ASSERT(sessionId().isEmpty()); ASSERT(sessionId().isEmpty());
// 2.2 Let the expiration attribute be NaN. // 2.2 Let the expiration attribute be NaN.
// FIXME: Add expiration property. ASSERT(std::isnan(m_expiration));
// 2.3 Let the closed attribute be a new promise. // 2.3 Let the closed attribute be a new promise.
ASSERT(!closed(scriptState).isUndefinedOrNull()); ASSERT(!closed(scriptState).isUndefinedOrNull());
...@@ -700,7 +703,7 @@ void MediaKeySession::error(WebContentDecryptionModuleException exception, unsig ...@@ -700,7 +703,7 @@ void MediaKeySession::error(WebContentDecryptionModuleException exception, unsig
void MediaKeySession::expirationChanged(double updatedExpiryTimeInMS) void MediaKeySession::expirationChanged(double updatedExpiryTimeInMS)
{ {
// FIXME: Implement expiration attribute. m_expiration = updatedExpiryTimeInMS;
} }
const AtomicString& MediaKeySession::interfaceName() const const AtomicString& MediaKeySession::interfaceName() const
......
...@@ -70,6 +70,7 @@ public: ...@@ -70,6 +70,7 @@ public:
const String& keySystem() const { return m_keySystem; } const String& keySystem() const { return m_keySystem; }
String sessionId() const; String sessionId() const;
double expiration() const { return m_expiration; }
ScriptPromise closed(ScriptState*); ScriptPromise closed(ScriptState*);
ScriptPromise generateRequest(ScriptState*, const String& initDataType, ArrayBuffer* initData); ScriptPromise generateRequest(ScriptState*, const String& initDataType, ArrayBuffer* initData);
...@@ -127,6 +128,7 @@ private: ...@@ -127,6 +128,7 @@ private:
// Session properties. // Session properties.
String m_sessionType; String m_sessionType;
double m_expiration;
// Session states. // Session states.
bool m_isUninitialized; bool m_isUninitialized;
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
// session properties // session properties
readonly attribute DOMString keySystem; readonly attribute DOMString keySystem;
readonly attribute DOMString sessionId; readonly attribute DOMString sessionId;
readonly attribute unrestricted double expiration;
[CallWith=ScriptState] readonly attribute Promise closed; [CallWith=ScriptState] readonly attribute Promise closed;
// session initialization // session initialization
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment