Commit b10d7584 authored by jrummell@chromium.org's avatar jrummell@chromium.org

Implement unprefixed EME APIs that match the latest draft

Update the API for WebContentDecryptionModule and
WebContentDecryptionModuleSession in order to implement
the latest EME API spec.

BUG=224786
TEST=Adding to API, no code using it. All existing EME tests pass.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@183627 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 40bf2099
......@@ -605,6 +605,11 @@ void MediaKeySession::error(WebContentDecryptionModuleException exception, unsig
error(errorCode, systemCode);
}
void MediaKeySession::expirationChanged(double updatedExpiryTimeInMS)
{
// FIXME: Implement expiration attribute.
}
const AtomicString& MediaKeySession::interfaceName() const
{
return EventTargetNames::MediaKeySession;
......
......@@ -108,6 +108,7 @@ private:
virtual void close() override;
virtual void error(MediaKeyErrorCode, unsigned long systemCode) override;
virtual void error(WebContentDecryptionModuleException, unsigned long systemCode, const WebString& errorMessage) override;
virtual void expirationChanged(double updatedExpiryTimeInMS) override;
ScriptPromise generateRequestInternal(ScriptState*, const String& initDataType, PassRefPtr<ArrayBuffer> initData);
ScriptPromise updateInternal(ScriptState*, PassRefPtr<ArrayBuffer> response);
......
......@@ -48,11 +48,26 @@ void WebContentDecryptionModuleSession::initializeNewSession(const WebString& in
ReportError(result);
}
void WebContentDecryptionModuleSession::load(const WebString& sessionId, WebContentDecryptionModuleResult result)
{
ReportError(result);
}
void WebContentDecryptionModuleSession::update(const unsigned char* response, size_t responseLength, WebContentDecryptionModuleResult result)
{
ReportError(result);
}
void WebContentDecryptionModuleSession::close(WebContentDecryptionModuleResult result)
{
ReportError(result);
}
void WebContentDecryptionModuleSession::remove(WebContentDecryptionModuleResult result)
{
ReportError(result);
}
void WebContentDecryptionModuleSession::release(WebContentDecryptionModuleResult result)
{
ReportError(result);
......
......@@ -31,6 +31,7 @@
#ifndef WebContentDecryptionModule_h
#define WebContentDecryptionModule_h
#include "public/platform/WebContentDecryptionModuleResult.h"
#include "public/platform/WebContentDecryptionModuleSession.h"
namespace blink {
......@@ -41,6 +42,8 @@ public:
// Must return non-null.
virtual WebContentDecryptionModuleSession* createSession() = 0;
virtual void setServerCertificate(const unsigned char* certificate, size_t certificateLength, WebContentDecryptionModuleResult) = 0;
};
} // namespace blink
......
......@@ -56,6 +56,11 @@ public:
virtual void error(MediaKeyErrorCode, unsigned long systemCode) = 0;
virtual void error(WebContentDecryptionModuleException, unsigned long systemCode, const WebString& message) = 0;
// Called when the expiration time for the session changes.
// |updatedExpiryTimeInMS| is specified as the number of milliseconds
// since 01 January, 1970 UTC.
virtual void expirationChanged(double updatedExpiryTimeInMS) = 0;
protected:
virtual ~Client();
};
......@@ -71,7 +76,12 @@ public:
virtual void release() = 0;
virtual void initializeNewSession(const WebString& initDataType, const unsigned char* initData, size_t initDataLength, const WebString& sessionType, WebContentDecryptionModuleResult);
virtual void load(const WebString& sessionId, WebContentDecryptionModuleResult);
virtual void update(const unsigned char* response, size_t responseLength, WebContentDecryptionModuleResult);
virtual void close(WebContentDecryptionModuleResult);
virtual void remove(WebContentDecryptionModuleResult);
// FIXME: Remove this method once the new methods are implemented in Chromium.
virtual void release(WebContentDecryptionModuleResult);
};
......
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