mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 21:28:55 +00:00
Backed out changeset 656b778e0f15 (bug 1278198)
This commit is contained in:
parent
770517afec
commit
371d555f4a
@ -41,7 +41,7 @@ struct DecryptResult {
|
||||
class CDMProxy {
|
||||
protected:
|
||||
typedef dom::PromiseId PromiseId;
|
||||
typedef dom::MediaKeySessionType MediaKeySessionType;
|
||||
typedef dom::SessionType SessionType;
|
||||
public:
|
||||
|
||||
NS_IMETHOD_(MozExternalRefCountType) AddRef(void) = 0;
|
||||
@ -68,7 +68,7 @@ public:
|
||||
// Calls MediaKeys::OnSessionActivated() when session is created.
|
||||
// Assumes ownership of (Move()s) aInitData's contents.
|
||||
virtual void CreateSession(uint32_t aCreateSessionToken,
|
||||
MediaKeySessionType aSessionType,
|
||||
dom::SessionType aSessionType,
|
||||
PromiseId aPromiseId,
|
||||
const nsAString& aInitDataType,
|
||||
nsTArray<uint8_t>& aInitData) = 0;
|
||||
|
@ -44,7 +44,7 @@ MediaKeySession::MediaKeySession(JSContext* aCx,
|
||||
MediaKeys* aKeys,
|
||||
const nsAString& aKeySystem,
|
||||
const nsAString& aCDMVersion,
|
||||
MediaKeySessionType aSessionType,
|
||||
SessionType aSessionType,
|
||||
ErrorResult& aRv)
|
||||
: DOMEventTargetHelper(aParent)
|
||||
, mKeys(aKeys)
|
||||
@ -386,7 +386,7 @@ MediaKeySession::Remove(ErrorResult& aRv)
|
||||
NS_LITERAL_CSTRING("MediaKeySession.Remove() called before sessionId set by CDM"));
|
||||
return promise.forget();
|
||||
}
|
||||
if (mSessionType != MediaKeySessionType::Persistent_license) {
|
||||
if (mSessionType != SessionType::Persistent) {
|
||||
promise->MaybeReject(NS_ERROR_DOM_INVALID_ACCESS_ERR,
|
||||
NS_LITERAL_CSTRING("Calling MediaKeySession.remove() on non-persistent session"));
|
||||
// "The operation is not supported on session type sessions."
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
MediaKeys* aKeys,
|
||||
const nsAString& aKeySystem,
|
||||
const nsAString& aCDMVersion,
|
||||
MediaKeySessionType aSessionType,
|
||||
SessionType aSessionType,
|
||||
ErrorResult& aRv);
|
||||
|
||||
void SetSessionId(const nsAString& aSessionId);
|
||||
@ -119,7 +119,7 @@ private:
|
||||
const nsString mKeySystem;
|
||||
const nsString mCDMVersion;
|
||||
nsString mSessionId;
|
||||
const MediaKeySessionType mSessionType;
|
||||
const SessionType mSessionType;
|
||||
const uint32_t mToken;
|
||||
bool mIsClosed;
|
||||
bool mUninitialized;
|
||||
|
@ -414,7 +414,7 @@ MediaKeys::OnCDMCreated(PromiseId aId, const nsACString& aNodeId, const uint32_t
|
||||
|
||||
already_AddRefed<MediaKeySession>
|
||||
MediaKeys::CreateSession(JSContext* aCx,
|
||||
MediaKeySessionType aSessionType,
|
||||
SessionType aSessionType,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
if (!mProxy) {
|
||||
|
@ -66,7 +66,7 @@ public:
|
||||
|
||||
// JavaScript: MediaKeys.createSession()
|
||||
already_AddRefed<MediaKeySession> CreateSession(JSContext* aCx,
|
||||
MediaKeySessionType aSessionType,
|
||||
SessionType aSessionType,
|
||||
ErrorResult& aRv);
|
||||
|
||||
// JavaScript: MediaKeys.SetServerCertificate()
|
||||
|
@ -263,7 +263,7 @@ GMPCDMProxy::OnCDMCreated(uint32_t aPromiseId)
|
||||
|
||||
void
|
||||
GMPCDMProxy::CreateSession(uint32_t aCreateSessionToken,
|
||||
dom::MediaKeySessionType aSessionType,
|
||||
dom::SessionType aSessionType,
|
||||
PromiseId aPromiseId,
|
||||
const nsAString& aInitDataType,
|
||||
nsTArray<uint8_t>& aInitData)
|
||||
@ -284,10 +284,10 @@ GMPCDMProxy::CreateSession(uint32_t aCreateSessionToken,
|
||||
}
|
||||
|
||||
GMPSessionType
|
||||
ToGMPSessionType(dom::MediaKeySessionType aSessionType) {
|
||||
ToGMPSessionType(dom::SessionType aSessionType) {
|
||||
switch (aSessionType) {
|
||||
case dom::MediaKeySessionType::Temporary: return kGMPTemporySession;
|
||||
case dom::MediaKeySessionType::Persistent_license: return kGMPPersistentSession;
|
||||
case dom::SessionType::Temporary: return kGMPTemporySession;
|
||||
case dom::SessionType::Persistent: return kGMPPersistentSession;
|
||||
default: return kGMPTemporySession;
|
||||
};
|
||||
};
|
||||
|
@ -33,7 +33,7 @@ public:
|
||||
bool aInPrivateBrowsing) override;
|
||||
|
||||
void CreateSession(uint32_t aCreateSessionToken,
|
||||
dom::MediaKeySessionType aSessionType,
|
||||
dom::SessionType aSessionType,
|
||||
PromiseId aPromiseId,
|
||||
const nsAString& aInitDataType,
|
||||
nsTArray<uint8_t>& aInitData) override;
|
||||
@ -134,7 +134,7 @@ private:
|
||||
void OnCDMCreated(uint32_t aPromiseId);
|
||||
|
||||
struct CreateSessionData {
|
||||
dom::MediaKeySessionType mSessionType;
|
||||
dom::SessionType mSessionType;
|
||||
uint32_t mCreateSessionToken;
|
||||
PromiseId mPromiseId;
|
||||
nsCString mInitDataType;
|
||||
|
@ -521,7 +521,7 @@ ClearKeyUtils::SessionTypeToString(GMPSessionType aSessionType)
|
||||
{
|
||||
switch (aSessionType) {
|
||||
case kGMPTemporySession: return "temporary";
|
||||
case kGMPPersistentSession: return "persistent-license";
|
||||
case kGMPPersistentSession: return "persistent";
|
||||
default: {
|
||||
assert(false); // Should not reach here.
|
||||
return "invalid";
|
||||
|
Loading…
x
Reference in New Issue
Block a user