Bug 1296078 - Avoid passing nsCString objects to %s format string codes. r=gerald, a=lizzard
authorNathan Froyd <froydnj@gmail.com>
Thu, 18 Aug 2016 23:44:51 -0400
changeset 342472 93e0f3a1c48077af4ff85cb020d638af1def1e67
parent 342471 a20b8498eaa24cd219659bcba35efc61f61f5812
child 342473 ea34f05424a83bfffe6b0086a413892ae6b8a4c2
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald, lizzard
bugs1296078
milestone49.0
Bug 1296078 - Avoid passing nsCString objects to %s format string codes. r=gerald, a=lizzard
dom/media/platforms/wmf/WMFVideoMFTManager.cpp
--- a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
+++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
@@ -159,17 +159,17 @@ struct D3DDLLBlacklistingCache
   nsCString mBlacklistPref;
   // Non-empty if a blacklisted DLL was found.
   nsCString mBlacklistedDLL;
 };
 StaticAutoPtr<D3DDLLBlacklistingCache> sD3D11BlacklistingCache;
 StaticAutoPtr<D3DDLLBlacklistingCache> sD3D9BlacklistingCache;
 
 // If a blacklisted DLL is found, return its information, otherwise "".
-static const nsACString&
+static const nsCString&
 FindDXVABlacklistedDLL(StaticAutoPtr<D3DDLLBlacklistingCache>& aDLLBlacklistingCache,
                        const char* aDLLBlacklistPrefName)
 {
   NS_ASSERTION(NS_IsMainThread(), "Must be on main thread.");
 
   if (!aDLLBlacklistingCache) {
     // First time here, create persistent data that will be reused in all
     // D3D11-blacklisting checks.
@@ -273,23 +273,23 @@ FindDXVABlacklistedDLL(StaticAutoPtr<D3D
     }
   }
 
   // No blacklisted DLL.
   aDLLBlacklistingCache->mBlacklistedDLL.SetLength(0);
   return aDLLBlacklistingCache->mBlacklistedDLL;
 }
 
-static const nsACString&
+static const nsCString&
 FindD3D11BlacklistedDLL() {
   return FindDXVABlacklistedDLL(sD3D11BlacklistingCache,
                                 "media.wmf.disable-d3d11-for-dlls");
 }
 
-static const nsACString&
+static const nsCString&
 FindD3D9BlacklistedDLL() {
   return FindDXVABlacklistedDLL(sD3D9BlacklistingCache,
                                 "media.wmf.disable-d3d9-for-dlls");
 }
 
 class CreateDXVAManagerEvent : public Runnable {
 public:
   CreateDXVAManagerEvent(LayersBackend aBackend, nsCString& aFailureReason)
@@ -298,36 +298,36 @@ public:
   {}
 
   NS_IMETHOD Run() {
     NS_ASSERTION(NS_IsMainThread(), "Must be on main thread.");
     nsACString* failureReason = &mFailureReason;
     nsCString secondFailureReason;
     if (mBackend == LayersBackend::LAYERS_D3D11 &&
         MediaPrefs::PDMWMFAllowD3D11() && IsWin8OrLater()) {
-      const nsACString& blacklistedDLL = FindD3D11BlacklistedDLL();
+      const nsCString& blacklistedDLL = FindD3D11BlacklistedDLL();
       if (!blacklistedDLL.IsEmpty()) {
         failureReason->AppendPrintf("D3D11 blacklisted with DLL %s",
-                                    blacklistedDLL);
+                                    blacklistedDLL.get());
       } else {
         mDXVA2Manager = DXVA2Manager::CreateD3D11DXVA(*failureReason);
         if (mDXVA2Manager) {
           return NS_OK;
         }
       }
       // Try again with d3d9, but record the failure reason
       // into a new var to avoid overwriting the d3d11 failure.
       failureReason = &secondFailureReason;
       mFailureReason.Append(NS_LITERAL_CSTRING("; "));
     }
 
-    const nsACString& blacklistedDLL = FindD3D9BlacklistedDLL();
+    const nsCString& blacklistedDLL = FindD3D9BlacklistedDLL();
     if (!blacklistedDLL.IsEmpty()) {
       mFailureReason.AppendPrintf("D3D9 blacklisted with DLL %s",
-                                  blacklistedDLL);
+                                  blacklistedDLL.get());
     } else {
       mDXVA2Manager = DXVA2Manager::CreateD3D9DXVA(*failureReason);
       // Make sure we include the messages from both attempts (if applicable).
       mFailureReason.Append(secondFailureReason);
     }
     return NS_OK;
   }
   nsAutoPtr<DXVA2Manager> mDXVA2Manager;