From e7e1c29ef1f020ca8a0eec2938be063d1d6491f7 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Thu, 9 Oct 2014 12:48:33 +0200 Subject: [PATCH] Backed out changeset 1e532bbff55b (bug 1060179) --- content/media/eme/CDMProxy.cpp | 19 ++++---- content/media/eme/CDMProxy.h | 4 +- content/media/eme/MediaKeys.cpp | 21 ++++----- content/media/eme/MediaKeys.h | 3 +- content/media/fmp4/eme/EMEAudioDecoder.cpp | 2 +- content/media/fmp4/eme/EMEH264Decoder.cpp | 2 +- content/media/gmp/GMPParent.cpp | 20 ++++----- content/media/gmp/GMPParent.h | 34 +++++++-------- content/media/gmp/GMPService.cpp | 43 ++++++++++--------- content/media/gmp/GMPService.h | 4 +- content/media/gmp/GMPStorageParent.cpp | 22 +++++----- content/media/gmp/GMPStorageParent.h | 4 +- .../media/gmp/mozIGeckoMediaPluginService.idl | 13 +++--- .../src/media-conduit/WebrtcGmpVideoCodec.cpp | 6 +-- .../signaling/src/media/VcmSIPCCBinding.cpp | 4 +- 15 files changed, 96 insertions(+), 105 deletions(-) diff --git a/content/media/eme/CDMProxy.cpp b/content/media/eme/CDMProxy.cpp index a9dae6a909d0..fa183acf9dea 100644 --- a/content/media/eme/CDMProxy.cpp +++ b/content/media/eme/CDMProxy.cpp @@ -41,12 +41,13 @@ CDMProxy::Init(PromiseId aPromiseId) MOZ_ASSERT(NS_IsMainThread()); NS_ENSURE_TRUE_VOID(!mKeys.IsNull()); - mNodeId = mKeys->GetNodeId(); - if (mNodeId.IsEmpty()) { + nsresult rv = mKeys->GetOrigin(mOrigin); + if (NS_FAILED(rv)) { RejectPromise(aPromiseId, NS_ERROR_DOM_INVALID_STATE_ERR); return; } - EME_LOG("Creating CDMProxy for origin='%s'", GetNodeId().get()); + EME_LOG("Creating CDMProxy for origin='%s'", + NS_ConvertUTF16toUTF8(GetOrigin()).get()); if (!mGMPThread) { nsCOMPtr mps = @@ -88,7 +89,7 @@ CDMProxy::gmp_Init(uint32_t aPromiseId) nsTArray tags; tags.AppendElement(NS_ConvertUTF16toUTF8(mKeySystem)); - nsresult rv = mps->GetGMPDecryptor(&tags, GetNodeId(), &mCDM); + nsresult rv = mps->GetGMPDecryptor(&tags, GetOrigin(), &mCDM); if (NS_FAILED(rv) || !mCDM) { RejectPromise(aPromiseId, NS_ERROR_DOM_INVALID_STATE_ERR); } else { @@ -303,9 +304,7 @@ CDMProxy::Shutdown() mKeys.Clear(); // Note: This may end up being the last owning reference to the CDMProxy. nsRefPtr task(NS_NewRunnableMethod(this, &CDMProxy::gmp_Shutdown)); - if (mGMPThread) { - mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL); - } + mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL); } void @@ -357,10 +356,10 @@ CDMProxy::ResolvePromise(PromiseId aId) } } -const nsCString& -CDMProxy::GetNodeId() const +const nsAString& +CDMProxy::GetOrigin() const { - return mNodeId; + return mOrigin; } void diff --git a/content/media/eme/CDMProxy.h b/content/media/eme/CDMProxy.h index 802ff5b058ba..6f07049a3805 100644 --- a/content/media/eme/CDMProxy.h +++ b/content/media/eme/CDMProxy.h @@ -102,7 +102,7 @@ public: void Shutdown(); // Threadsafe. - const nsCString& GetNodeId() const; + const nsAString& GetOrigin() const; // Main thread only. void OnResolveNewSessionPromise(uint32_t aPromiseId, @@ -286,7 +286,7 @@ private: // EME plugin must come from this thread. nsRefPtr mGMPThread; - nsCString mNodeId; + nsAutoString mOrigin; GMPDecryptorProxy* mCDM; CDMCaps mCapabilites; diff --git a/content/media/eme/MediaKeys.cpp b/content/media/eme/MediaKeys.cpp index f9b15da29b2e..fe37b1b431be 100644 --- a/content/media/eme/MediaKeys.cpp +++ b/content/media/eme/MediaKeys.cpp @@ -366,17 +366,12 @@ MediaKeys::GetSession(const nsAString& aSessionId) return session.forget(); } -const nsCString& -MediaKeys::GetNodeId() +nsresult +MediaKeys::GetOrigin(nsString& aOutOrigin) { MOZ_ASSERT(NS_IsMainThread()); - // TODO: Bug 1035637, return a combination of origin and URL bar origin. - if (!mNodeId.IsEmpty()) { - return mNodeId; - } - nsIPrincipal* principal = nullptr; nsCOMPtr pWindow = do_QueryInterface(GetParentObject()); nsCOMPtr scriptPrincipal = @@ -384,13 +379,13 @@ MediaKeys::GetNodeId() if (scriptPrincipal) { principal = scriptPrincipal->GetPrincipal(); } - nsAutoString id; - if (principal && NS_SUCCEEDED(nsContentUtils::GetUTFOrigin(principal, id))) { - CopyUTF16toUTF8(id, mNodeId); - EME_LOG("EME Origin = '%s'", mNodeId.get()); - } + NS_ENSURE_TRUE(principal, NS_ERROR_FAILURE); - return mNodeId; + nsresult res = nsContentUtils::GetUTFOrigin(principal, aOutOrigin); + + EME_LOG("EME Origin = '%s'", NS_ConvertUTF16toUTF8(aOutOrigin).get()); + + return res; } bool diff --git a/content/media/eme/MediaKeys.h b/content/media/eme/MediaKeys.h index 20b245a2c212..49230461ad29 100644 --- a/content/media/eme/MediaKeys.h +++ b/content/media/eme/MediaKeys.h @@ -107,7 +107,7 @@ public: // Resolves promise with "undefined". void ResolvePromise(PromiseId aId); - const nsCString& GetNodeId(); + nsresult GetOrigin(nsString& aOutOrigin); void Shutdown(); @@ -122,7 +122,6 @@ private: nsCOMPtr mParent; nsString mKeySystem; - nsCString mNodeId; KeySessionHashMap mKeySessions; PromiseHashMap mPromises; PendingKeySessionsHashMap mPendingSessions; diff --git a/content/media/fmp4/eme/EMEAudioDecoder.cpp b/content/media/fmp4/eme/EMEAudioDecoder.cpp index b05bda518312..94aec13b8a27 100644 --- a/content/media/fmp4/eme/EMEAudioDecoder.cpp +++ b/content/media/fmp4/eme/EMEAudioDecoder.cpp @@ -242,7 +242,7 @@ EMEAudioDecoder::GmpInit() tags.AppendElement(NS_LITERAL_CSTRING("aac")); tags.AppendElement(NS_ConvertUTF16toUTF8(mProxy->KeySystem())); nsresult rv = mMPS->GetGMPAudioDecoder(&tags, - mProxy->GetNodeId(), + mProxy->GetOrigin(), &mGMP); NS_ENSURE_SUCCESS(rv, rv); MOZ_ASSERT(mGMP); diff --git a/content/media/fmp4/eme/EMEH264Decoder.cpp b/content/media/fmp4/eme/EMEH264Decoder.cpp index 6b0d8e7f3a51..628f9cef0d16 100644 --- a/content/media/fmp4/eme/EMEH264Decoder.cpp +++ b/content/media/fmp4/eme/EMEH264Decoder.cpp @@ -233,7 +233,7 @@ EMEH264Decoder::GmpInit() tags.AppendElement(NS_LITERAL_CSTRING("h264")); tags.AppendElement(NS_ConvertUTF16toUTF8(mProxy->KeySystem())); nsresult rv = mMPS->GetGMPVideoDecoder(&tags, - mProxy->GetNodeId(), + mProxy->GetOrigin(), &mHost, &mGMP); NS_ENSURE_SUCCESS(rv, rv); diff --git a/content/media/gmp/GMPParent.cpp b/content/media/gmp/GMPParent.cpp index d059e3b78a3c..aed2d4e7a176 100644 --- a/content/media/gmp/GMPParent.cpp +++ b/content/media/gmp/GMPParent.cpp @@ -680,7 +680,7 @@ GMPParent::DeallocPGMPAudioDecoderParent(PGMPAudioDecoderParent* aActor) PGMPStorageParent* GMPParent::AllocPGMPStorageParent() { - GMPStorageParent* p = new GMPStorageParent(mNodeId, this); + GMPStorageParent* p = new GMPStorageParent(mOrigin, this); mStorage.AppendElement(p); // Addrefs, released in DeallocPGMPStorageParent. return p; } @@ -877,24 +877,24 @@ GMPParent::ReadGMPMetaData() } bool -GMPParent::CanBeSharedCrossNodeIds() const +GMPParent::CanBeSharedCrossOrigin() const { - return mNodeId.IsEmpty(); + return mOrigin.IsEmpty(); } bool -GMPParent::CanBeUsedFrom(const nsACString& aNodeId) const +GMPParent::CanBeUsedFrom(const nsAString& aOrigin) const { - return (mNodeId.IsEmpty() && State() == GMPStateNotLoaded) || - mNodeId == aNodeId; + return (mOrigin.IsEmpty() && State() == GMPStateNotLoaded) || + mOrigin.Equals(aOrigin); } void -GMPParent::SetNodeId(const nsACString& aNodeId) +GMPParent::SetOrigin(const nsAString& aOrigin) { - MOZ_ASSERT(!aNodeId.IsEmpty()); - MOZ_ASSERT(CanBeUsedFrom(aNodeId)); - mNodeId = aNodeId; + MOZ_ASSERT(!aOrigin.IsEmpty()); + MOZ_ASSERT(CanBeUsedFrom(aOrigin)); + mOrigin = aOrigin; } bool diff --git a/content/media/gmp/GMPParent.h b/content/media/gmp/GMPParent.h index 57186b78ec01..2fe794324c8a 100644 --- a/content/media/gmp/GMPParent.h +++ b/content/media/gmp/GMPParent.h @@ -99,28 +99,26 @@ public: GMPState State() const; nsIThread* GMPThread(); - // A GMP can either be a single instance shared across all NodeIds (like + // A GMP can either be a single instance shared across all origins (like // in the OpenH264 case), or we can require a new plugin instance for every - // NodeIds running the plugin (as in the EME plugin case). + // origin running the plugin (as in the EME plugin case). // - // A NodeId is a hash of the ($urlBarOrigin, $ownerDocOrigin) pair. - // - // Plugins are associated with an NodeIds by calling SetNodeId() before + // Plugins are associated with an origin by calling SetOrigin() before // loading. // - // If a plugin has no NodeId specified and it is loaded, it is assumed to - // be shared across NodeIds. + // If a plugin has no origin specified and it is loaded, it is assumed to + // be shared across origins. - // Specifies that a GMP can only work with the specified NodeIds. - void SetNodeId(const nsACString& aNodeId); + // Specifies that a GMP can only work with the specified origin. + void SetOrigin(const nsAString& aOrigin); - // Returns true if a plugin can be or is being used across multiple NodeIds. - bool CanBeSharedCrossNodeIds() const; + // Returns true if a plugin can be or is being used across multiple origins. + bool CanBeSharedCrossOrigin() const; - // A GMP can be used from a NodeId if it's already been set to work with - // that NodeId, or if it's not been set to work with any NodeId and has - // not yet been loaded (i.e. it's not shared across NodeIds). - bool CanBeUsedFrom(const nsACString& aNodeId) const; + // A GMP can be used from an origin if it's already been set to work with + // that origin, or if it's not been set to work with any origin and has + // not yet been loaded (i.e. it's not shared across origins). + bool CanBeUsedFrom(const nsAString& aOrigin) const; already_AddRefed GetDirectory() { return nsCOMPtr(mDirectory).forget(); @@ -186,9 +184,9 @@ private: nsTArray> mTimers; nsTArray> mStorage; nsCOMPtr mGMPThread; - // NodeId the plugin is assigned to, or empty if the the plugin is not - // assigned to a NodeId. - nsAutoCString mNodeId; + // Origin the plugin is assigned to, or empty if the the plugin is not + // assigned to an origin. + nsAutoString mOrigin; bool mAsyncShutdownRequired; bool mAsyncShutdownInProgress; diff --git a/content/media/gmp/GMPService.cpp b/content/media/gmp/GMPService.cpp index 84be732287de..09817605d4bf 100644 --- a/content/media/gmp/GMPService.cpp +++ b/content/media/gmp/GMPService.cpp @@ -324,7 +324,7 @@ GeckoMediaPluginService::GetThread(nsIThread** aThread) NS_IMETHODIMP GeckoMediaPluginService::GetGMPAudioDecoder(nsTArray* aTags, - const nsACString& aNodeId, + const nsAString& aOrigin, GMPAudioDecoderProxy** aGMPAD) { MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread); @@ -335,7 +335,7 @@ GeckoMediaPluginService::GetGMPAudioDecoder(nsTArray* aTags, return NS_ERROR_FAILURE; } - nsRefPtr gmp = SelectPluginForAPI(aNodeId, + nsRefPtr gmp = SelectPluginForAPI(aOrigin, NS_LITERAL_CSTRING("decode-audio"), *aTags); if (!gmp) { @@ -355,7 +355,7 @@ GeckoMediaPluginService::GetGMPAudioDecoder(nsTArray* aTags, NS_IMETHODIMP GeckoMediaPluginService::GetGMPVideoDecoder(nsTArray* aTags, - const nsACString& aNodeId, + const nsAString& aOrigin, GMPVideoHost** aOutVideoHost, GMPVideoDecoderProxy** aGMPVD) { @@ -368,7 +368,7 @@ GeckoMediaPluginService::GetGMPVideoDecoder(nsTArray* aTags, return NS_ERROR_FAILURE; } - nsRefPtr gmp = SelectPluginForAPI(aNodeId, + nsRefPtr gmp = SelectPluginForAPI(aOrigin, NS_LITERAL_CSTRING("decode-video"), *aTags); #ifdef PR_LOGGING @@ -394,7 +394,7 @@ GeckoMediaPluginService::GetGMPVideoDecoder(nsTArray* aTags, NS_IMETHODIMP GeckoMediaPluginService::GetGMPVideoEncoder(nsTArray* aTags, - const nsACString& aNodeId, + const nsAString& aOrigin, GMPVideoHost** aOutVideoHost, GMPVideoEncoderProxy** aGMPVE) { @@ -407,7 +407,7 @@ GeckoMediaPluginService::GetGMPVideoEncoder(nsTArray* aTags, return NS_ERROR_FAILURE; } - nsRefPtr gmp = SelectPluginForAPI(aNodeId, + nsRefPtr gmp = SelectPluginForAPI(aOrigin, NS_LITERAL_CSTRING("encode-video"), *aTags); #ifdef PR_LOGGING @@ -432,7 +432,7 @@ GeckoMediaPluginService::GetGMPVideoEncoder(nsTArray* aTags, NS_IMETHODIMP GeckoMediaPluginService::GetGMPDecryptor(nsTArray* aTags, - const nsACString& aNodeId, + const nsAString& aOrigin, GMPDecryptorProxy** aDecryptor) { #if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX) @@ -451,7 +451,7 @@ GeckoMediaPluginService::GetGMPDecryptor(nsTArray* aTags, return NS_ERROR_FAILURE; } - nsRefPtr gmp = SelectPluginForAPI(aNodeId, + nsRefPtr gmp = SelectPluginForAPI(aOrigin, NS_LITERAL_CSTRING("eme-decrypt"), *aTags); if (!gmp) { @@ -658,7 +658,7 @@ GeckoMediaPluginService::RemovePluginDirectory(const nsAString& aDirectory) } NS_IMETHODIMP -GeckoMediaPluginService::HasPluginForAPI(const nsACString& aNodeId, +GeckoMediaPluginService::HasPluginForAPI(const nsAString& aOrigin, const nsACString& aAPI, nsTArray* aTags, bool* aResult) @@ -667,19 +667,19 @@ GeckoMediaPluginService::HasPluginForAPI(const nsACString& aNodeId, NS_ENSURE_ARG(aResult); nsCString temp(aAPI); - GMPParent *parent = SelectPluginForAPI(aNodeId, temp, *aTags, false); + GMPParent *parent = SelectPluginForAPI(aOrigin, temp, *aTags, false); *aResult = !!parent; return NS_OK; } GMPParent* -GeckoMediaPluginService::SelectPluginForAPI(const nsACString& aNodeId, +GeckoMediaPluginService::SelectPluginForAPI(const nsAString& aOrigin, const nsCString& aAPI, const nsTArray& aTags, - bool aCloneCrossNodeIds) + bool aCloneCrossOrigin) { - MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread || !aCloneCrossNodeIds, + MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread || !aCloneCrossOrigin, "Can't clone GMP plugins on non-GMP threads."); GMPParent* gmpToClone = nullptr; @@ -698,13 +698,14 @@ GeckoMediaPluginService::SelectPluginForAPI(const nsACString& aNodeId, if (!supportsAllTags) { continue; } - if (aNodeId.IsEmpty()) { - if (gmp->CanBeSharedCrossNodeIds()) { + if (aOrigin.IsEmpty()) { + if (gmp->CanBeSharedCrossOrigin()) { return gmp; } - } else if (gmp->CanBeUsedFrom(aNodeId)) { - MOZ_ASSERT(!aNodeId.IsEmpty()); - gmp->SetNodeId(aNodeId); + } else if (gmp->CanBeUsedFrom(aOrigin)) { + if (!aOrigin.IsEmpty()) { + gmp->SetOrigin(aOrigin); + } return gmp; } @@ -716,10 +717,10 @@ GeckoMediaPluginService::SelectPluginForAPI(const nsACString& aNodeId, // Plugin exists, but we can't use it due to cross-origin separation. Create a // new one. - if (aCloneCrossNodeIds && gmpToClone) { + if (aCloneCrossOrigin && gmpToClone) { GMPParent* clone = ClonePlugin(gmpToClone); - if (!aNodeId.IsEmpty()) { - clone->SetNodeId(aNodeId); + if (!aOrigin.IsEmpty()) { + clone->SetOrigin(aOrigin); } return clone; } diff --git a/content/media/gmp/GMPService.h b/content/media/gmp/GMPService.h index 0ea868316582..e19ba34d2ca9 100644 --- a/content/media/gmp/GMPService.h +++ b/content/media/gmp/GMPService.h @@ -45,10 +45,10 @@ public: private: ~GeckoMediaPluginService(); - GMPParent* SelectPluginForAPI(const nsACString& aNodeId, + GMPParent* SelectPluginForAPI(const nsAString& aOrigin, const nsCString& aAPI, const nsTArray& aTags, - bool aCloneCrossNodeIds = true); + bool aCloneCrossOrigin = true); void UnloadPlugins(); void CrashPlugins(); diff --git a/content/media/gmp/GMPStorageParent.cpp b/content/media/gmp/GMPStorageParent.cpp index 3539d9714e68..0480b747c0e7 100644 --- a/content/media/gmp/GMPStorageParent.cpp +++ b/content/media/gmp/GMPStorageParent.cpp @@ -56,7 +56,7 @@ public: // We store the records in files in the system temp dir. static nsresult -GetGMPStorageDir(nsIFile** aTempDir, const nsCString& aNodeId) +GetGMPStorageDir(nsIFile** aTempDir, const nsString& aOrigin) { if (NS_WARN_IF(!aTempDir)) { return NS_ERROR_INVALID_ARG; @@ -82,7 +82,7 @@ GetGMPStorageDir(nsIFile** aTempDir, const nsCString& aNodeId) // process (a UUID or somesuch), we can just append it un-hashed here. // This should reduce the chance of hash collsions exposing data. nsAutoString nodeIdHash; - nodeIdHash.AppendInt(HashString(aNodeId)); + nodeIdHash.AppendInt(HashString(static_cast(aOrigin.get()))); rv = tmpFile->Append(nodeIdHash); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; @@ -98,9 +98,9 @@ GetGMPStorageDir(nsIFile** aTempDir, const nsCString& aNodeId) return NS_OK; } -GMPStorageParent::GMPStorageParent(const nsCString& aNodeId, +GMPStorageParent::GMPStorageParent(const nsString& aOrigin, GMPParent* aPlugin) - : mNodeId(aNodeId) + : mOrigin(aOrigin) , mPlugin(aPlugin) , mShutdown(false) { @@ -110,7 +110,7 @@ enum OpenFileMode { ReadWrite, Truncate }; nsresult OpenStorageFile(const nsCString& aRecordName, - const nsCString& aNodeId, + const nsString& aNodeId, const OpenFileMode aMode, PRFileDesc** aOutFD) { @@ -141,10 +141,10 @@ GMPStorageParent::RecvOpen(const nsCString& aRecordName) return true; } - if (mNodeId.EqualsLiteral("null")) { - // Refuse to open storage if the page is opened from local disk, - // or shared across origin. - NS_WARNING("Refusing to open storage for null NodeId"); + if (mOrigin.EqualsASCII("null")) { + // Refuse to open storage if the page is the "null" origin; if the page + // is opened from disk. + NS_WARNING("Refusing to open storage for null origin"); unused << SendOpenComplete(aRecordName, GMPGenericErr); return true; } @@ -155,7 +155,7 @@ GMPStorageParent::RecvOpen(const nsCString& aRecordName) } PRFileDesc* fd = nullptr; - nsresult rv = OpenStorageFile(aRecordName, mNodeId, ReadWrite, &fd); + nsresult rv = OpenStorageFile(aRecordName, mOrigin, ReadWrite, &fd); if (NS_FAILED(rv)) { NS_WARNING("Failed to open storage file."); unused << SendOpenComplete(aRecordName, GMPGenericErr); @@ -224,7 +224,7 @@ GMPStorageParent::RecvWrite(const nsCString& aRecordName, // in truncate mode, to clear its contents. PR_Close(fd); mFiles.Remove(aRecordName); - if (NS_FAILED(OpenStorageFile(aRecordName, mNodeId, Truncate, &fd))) { + if (NS_FAILED(OpenStorageFile(aRecordName, mOrigin, Truncate, &fd))) { unused << SendWriteComplete(aRecordName, GMPGenericErr); return true; } diff --git a/content/media/gmp/GMPStorageParent.h b/content/media/gmp/GMPStorageParent.h index 870c7adad2fe..ba47f9bc3771 100644 --- a/content/media/gmp/GMPStorageParent.h +++ b/content/media/gmp/GMPStorageParent.h @@ -20,7 +20,7 @@ class GMPParent; class GMPStorageParent : public PGMPStorageParent { public: NS_INLINE_DECL_REFCOUNTING(GMPStorageParent) - GMPStorageParent(const nsCString& aNodeId, GMPParent* aPlugin); + GMPStorageParent(const nsString& aOrigin, GMPParent* aPlugin); void Shutdown(); @@ -36,7 +36,7 @@ private: ~GMPStorageParent() {} nsDataHashtable mFiles; - const nsAutoCString mNodeId; + const nsString mOrigin; nsRefPtr mPlugin; bool mShutdown; }; diff --git a/content/media/gmp/mozIGeckoMediaPluginService.idl b/content/media/gmp/mozIGeckoMediaPluginService.idl index 8c1c812d4dc0..1e46be73b261 100644 --- a/content/media/gmp/mozIGeckoMediaPluginService.idl +++ b/content/media/gmp/mozIGeckoMediaPluginService.idl @@ -25,10 +25,9 @@ class GMPVideoHost; [ptr] native GMPDecryptorProxy(GMPDecryptorProxy); [ptr] native GMPAudioDecoderProxy(GMPAudioDecoderProxy); -[scriptable, uuid(88ade941-a423-48f9-aa3d-a383af8de4b8)] +[scriptable, uuid(6ea374fc-32ad-46f6-ae9d-80b668f4fd49)] interface mozIGeckoMediaPluginService : nsISupports { - /** * The GMP thread. Callable from any thread. */ @@ -39,7 +38,7 @@ interface mozIGeckoMediaPluginService : nsISupports * Callable on any thread */ [noscript] - boolean hasPluginForAPI([optional] in ACString nodeId, + boolean hasPluginForAPI([optional] in AString origin, in ACString api, in TagArray tags); @@ -51,7 +50,7 @@ interface mozIGeckoMediaPluginService : nsISupports */ [noscript] GMPVideoDecoderProxy getGMPVideoDecoder(in TagArray tags, - [optional] in ACString nodeId, + [optional] in AString origin, out GMPVideoHost outVideoHost); /** @@ -62,7 +61,7 @@ interface mozIGeckoMediaPluginService : nsISupports */ [noscript] GMPVideoEncoderProxy getGMPVideoEncoder(in TagArray tags, - [optional] in ACString nodeId, + [optional] in AString origin, out GMPVideoHost outVideoHost); // Returns an audio decoder that supports the specified tags. @@ -70,13 +69,13 @@ interface mozIGeckoMediaPluginService : nsISupports // other tags such as for EME keysystem. // Callable only on GMP thread. GMPAudioDecoderProxy getGMPAudioDecoder(in TagArray tags, - [optional] in ACString nodeId); + [optional] in AString origin); // Returns a decryption session manager that supports the specified tags. // The array of tags should at least contain a key system tag, and optionally // other tags. // Callable only on GMP thread. - GMPDecryptorProxy getGMPDecryptor(in TagArray tags, in ACString nodeId); + GMPDecryptorProxy getGMPDecryptor(in TagArray tags, in AString origin); /** * Add a directory to scan for gecko media plugins. diff --git a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp index 9d92a7ce1e1d..4090249d065e 100644 --- a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp +++ b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp @@ -171,7 +171,7 @@ WebrtcGmpVideoEncoder::InitEncode_g(const webrtc::VideoCodec* aCodecSettings, nsTArray tags; tags.AppendElement(NS_LITERAL_CSTRING("h264")); if (NS_WARN_IF(NS_FAILED(mMPS->GetGMPVideoEncoder(&tags, - NS_LITERAL_CSTRING(""), + NS_LITERAL_STRING(""), &mHost, &mGMP)))) { mMPS = nullptr; @@ -255,7 +255,7 @@ WebrtcGmpVideoEncoder::Encode_g(const webrtc::I420VideoFrame* aInputImage, nsTArray tags; tags.AppendElement(NS_LITERAL_CSTRING("h264")); if (NS_WARN_IF(NS_FAILED(mMPS->GetGMPVideoEncoder(&tags, - NS_LITERAL_CSTRING(""), + NS_LITERAL_STRING(""), &mHost, &mGMP)))) { mGMP = nullptr; @@ -558,7 +558,7 @@ WebrtcGmpVideoDecoder::InitDecode_g(const webrtc::VideoCodec* aCodecSettings, nsTArray tags; tags.AppendElement(NS_LITERAL_CSTRING("h264")); if (NS_WARN_IF(NS_FAILED(mMPS->GetGMPVideoDecoder(&tags, - NS_LITERAL_CSTRING(""), + NS_LITERAL_STRING(""), &mHost, &mGMP)))) { mMPS = nullptr; diff --git a/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp b/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp index cfd591a71a06..af942cb66474 100644 --- a/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp +++ b/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp @@ -203,7 +203,7 @@ int VcmSIPCCBinding::getVideoCodecsGmp() // H.264 only for now bool has_gmp; nsresult rv; - rv = gSelf->mGMPService->HasPluginForAPI(NS_LITERAL_CSTRING(""), + rv = gSelf->mGMPService->HasPluginForAPI(NS_LITERAL_STRING(""), NS_LITERAL_CSTRING("encode-video"), &tags, &has_gmp); @@ -211,7 +211,7 @@ int VcmSIPCCBinding::getVideoCodecsGmp() return 0; } - rv = gSelf->mGMPService->HasPluginForAPI(NS_LITERAL_CSTRING(""), + rv = gSelf->mGMPService->HasPluginForAPI(NS_LITERAL_STRING(""), NS_LITERAL_CSTRING("decode-video"), &tags, &has_gmp);