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 @@
#include "public/platform/WebURL.h"
#include "wtf/ArrayBuffer.h"
#include "wtf/ArrayBufferView.h"
#include <cmath>
#include <limits>
namespace {
......@@ -236,6 +238,7 @@ MediaKeySession::MediaKeySession(ScriptState* scriptState, MediaKeys* mediaKeys,
, m_asyncEventQueue(GenericEventQueue::create(this))
, m_mediaKeys(mediaKeys)
, m_sessionType(sessionType)
, m_expiration(std::numeric_limits<double>::quiet_NaN())
, m_isUninitialized(true)
, m_isCallable(false)
, m_isClosed(false)
......@@ -256,7 +259,7 @@ MediaKeySession::MediaKeySession(ScriptState* scriptState, MediaKeys* mediaKeys,
ASSERT(sessionId().isEmpty());
// 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.
ASSERT(!closed(scriptState).isUndefinedOrNull());
......@@ -700,7 +703,7 @@ void MediaKeySession::error(WebContentDecryptionModuleException exception, unsig
void MediaKeySession::expirationChanged(double updatedExpiryTimeInMS)
{
// FIXME: Implement expiration attribute.
m_expiration = updatedExpiryTimeInMS;
}
const AtomicString& MediaKeySession::interfaceName() const
......
......@@ -70,6 +70,7 @@ public:
const String& keySystem() const { return m_keySystem; }
String sessionId() const;
double expiration() const { return m_expiration; }
ScriptPromise closed(ScriptState*);
ScriptPromise generateRequest(ScriptState*, const String& initDataType, ArrayBuffer* initData);
......@@ -127,6 +128,7 @@ private:
// Session properties.
String m_sessionType;
double m_expiration;
// Session states.
bool m_isUninitialized;
......
......@@ -35,6 +35,7 @@
// session properties
readonly attribute DOMString keySystem;
readonly attribute DOMString sessionId;
readonly attribute unrestricted double expiration;
[CallWith=ScriptState] readonly attribute Promise closed;
// 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