Backed out changeset 36c32cb1cbd3 (bug 1060179)

This commit is contained in:
Carsten "Tomcat" Book 2014-10-09 12:48:20 +02:00
parent e494cd1efa
commit 65c420ddac
6 changed files with 11 additions and 46 deletions

View File

@ -232,25 +232,16 @@ GMPChild::Init(const std::string& aPluginPath,
SendPCrashReporterConstructor(CrashReporter::CurrentThreadId()); SendPCrashReporterConstructor(CrashReporter::CurrentThreadId());
#endif #endif
#if defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
mPluginPath = aPluginPath; mPluginPath = aPluginPath;
return true; 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) #if defined(MOZ_SANDBOX) && defined(XP_WIN)
mozilla::SandboxTarget::Instance()->StartSandbox(); mozilla::SandboxTarget::Instance()->StartSandbox();
#endif #endif
return LoadPluginLibrary(mPluginPath);
return LoadPluginLibrary(aPluginPath);
} }
bool bool
@ -408,7 +399,7 @@ GMPChild::DeallocPGMPVideoDecoderChild(PGMPVideoDecoderChild* aActor)
PGMPDecryptorChild* PGMPDecryptorChild*
GMPChild::AllocPGMPDecryptorChild() GMPChild::AllocPGMPDecryptorChild()
{ {
GMPDecryptorChild* actor = new GMPDecryptorChild(this, mNodeId); GMPDecryptorChild* actor = new GMPDecryptorChild(this);
actor->AddRef(); actor->AddRef();
return actor; return actor;
} }

View File

@ -47,10 +47,6 @@ public:
void ShutdownComplete() MOZ_OVERRIDE; void ShutdownComplete() MOZ_OVERRIDE;
private: private:
virtual bool RecvSetNodeId(const nsCString& aNodeId) MOZ_OVERRIDE;
virtual bool RecvStartPlugin() MOZ_OVERRIDE;
virtual PCrashReporterChild* AllocPCrashReporterChild(const NativeThreadId& aThread) MOZ_OVERRIDE; virtual PCrashReporterChild* AllocPCrashReporterChild(const NativeThreadId& aThread) MOZ_OVERRIDE;
virtual bool DeallocPCrashReporterChild(PCrashReporterChild*) MOZ_OVERRIDE; virtual bool DeallocPCrashReporterChild(PCrashReporterChild*) MOZ_OVERRIDE;
@ -89,11 +85,10 @@ private:
PRLibrary* mLib; PRLibrary* mLib;
GMPGetAPIFunc mGetAPIFunc; GMPGetAPIFunc mGetAPIFunc;
MessageLoop* mGMPMessageLoop; MessageLoop* mGMPMessageLoop;
std::string mPluginPath;
#if defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX) #if defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
std::string mPluginPath;
nsCString mPluginBinaryPath; nsCString mPluginBinaryPath;
#endif #endif
std::string mNodeId;
}; };
} // namespace gmp } // namespace gmp

View File

@ -26,10 +26,9 @@
namespace mozilla { namespace mozilla {
namespace gmp { namespace gmp {
GMPDecryptorChild::GMPDecryptorChild(GMPChild* aPlugin, const std::string& aNodeId) GMPDecryptorChild::GMPDecryptorChild(GMPChild* aPlugin)
: mSession(nullptr) : mSession(nullptr)
, mPlugin(aPlugin) , mPlugin(aPlugin)
, mNodeId(aNodeId)
{ {
MOZ_ASSERT(mPlugin); MOZ_ASSERT(mPlugin);
} }
@ -177,8 +176,9 @@ void
GMPDecryptorChild::GetNodeId(const char** aOutNodeId, GMPDecryptorChild::GetNodeId(const char** aOutNodeId,
uint32_t* aOutNodeIdLength) uint32_t* aOutNodeIdLength)
{ {
*aOutNodeId = mNodeId.c_str(); static const char* id = "placeholder_node_id";
*aOutNodeIdLength = mNodeId.size(); *aOutNodeId = id;
*aOutNodeIdLength = strlen(id);
} }
void void

View File

@ -10,7 +10,6 @@
#include "gmp-decryption.h" #include "gmp-decryption.h"
#include "mozilla/gmp/GMPTypes.h" #include "mozilla/gmp/GMPTypes.h"
#include "GMPEncryptedBufferDataImpl.h" #include "GMPEncryptedBufferDataImpl.h"
#include <string>
namespace mozilla { namespace mozilla {
namespace gmp { namespace gmp {
@ -24,7 +23,7 @@ class GMPDecryptorChild : public GMPDecryptorCallback
public: public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GMPDecryptorChild); NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GMPDecryptorChild);
explicit GMPDecryptorChild(GMPChild* aPlugin, const std::string& aNodeId); explicit GMPDecryptorChild(GMPChild* aPlugin);
void Init(GMPDecryptor* aSession); void Init(GMPDecryptor* aSession);
@ -123,8 +122,6 @@ private:
// Only call into this on the (GMP process) main thread. // Only call into this on the (GMP process) main thread.
GMPDecryptor* mSession; GMPDecryptor* mSession;
GMPChild* mPlugin; GMPChild* mPlugin;
const std::string mNodeId;
}; };
} // namespace gmp } // namespace gmp

View File

@ -150,22 +150,6 @@ GMPParent::LoadProcess()
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
LOGD(("%s::%s: Created new process %p", __CLASS__, __FUNCTION__, (void *)mProcess)); 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; mState = GMPStateLoaded;

View File

@ -40,8 +40,6 @@ child:
async PGMPVideoDecoder(); async PGMPVideoDecoder();
async PGMPVideoEncoder(); async PGMPVideoEncoder();
async SetNodeId(nsCString nodeId);
async StartPlugin();
async BeginAsyncShutdown(); async BeginAsyncShutdown();
async CrashPluginNow(); async CrashPluginNow();
}; };