Bug 1415401 - Part1 - Make GetGMPContentParentPromise rejection function accept MediaResult. r=cpearce
authorJames Cheng <jacheng@mozilla.com>
Thu, 09 Nov 2017 17:21:59 +0800
changeset 444499 3bb73026fa8aa5f1ef018177a718cd986e870ea0
parent 444498 a4f05c8137abb4788c13e8aadd855135fe18579b
child 444500 9b7bc3899fc18798057e38f817329b01e2e5d9fe
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1415401
milestone58.0a1
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
Bug 1415401 - Part1 - Make GetGMPContentParentPromise rejection function accept MediaResult. r=cpearce MozReview-Commit-ID: CdDFgkDSomW
dom/media/gmp/GMPService.cpp
dom/media/gmp/GMPService.h
--- a/dom/media/gmp/GMPService.cpp
+++ b/dom/media/gmp/GMPService.cpp
@@ -263,20 +263,20 @@ GeckoMediaPluginService::GetCDM(const No
                holder->Reject(MediaResult(NS_ERROR_FAILURE, reason.get()), __func__);
                return;
              }
              if (helper) {
                cdm->SetCrashHelper(helper);
              }
              holder->Resolve(cdm, __func__);
            },
-           [rawHolder] {
+           [rawHolder](MediaResult result) {
              nsPrintfCString reason(
-               "%s::%s failed since GetContentParent rejects the promise.",
-               __CLASS__, __FUNCTION__);
+               "%s::%s failed since GetContentParent rejects the promise with reason %s.",
+               __CLASS__, __FUNCTION__, result.Description().get());
              UniquePtr<PromiseHolder> holder(rawHolder);
              holder->Reject(MediaResult(NS_ERROR_FAILURE, reason.get()), __func__);
            });
 
   return promise;
 }
 
 void
--- a/dom/media/gmp/GMPService.h
+++ b/dom/media/gmp/GMPService.h
@@ -48,17 +48,17 @@ struct NodeId
   {
   }
   nsString mOrigin;
   nsString mTopLevelOrigin;
   nsString mGMPName;
 };
 
 typedef MozPromise<RefPtr<GMPContentParent::CloseBlocker>,
-                   nsresult,
+                   MediaResult,
                    /* IsExclusive = */ true>
   GetGMPContentParentPromise;
 typedef MozPromise<RefPtr<ChromiumCDMParent>,
                    MediaResult,
                    /* IsExclusive = */ true>
   GetCDMParentPromise;
 
 class GeckoMediaPluginService : public mozIGeckoMediaPluginService