mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1060179 - Percolate EME node id to EME child process. r=jesup
This commit is contained in:
parent
f2a222b010
commit
b469435ef0
@ -232,16 +232,25 @@ GMPChild::Init(const std::string& aPluginPath,
|
||||
SendPCrashReporterConstructor(CrashReporter::CurrentThreadId());
|
||||
#endif
|
||||
|
||||
#if defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
|
||||
mPluginPath = aPluginPath;
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
GMPChild::RecvSetNodeId(const nsCString& aNodeId)
|
||||
{
|
||||
// TODO: hash mNodeId with machine specific data.
|
||||
mNodeId = std::string(aNodeId.BeginReading(), aNodeId.EndReading());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
GMPChild::RecvStartPlugin()
|
||||
{
|
||||
#if defined(MOZ_SANDBOX) && defined(XP_WIN)
|
||||
mozilla::SandboxTarget::Instance()->StartSandbox();
|
||||
#endif
|
||||
|
||||
return LoadPluginLibrary(aPluginPath);
|
||||
return LoadPluginLibrary(mPluginPath);
|
||||
}
|
||||
|
||||
bool
|
||||
@ -399,7 +408,7 @@ GMPChild::DeallocPGMPVideoDecoderChild(PGMPVideoDecoderChild* aActor)
|
||||
PGMPDecryptorChild*
|
||||
GMPChild::AllocPGMPDecryptorChild()
|
||||
{
|
||||
GMPDecryptorChild* actor = new GMPDecryptorChild(this);
|
||||
GMPDecryptorChild* actor = new GMPDecryptorChild(this, mNodeId);
|
||||
actor->AddRef();
|
||||
return actor;
|
||||
}
|
||||
|
@ -47,6 +47,10 @@ public:
|
||||
void ShutdownComplete() MOZ_OVERRIDE;
|
||||
|
||||
private:
|
||||
|
||||
virtual bool RecvSetNodeId(const nsCString& aNodeId) MOZ_OVERRIDE;
|
||||
virtual bool RecvStartPlugin() MOZ_OVERRIDE;
|
||||
|
||||
virtual PCrashReporterChild* AllocPCrashReporterChild(const NativeThreadId& aThread) MOZ_OVERRIDE;
|
||||
virtual bool DeallocPCrashReporterChild(PCrashReporterChild*) MOZ_OVERRIDE;
|
||||
|
||||
@ -85,10 +89,11 @@ private:
|
||||
PRLibrary* mLib;
|
||||
GMPGetAPIFunc mGetAPIFunc;
|
||||
MessageLoop* mGMPMessageLoop;
|
||||
#if defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
|
||||
std::string mPluginPath;
|
||||
#if defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
|
||||
nsCString mPluginBinaryPath;
|
||||
#endif
|
||||
std::string mNodeId;
|
||||
};
|
||||
|
||||
} // namespace gmp
|
||||
|
@ -26,9 +26,10 @@
|
||||
namespace mozilla {
|
||||
namespace gmp {
|
||||
|
||||
GMPDecryptorChild::GMPDecryptorChild(GMPChild* aPlugin)
|
||||
GMPDecryptorChild::GMPDecryptorChild(GMPChild* aPlugin, const std::string& aNodeId)
|
||||
: mSession(nullptr)
|
||||
, mPlugin(aPlugin)
|
||||
, mNodeId(aNodeId)
|
||||
{
|
||||
MOZ_ASSERT(mPlugin);
|
||||
}
|
||||
@ -176,9 +177,8 @@ void
|
||||
GMPDecryptorChild::GetNodeId(const char** aOutNodeId,
|
||||
uint32_t* aOutNodeIdLength)
|
||||
{
|
||||
static const char* id = "placeholder_node_id";
|
||||
*aOutNodeId = id;
|
||||
*aOutNodeIdLength = strlen(id);
|
||||
*aOutNodeId = mNodeId.c_str();
|
||||
*aOutNodeIdLength = mNodeId.size();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "gmp-decryption.h"
|
||||
#include "mozilla/gmp/GMPTypes.h"
|
||||
#include "GMPEncryptedBufferDataImpl.h"
|
||||
#include <string>
|
||||
|
||||
namespace mozilla {
|
||||
namespace gmp {
|
||||
@ -23,7 +24,7 @@ class GMPDecryptorChild : public GMPDecryptorCallback
|
||||
public:
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GMPDecryptorChild);
|
||||
|
||||
explicit GMPDecryptorChild(GMPChild* aPlugin);
|
||||
explicit GMPDecryptorChild(GMPChild* aPlugin, const std::string& aNodeId);
|
||||
|
||||
void Init(GMPDecryptor* aSession);
|
||||
|
||||
@ -122,6 +123,8 @@ private:
|
||||
// Only call into this on the (GMP process) main thread.
|
||||
GMPDecryptor* mSession;
|
||||
GMPChild* mPlugin;
|
||||
|
||||
const std::string mNodeId;
|
||||
};
|
||||
|
||||
} // namespace gmp
|
||||
|
@ -150,6 +150,22 @@ GMPParent::LoadProcess()
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
LOGD(("%s::%s: Created new process %p", __CLASS__, __FUNCTION__, (void *)mProcess));
|
||||
|
||||
bool ok = SendSetNodeId(mNodeId);
|
||||
if (!ok) {
|
||||
mProcess->Delete();
|
||||
mProcess = nullptr;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
LOGD(("%s::%s: Failed to send node id %p", __CLASS__, __FUNCTION__, (void *)mProcess));
|
||||
|
||||
ok = SendStartPlugin();
|
||||
if (!ok) {
|
||||
mProcess->Delete();
|
||||
mProcess = nullptr;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
LOGD(("%s::%s: Failed to send start %p", __CLASS__, __FUNCTION__, (void *)mProcess));
|
||||
}
|
||||
|
||||
mState = GMPStateLoaded;
|
||||
|
@ -40,6 +40,8 @@ child:
|
||||
async PGMPVideoDecoder();
|
||||
async PGMPVideoEncoder();
|
||||
|
||||
async SetNodeId(nsCString nodeId);
|
||||
async StartPlugin();
|
||||
async BeginAsyncShutdown();
|
||||
async CrashPluginNow();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user