Backed out changeset d37ccbbcd36d (bug 1522951) for Android build bustages on MediaDrmCDMProxy.h CLOSED TREE
authorarthur.iakab <aiakab@mozilla.com>
Thu, 31 Jan 2019 22:42:35 +0200
changeset 456305 cc1c59ce9077f7dfc1be30282a09a6ba6d75b234
parent 456304 e39bd319fe3e2d8e310467fa65bc2a8eab398992
child 456306 4c2502aad681fd64109c6a218e5e3f85a60f6208
push id77229
push useraiakab@mozilla.com
push dateThu, 31 Jan 2019 20:43:01 +0000
treeherderautoland@cc1c59ce9077 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1522951
milestone67.0a1
backs outd37ccbbcd36df177e86dd3a6d7cdf5a355fa8245
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 d37ccbbcd36d (bug 1522951) for Android build bustages on MediaDrmCDMProxy.h CLOSED TREE
dom/media/eme/CDMProxy.h
dom/media/eme/MediaKeys.cpp
dom/media/gmp/ChromiumCDMProxy.cpp
dom/media/gmp/ChromiumCDMProxy.h
--- a/dom/media/eme/CDMProxy.h
+++ b/dom/media/eme/CDMProxy.h
@@ -88,18 +88,18 @@ class CDMProxy {
         mCapabilites("CDMProxy::mCDMCaps"),
         mDistinctiveIdentifierRequired(aDistinctiveIdentifierRequired),
         mPersistentStateRequired(aPersistentStateRequired),
         mMainThread(aMainThread) {}
 
   // Main thread only.
   // Loads the CDM corresponding to mKeySystem.
   // Calls MediaKeys::OnCDMCreated() when the CDM is created.
-  virtual void Init(RefPtr<GMPCrashHelper>&& aCrashHelper, PromiseId aPromiseId,
-                    const nsAString& aOrigin, const nsAString& aTopLevelOrigin,
+  virtual void Init(PromiseId aPromiseId, const nsAString& aOrigin,
+                    const nsAString& aTopLevelOrigin,
                     const nsAString& aName) = 0;
 
   virtual void OnSetDecryptorId(uint32_t aId) {}
 
   // Main thread only.
   // Uses the CDM to create a key session.
   // Calls MediaKeys::OnSessionActivated() when session is created.
   // Assumes ownership of (std::move()s) aInitData's contents.
--- a/dom/media/eme/MediaKeys.cpp
+++ b/dom/media/eme/MediaKeys.cpp
@@ -315,17 +315,17 @@ already_AddRefed<CDMProxy> MediaKeys::Cr
         this, mKeySystem,
         mConfig.mDistinctiveIdentifier == MediaKeysRequirement::Required,
         mConfig.mPersistentState == MediaKeysRequirement::Required,
         aMainThread);
   } else
 #endif
   {
     proxy = new ChromiumCDMProxy(
-        this, mKeySystem,
+        this, mKeySystem, new MediaKeysGMPCrashHelper(this),
         mConfig.mDistinctiveIdentifier == MediaKeysRequirement::Required,
         mConfig.mPersistentState == MediaKeysRequirement::Required,
         aMainThread);
   }
   return proxy.forget();
 }
 
 already_AddRefed<DetailedPromise> MediaKeys::Init(ErrorResult& aRv) {
@@ -403,20 +403,19 @@ already_AddRefed<DetailedPromise> MediaK
   // we're waiting for the promise to be resolved, so we must hold a
   // reference to the new MediaKeys object until it's been created,
   // or its creation has failed. Store the id of the promise returned
   // here, and hold a self-reference until that promise is resolved or
   // rejected.
   MOZ_ASSERT(!mCreatePromiseId, "Should only be created once!");
   mCreatePromiseId = StorePromise(promise);
   AddRef();
-  RefPtr<MediaKeysGMPCrashHelper> helper = new MediaKeysGMPCrashHelper(this);
-  mProxy->Init(
-      std::move(helper), mCreatePromiseId, NS_ConvertUTF8toUTF16(origin),
-      NS_ConvertUTF8toUTF16(topLevelOrigin), KeySystemToGMPName(mKeySystem));
+  mProxy->Init(mCreatePromiseId, NS_ConvertUTF8toUTF16(origin),
+               NS_ConvertUTF8toUTF16(topLevelOrigin),
+               KeySystemToGMPName(mKeySystem));
 
   return promise.forget();
 }
 
 void MediaKeys::OnCDMCreated(PromiseId aId, const uint32_t aPluginId) {
   RefPtr<DetailedPromise> promise(RetrievePromise(aId));
   if (!promise) {
     return;
--- a/dom/media/gmp/ChromiumCDMProxy.cpp
+++ b/dom/media/gmp/ChromiumCDMProxy.cpp
@@ -14,31 +14,32 @@
 #include "content_decryption_module.h"
 
 #define NS_DispatchToMainThread(...) CompileError_UseAbstractMainThreadInstead
 
 namespace mozilla {
 
 ChromiumCDMProxy::ChromiumCDMProxy(dom::MediaKeys* aKeys,
                                    const nsAString& aKeySystem,
+                                   GMPCrashHelper* aCrashHelper,
                                    bool aDistinctiveIdentifierRequired,
                                    bool aPersistentStateRequired,
                                    nsIEventTarget* aMainThread)
     : CDMProxy(aKeys, aKeySystem, aDistinctiveIdentifierRequired,
                aPersistentStateRequired, aMainThread),
+      mCrashHelper(aCrashHelper),
       mCDMMutex("ChromiumCDMProxy"),
       mGMPThread(GetGMPAbstractThread()) {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_COUNT_CTOR(ChromiumCDMProxy);
 }
 
 ChromiumCDMProxy::~ChromiumCDMProxy() { MOZ_COUNT_DTOR(ChromiumCDMProxy); }
 
-void ChromiumCDMProxy::Init(RefPtr<GMPCrashHelper>&& aCrashHelper,
-                            PromiseId aPromiseId, const nsAString& aOrigin,
+void ChromiumCDMProxy::Init(PromiseId aPromiseId, const nsAString& aOrigin,
                             const nsAString& aTopLevelOrigin,
                             const nsAString& aGMPName) {
   MOZ_ASSERT(NS_IsMainThread());
   NS_ENSURE_TRUE_VOID(!mKeys.IsNull());
 
   EME_LOG(
       "ChromiumCDMProxy::Init (pid=%u, origin=%s, topLevelOrigin=%s, gmp=%s)",
       aPromiseId, NS_ConvertUTF16toUTF8(aOrigin).get(),
@@ -56,17 +57,17 @@ void ChromiumCDMProxy::Init(RefPtr<GMPCr
     RejectPromise(aPromiseId, NS_ERROR_DOM_INVALID_STATE_ERR,
                   nsPrintfCString("Unknown GMP for keysystem '%s'",
                                   NS_ConvertUTF16toUTF8(mKeySystem).get()));
     return;
   }
 
   gmp::NodeId nodeId(aOrigin, aTopLevelOrigin, aGMPName);
   RefPtr<AbstractThread> thread = mGMPThread;
-  RefPtr<GMPCrashHelper> helper(std::move(aCrashHelper));
+  RefPtr<GMPCrashHelper> helper(mCrashHelper);
   RefPtr<ChromiumCDMProxy> self(this);
   nsCString keySystem = NS_ConvertUTF16toUTF8(mKeySystem);
   RefPtr<Runnable> task(NS_NewRunnableFunction(
       "ChromiumCDMProxy::Init",
       [self, nodeId, helper, aPromiseId, thread, keySystem]() -> void {
         MOZ_ASSERT(self->IsOnOwnerThread());
 
         RefPtr<gmp::GeckoMediaPluginService> service =
--- a/dom/media/gmp/ChromiumCDMProxy.h
+++ b/dom/media/gmp/ChromiumCDMProxy.h
@@ -16,21 +16,22 @@ namespace mozilla {
 class MediaRawData;
 class DecryptJob;
 class ChromiumCDMCallbackProxy;
 class ChromiumCDMProxy : public CDMProxy {
  public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ChromiumCDMProxy, override)
 
   ChromiumCDMProxy(dom::MediaKeys* aKeys, const nsAString& aKeySystem,
+                   GMPCrashHelper* aCrashHelper,
                    bool aAllowDistinctiveIdentifier, bool aAllowPersistentState,
                    nsIEventTarget* aMainThread);
 
-  void Init(RefPtr<GMPCrashHelper>&& aCrashHelper, PromiseId aPromiseId,
-            const nsAString& aOrigin, const nsAString& aTopLevelOrigin,
+  void Init(PromiseId aPromiseId, const nsAString& aOrigin,
+            const nsAString& aTopLevelOrigin,
             const nsAString& aGMPName) override;
 
   void CreateSession(uint32_t aCreateSessionToken,
                      dom::MediaKeySessionType aSessionType,
                      PromiseId aPromiseId, const nsAString& aInitDataType,
                      nsTArray<uint8_t>& aInitData) override;
 
   void LoadSession(PromiseId aPromiseId, dom::MediaKeySessionType aSessionType,
@@ -105,16 +106,18 @@ class ChromiumCDMProxy : public CDMProxy
   void OnResolvePromiseWithKeyStatus(uint32_t aPromiseId,
                                      dom::MediaKeyStatus aKeyStatus);
 
  private:
   void OnCDMCreated(uint32_t aPromiseId);
 
   ~ChromiumCDMProxy();
 
+  GMPCrashHelper* mCrashHelper;
+
   Mutex mCDMMutex;
   RefPtr<gmp::ChromiumCDMParent> mCDM;
   RefPtr<AbstractThread> mGMPThread;
   UniquePtr<ChromiumCDMCallbackProxy> mCallback;
 };
 
 }  // namespace mozilla