Backed out changeset 36c32cb1cbd3 (bug 1060179)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Thu, 09 Oct 2014 12:48:20 +0200
changeset 232773 2da7ce468fb6e90bfbbc7f7682dce0f9961b7986
parent 232772 039f888740aa14e1ebd1a22c4aa434a351794fc6
child 232774 43fde0b1183ccd1c3b975440d34f8f716a5b5c4d
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1060179
milestone35.0a1
backs out36c32cb1cbd3afdeec5ccee932affddc77db5e32
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 36c32cb1cbd3 (bug 1060179)
content/media/gmp/GMPChild.cpp
content/media/gmp/GMPChild.h
content/media/gmp/GMPDecryptorChild.cpp
content/media/gmp/GMPDecryptorChild.h
content/media/gmp/GMPParent.cpp
content/media/gmp/PGMP.ipdl
--- a/content/media/gmp/GMPChild.cpp
+++ b/content/media/gmp/GMPChild.cpp
@@ -227,35 +227,26 @@ GMPChild::Init(const std::string& aPlugi
   if (!Open(aChannel, aParentProcessHandle, aIOLoop)) {
     return false;
   }
 
 #ifdef MOZ_CRASHREPORTER
   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(mPluginPath);
+
+  return LoadPluginLibrary(aPluginPath);
 }
 
 bool
 GMPChild::LoadPluginLibrary(const std::string& aPluginPath)
 {
 #if defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
   nsAutoCString nativePath;
   nativePath.Assign(mPluginBinaryPath);
@@ -403,17 +394,17 @@ GMPChild::DeallocPGMPVideoDecoderChild(P
 {
   delete aActor;
   return true;
 }
 
 PGMPDecryptorChild*
 GMPChild::AllocPGMPDecryptorChild()
 {
-  GMPDecryptorChild* actor = new GMPDecryptorChild(this, mNodeId);
+  GMPDecryptorChild* actor = new GMPDecryptorChild(this);
   actor->AddRef();
   return actor;
 }
 
 bool
 GMPChild::DeallocPGMPDecryptorChild(PGMPDecryptorChild* aActor)
 {
   static_cast<GMPDecryptorChild*>(aActor)->Release();
--- a/content/media/gmp/GMPChild.h
+++ b/content/media/gmp/GMPChild.h
@@ -42,20 +42,16 @@ public:
 
   // GMPSharedMem
   virtual void CheckThread() MOZ_OVERRIDE;
 
   // GMPAsyncShutdownHost
   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;
 
   virtual PGMPVideoDecoderChild* AllocPGMPVideoDecoderChild() MOZ_OVERRIDE;
   virtual bool DeallocPGMPVideoDecoderChild(PGMPVideoDecoderChild* aActor) MOZ_OVERRIDE;
   virtual bool RecvPGMPVideoDecoderConstructor(PGMPVideoDecoderChild* aActor) MOZ_OVERRIDE;
 
   virtual PGMPVideoEncoderChild* AllocPGMPVideoEncoderChild() MOZ_OVERRIDE;
@@ -84,19 +80,18 @@ private:
 
   GMPAsyncShutdown* mAsyncShutdown;
   nsRefPtr<GMPTimerChild> mTimerChild;
   nsRefPtr<GMPStorageChild> mStorage;
 
   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
 } // namespace mozilla
 
 #endif // GMPChild_h_
--- a/content/media/gmp/GMPDecryptorChild.cpp
+++ b/content/media/gmp/GMPDecryptorChild.cpp
@@ -21,20 +21,19 @@
         FROM_HERE, NewRunnableMethod(this, &GMPDecryptorChild::_func, __VA_ARGS__) \
       ); \
     } \
   } while(false)
 
 namespace mozilla {
 namespace gmp {
 
-GMPDecryptorChild::GMPDecryptorChild(GMPChild* aPlugin, const std::string& aNodeId)
+GMPDecryptorChild::GMPDecryptorChild(GMPChild* aPlugin)
   : mSession(nullptr)
   , mPlugin(aPlugin)
-  , mNodeId(aNodeId)
 {
   MOZ_ASSERT(mPlugin);
 }
 
 GMPDecryptorChild::~GMPDecryptorChild()
 {
 }
 
@@ -172,18 +171,19 @@ GMPDecryptorChild::SetCapabilities(uint6
 {
   CALL_ON_GMP_THREAD(SendSetCaps, aCaps);
 }
 
 void
 GMPDecryptorChild::GetNodeId(const char** aOutNodeId,
                              uint32_t* aOutNodeIdLength)
 {
-  *aOutNodeId = mNodeId.c_str();
-  *aOutNodeIdLength = mNodeId.size();
+  static const char* id = "placeholder_node_id";
+  *aOutNodeId = id;
+  *aOutNodeIdLength = strlen(id);
 }
 
 void
 GMPDecryptorChild::GetSandboxVoucher(const uint8_t** aVoucher,
                                      uint8_t* aVoucherLength)
 {
   const char* voucher = "placeholder_sandbox_voucher.";
   *aVoucher = (uint8_t*)voucher;
--- a/content/media/gmp/GMPDecryptorChild.h
+++ b/content/media/gmp/GMPDecryptorChild.h
@@ -5,31 +5,30 @@
 
 #ifndef GMPDecryptorChild_h_
 #define GMPDecryptorChild_h_
 
 #include "mozilla/gmp/PGMPDecryptorChild.h"
 #include "gmp-decryption.h"
 #include "mozilla/gmp/GMPTypes.h"
 #include "GMPEncryptedBufferDataImpl.h"
-#include <string>
 
 namespace mozilla {
 namespace gmp {
 
 class GMPChild;
 
 class GMPDecryptorChild : public GMPDecryptorCallback
                         , public GMPDecryptorHost
                         , public PGMPDecryptorChild
 {
 public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GMPDecryptorChild);
 
-  explicit GMPDecryptorChild(GMPChild* aPlugin, const std::string& aNodeId);
+  explicit GMPDecryptorChild(GMPChild* aPlugin);
 
   void Init(GMPDecryptor* aSession);
 
   // GMPDecryptorCallback
   virtual void ResolveNewSessionPromise(uint32_t aPromiseId,
                                         const char* aSessionId,
                                         uint32_t aSessionIdLength) MOZ_OVERRIDE;
   virtual void ResolveLoadSessionPromise(uint32_t aPromiseId,
@@ -118,16 +117,14 @@ private:
                                         const nsTArray<uint8_t>& aServerCert) MOZ_OVERRIDE;
 
   virtual bool RecvDecryptingComplete() MOZ_OVERRIDE;
 
   // GMP's GMPDecryptor implementation.
   // Only call into this on the (GMP process) main thread.
   GMPDecryptor* mSession;
   GMPChild* mPlugin;
-
-  const std::string mNodeId;
 };
 
 } // namespace gmp
 } // namespace mozilla
 
 #endif // GMPDecryptorChild_h_
--- a/content/media/gmp/GMPParent.cpp
+++ b/content/media/gmp/GMPParent.cpp
@@ -145,32 +145,16 @@ GMPParent::LoadProcess()
 
     bool opened = Open(mProcess->GetChannel(), mProcess->GetChildProcessHandle());
     if (!opened) {
       mProcess->Delete();
       mProcess = nullptr;
       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;
 
   return NS_OK;
 }
 
 void
--- a/content/media/gmp/PGMP.ipdl
+++ b/content/media/gmp/PGMP.ipdl
@@ -35,16 +35,14 @@ parent:
   async AsyncShutdownRequired();
 
 child:
   async PGMPAudioDecoder();
   async PGMPDecryptor();
   async PGMPVideoDecoder();
   async PGMPVideoEncoder();
 
-  async SetNodeId(nsCString nodeId);
-  async StartPlugin();
   async BeginAsyncShutdown();
   async CrashPluginNow();
 };
 
 } // namespace gmp
 } // namespace mozilla