Bug 1162530 - Part 2: We were not allowing webrtc to be blocklisted in the downloadable scenario at all, expicitly look for unknown OS, and some minor white space changes. r=jrmuizel
authorMilan Sreckovic <milan@mozilla.com>
Fri, 15 May 2015 10:42:10 -0400
changeset 244804 edb5b81dd9e76fb76c0a8d38e214c9593a0f9c0a
parent 244803 93fe551e8a557bc81c6798a8e4f494cfbb2d7fd6
child 244805 bcc398de6eda20470eddd21b8be2fcd8d61d09c7
push id13061
push userkwierso@gmail.com
push dateThu, 21 May 2015 01:32:04 +0000
treeherderfx-team@d0a72997ef97 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1162530
milestone41.0a1
Bug 1162530 - Part 2: We were not allowing webrtc to be blocklisted in the downloadable scenario at all, expicitly look for unknown OS, and some minor white space changes. r=jrmuizel
widget/GfxInfoBase.cpp
--- a/widget/GfxInfoBase.cpp
+++ b/widget/GfxInfoBase.cpp
@@ -141,16 +141,19 @@ GetPrefNameForFeature(int32_t aFeature)
       name = BLACKLIST_PREF_BRANCH "webgl.angle";
       break;
     case nsIGfxInfo::FEATURE_WEBGL_MSAA:
       name = BLACKLIST_PREF_BRANCH "webgl.msaa";
       break;
     case nsIGfxInfo::FEATURE_STAGEFRIGHT:
       name = BLACKLIST_PREF_BRANCH "stagefright";
       break;
+    case nsIGfxInfo::FEATURE_WEBRTC_HW_ACCELERATION:
+      name = BLACKLIST_PREF_BRANCH "webrtc.hw.acceleration";
+      break;
     default:
       break;
   };
 
   return name;
 }
 
 // Returns the value of the pref for the relevant feature in aValue.
@@ -327,16 +330,18 @@ BlacklistFeatureToGfxFeature(const nsASt
   else if (aFeature.EqualsLiteral("WEBGL_OPENGL"))
     return nsIGfxInfo::FEATURE_WEBGL_OPENGL;
   else if (aFeature.EqualsLiteral("WEBGL_ANGLE"))
     return nsIGfxInfo::FEATURE_WEBGL_ANGLE;
   else if (aFeature.EqualsLiteral("WEBGL_MSAA"))
     return nsIGfxInfo::FEATURE_WEBGL_MSAA;
   else if (aFeature.EqualsLiteral("STAGEFRIGHT"))
     return nsIGfxInfo::FEATURE_STAGEFRIGHT;
+  else if (aFeature.EqualsLiteral("WEBRTC_HW_ACCELERATION"))
+    return nsIGfxInfo::FEATURE_WEBRTC_HW_ACCELERATION;
   return 0;
 }
 
 static int32_t
 BlacklistFeatureStatusToGfxFeatureStatus(const nsAString& aStatus)
 {
   if (aStatus.EqualsLiteral("STATUS_OK"))
     return nsIGfxInfo::FEATURE_STATUS_OK;
@@ -670,21 +675,22 @@ GfxInfoBase::FindBlocklistedDeviceInList
                                          int32_t aFeature,
                                          OperatingSystem os)
 {
   int32_t status = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
 
   uint32_t i = 0;
   for (; i < info.Length(); i++) {
     // Do the operating system check first, no point in getting the driver
-    // info if we won't need to use it. Note that this also catches the
+    // info if we won't need to use it. Note we also catch and skips the
     // application version mismatches that would leave operating system
     // set to unknown.
-    if (info[i].mOperatingSystem != DRIVER_OS_ALL &&
-        info[i].mOperatingSystem != os)
+    if (info[i].mOperatingSystem == DRIVER_OS_UNKNOWN ||
+        (info[i].mOperatingSystem != DRIVER_OS_ALL &&
+         info[i].mOperatingSystem != os))
     {
       continue;
     }
 
     if (info[i].mOperatingSystemVersion && info[i].mOperatingSystemVersion != OperatingSystemVersion()) {
         continue;
     }
 
@@ -929,16 +935,17 @@ GfxInfoBase::EvaluateDownloadedBlacklist
     nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS,
     nsIGfxInfo::FEATURE_DIRECT3D_11_ANGLE,
     nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING,
     nsIGfxInfo::FEATURE_OPENGL_LAYERS,
     nsIGfxInfo::FEATURE_WEBGL_OPENGL,
     nsIGfxInfo::FEATURE_WEBGL_ANGLE,
     nsIGfxInfo::FEATURE_WEBGL_MSAA,
     nsIGfxInfo::FEATURE_STAGEFRIGHT,
+    nsIGfxInfo::FEATURE_WEBRTC_HW_ACCELERATION,
     0
   };
 
   // For every feature we know about, we evaluate whether this blacklist has a
   // non-STATUS_OK status. If it does, we set the pref we evaluate in
   // GetFeatureStatus above, so we don't need to hold on to this blacklist
   // anywhere permanent.
   int i = 0;
@@ -986,18 +993,18 @@ GfxInfoBase::LogFailure(const nsACString
 
   // By default, gfxCriticalError asserts; make it not assert in this case.
   gfxCriticalError(CriticalLog::DefaultOptions(false)) << "(LF) " << failure.BeginReading();
 }
 
 /* void getFailures (out unsigned long failureCount, [optional, array, size_is (failureCount)] out long indices, [array, size_is (failureCount), retval] out string failures); */
 /* XPConnect method of returning arrays is very ugly. Would not recommend. */
 NS_IMETHODIMP GfxInfoBase::GetFailures(uint32_t* failureCount,
-				       int32_t** indices,
-				       char ***failures)
+                                       int32_t** indices,
+                                       char ***failures)
 {
   MutexAutoLock lock(mMutex);
 
   NS_ENSURE_ARG_POINTER(failureCount);
   NS_ENSURE_ARG_POINTER(failures);
 
   *failures = nullptr;
   *failureCount = 0;
@@ -1038,17 +1045,17 @@ NS_IMETHODIMP GfxInfoBase::GetFailures(u
     uint32_t i=0;
     for(it = loggedStrings.begin() ; it != loggedStrings.end(); ++it, i++) {
       (*failures)[i] = (char*)nsMemory::Clone((*it).second.c_str(), (*it).second.size() + 1);
       if (indices) (*indices)[i] = (*it).first;
 
       if (!(*failures)[i]) {
         /* <sarcasm> I'm too afraid to use an inline function... </sarcasm> */
         NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(i, (*failures));
-	*failureCount = i;
+        *failureCount = i;
         return NS_ERROR_OUT_OF_MEMORY;
       }
     }
   }
 
   return NS_OK;
 }