Bug 1314445 - Remove GMPService::GetPluginVersionForAPI. r=gerald
authorChris Pearce <cpearce@mozilla.com>
Wed, 02 Nov 2016 11:57:14 +1300
changeset 320551 ce3ab5d4e29d7719e52a7130ebb91504f8bceddd
parent 320550 7fbf411102d8adb6453437ec38c489c7d33e31c8
child 320552 06b9f9ad45ab2c749718f35fcdc3eb4f8fbcb35f
push id33830
push usercpearce@mozilla.com
push dateWed, 02 Nov 2016 23:15:10 +0000
treeherderautoland@4eb93831e7d3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1314445
milestone52.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 1314445 - Remove GMPService::GetPluginVersionForAPI. r=gerald MozReview-Commit-ID: ybq6ZZlA9P
dom/media/gmp/GMPService.cpp
dom/media/gmp/GMPService.h
dom/media/gmp/GMPServiceChild.cpp
dom/media/gmp/GMPServiceChild.h
dom/media/gmp/GMPServiceParent.cpp
dom/media/gmp/GMPServiceParent.h
dom/media/gmp/mozIGeckoMediaPluginService.idl
--- a/dom/media/gmp/GMPService.cpp
+++ b/dom/media/gmp/GMPService.cpp
@@ -505,25 +505,16 @@ GeckoMediaPluginService::GetGMPDecryptor
                             *aTags,
                             Move(callback))) {
     return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
-GeckoMediaPluginService::HasPluginForAPI(const nsACString& aAPI,
-                                         nsTArray<nsCString>* aTags,
-                                         bool* aOutHavePlugin)
-{
-  nsCString unused;
-  return GetPluginVersionForAPI(aAPI, aTags, aOutHavePlugin, unused);
-}
-
 void
 GeckoMediaPluginService::ConnectCrashHelper(uint32_t aPluginId, GMPCrashHelper* aHelper)
 {
   if (!aHelper) {
     return;
   }
   MutexAutoLock lock(mMutex);
   nsTArray<RefPtr<GMPCrashHelper>>* helpers;
--- a/dom/media/gmp/GMPService.h
+++ b/dom/media/gmp/GMPService.h
@@ -64,18 +64,16 @@ public:
   static already_AddRefed<GeckoMediaPluginService> GetGeckoMediaPluginService();
 
   virtual nsresult Init();
 
   NS_DECL_THREADSAFE_ISUPPORTS
 
   // mozIGeckoMediaPluginService
   NS_IMETHOD GetThread(nsIThread** aThread) override;
-  NS_IMETHOD HasPluginForAPI(const nsACString& aAPI, nsTArray<nsCString>* aTags,
-                             bool *aRetVal) override;
   NS_IMETHOD GetGMPVideoDecoder(GMPCrashHelper* aHelper,
                                 nsTArray<nsCString>* aTags,
                                 const nsACString& aNodeId,
                                 UniquePtr<GetGMPVideoDecoderCallback>&& aCallback)
     override;
   NS_IMETHOD GetGMPVideoEncoder(GMPCrashHelper* aHelper,
                                 nsTArray<nsCString>* aTags,
                                 const nsACString& aNodeId,
--- a/dom/media/gmp/GMPServiceChild.cpp
+++ b/dom/media/gmp/GMPServiceChild.cpp
@@ -214,31 +214,29 @@ GeckoMediaPluginServiceChild::UpdateGMPC
   nsCOMPtr<nsIObserverService> obsService = mozilla::services::GetObserverService();
   MOZ_ASSERT(obsService);
   if (obsService) {
     obsService->NotifyObservers(nullptr, "gmp-changed", nullptr);
   }
 }
 
 NS_IMETHODIMP
-GeckoMediaPluginServiceChild::GetPluginVersionForAPI(const nsACString& aAPI,
-                                                     nsTArray<nsCString>* aTags,
-                                                     bool* aHasPlugin,
-                                                     nsACString& aOutVersion)
+GeckoMediaPluginServiceChild::HasPluginForAPI(const nsACString& aAPI,
+                                              nsTArray<nsCString>* aTags,
+                                              bool* aHasPlugin)
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (!sGMPCapabilities) {
     *aHasPlugin = false;
     return NS_OK;
   }
 
   nsCString api(aAPI);
   for (const GMPCapabilityAndVersion& plugin : *sGMPCapabilities) {
     if (GMPCapability::Supports(plugin.mCapabilities, api, *aTags)) {
-      aOutVersion = plugin.mVersion;
       *aHasPlugin = true;
       return NS_OK;
     }
   }
 
   *aHasPlugin = false;
   return NS_OK;
 }
--- a/dom/media/gmp/GMPServiceChild.h
+++ b/dom/media/gmp/GMPServiceChild.h
@@ -35,20 +35,19 @@ public:
 
 class GeckoMediaPluginServiceChild : public GeckoMediaPluginService
 {
   friend class GMPServiceChild;
 
 public:
   static already_AddRefed<GeckoMediaPluginServiceChild> GetSingleton();
 
-  NS_IMETHOD GetPluginVersionForAPI(const nsACString& aAPI,
-                                    nsTArray<nsCString>* aTags,
-                                    bool* aHasPlugin,
-                                    nsACString& aOutVersion) override;
+  NS_IMETHOD HasPluginForAPI(const nsACString& aAPI,
+                             nsTArray<nsCString>* aTags,
+                             bool *aRetVal) override;
   NS_IMETHOD GetNodeId(const nsAString& aOrigin,
                        const nsAString& aTopLevelOrigin,
                        const nsAString& aGMPName,
                        bool aInPrivateBrowsingMode,
                        UniquePtr<GetNodeIdCallback>&& aCallback) override;
 
   NS_DECL_NSIOBSERVER
 
--- a/dom/media/gmp/GMPServiceParent.cpp
+++ b/dom/media/gmp/GMPServiceParent.cpp
@@ -954,42 +954,35 @@ GeckoMediaPluginServiceParent::RemoveAnd
   MOZ_ASSERT(NS_IsMainThread());
   return GMPDispatch(
     new PathRunnable(this, aDirectory,
                      PathRunnable::EOperation::REMOVE_AND_DELETE_FROM_DISK,
                      aDefer));
 }
 
 NS_IMETHODIMP
-GeckoMediaPluginServiceParent::GetPluginVersionForAPI(const nsACString& aAPI,
-                                                      nsTArray<nsCString>* aTags,
-                                                      bool* aHasPlugin,
-                                                      nsACString& aOutVersion)
+GeckoMediaPluginServiceParent::HasPluginForAPI(const nsACString& aAPI,
+                                               nsTArray<nsCString>* aTags,
+                                               bool* aHasPlugin)
 {
   NS_ENSURE_ARG(aTags && aTags->Length() > 0);
   NS_ENSURE_ARG(aHasPlugin);
-  NS_ENSURE_ARG(aOutVersion.IsEmpty());
 
   nsresult rv = EnsurePluginsOnDiskScanned();
   if (NS_FAILED(rv)) {
     NS_WARNING("Failed to load GMPs from disk.");
     return rv;
   }
 
   {
     MutexAutoLock lock(mMutex);
     nsCString api(aAPI);
     size_t index = 0;
     RefPtr<GMPParent> gmp = FindPluginForAPIFrom(index, api, *aTags, &index);
-    if (gmp) {
-      *aHasPlugin = true;
-      aOutVersion = gmp->GetVersion();
-    } else {
-      *aHasPlugin = false;
-    }
+    *aHasPlugin = !!gmp;
   }
 
   return NS_OK;
 }
 
 nsresult
 GeckoMediaPluginServiceParent::EnsurePluginsOnDiskScanned()
 {
--- a/dom/media/gmp/GMPServiceParent.h
+++ b/dom/media/gmp/GMPServiceParent.h
@@ -33,20 +33,19 @@ public:
 
   GeckoMediaPluginServiceParent();
   nsresult Init() override;
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIASYNCSHUTDOWNBLOCKER
 
   // mozIGeckoMediaPluginService
-  NS_IMETHOD GetPluginVersionForAPI(const nsACString& aAPI,
-                                    nsTArray<nsCString>* aTags,
-                                    bool* aHasPlugin,
-                                    nsACString& aOutVersion) override;
+  NS_IMETHOD HasPluginForAPI(const nsACString& aAPI,
+                             nsTArray<nsCString>* aTags,
+                             bool *aRetVal) override;
   NS_IMETHOD GetNodeId(const nsAString& aOrigin,
                        const nsAString& aTopLevelOrigin,
                        const nsAString& aGMPName,
                        bool aInPrivateBrowsingMode,
                        UniquePtr<GetNodeIdCallback>&& aCallback) override;
 
   NS_DECL_MOZIGECKOMEDIAPLUGINCHROMESERVICE
   NS_DECL_NSIOBSERVER
--- a/dom/media/gmp/mozIGeckoMediaPluginService.idl
+++ b/dom/media/gmp/mozIGeckoMediaPluginService.idl
@@ -72,24 +72,16 @@ interface mozIGeckoMediaPluginService : 
   /**
    * Get a plugin that supports the specified tags.
    * Callable on any thread
    */
   [noscript]
   boolean hasPluginForAPI(in ACString api, in TagArray tags);
 
   /**
-   * Get the version of the plugin that supports the specified tags.
-   * Callable on any thread
-   */
-  [noscript]
-  void getPluginVersionForAPI(in ACString api, in TagArray tags,
-                              out boolean hasPlugin, out ACString version);
-
-  /**
    * Get a video decoder that supports the specified tags.
    * The array of tags should at least contain a codec tag, and optionally
    * other tags such as for EME keysystem.
    * Callable only on GMP thread.
    * This is an asynchronous operation, the Done method of the callback object
    * will be called on the GMP thread with the result (which might be null in
    * the case of failure). This method always takes ownership of the callback
    * object, but if this method returns an error then the Done method of the