back out 838e8168ea50 / Bug 689598 to allow backing out 8c075fee9be4 / Bug 704710
authorBenoit Jacob <bjacob@mozilla.com>
Thu, 08 Mar 2012 18:01:52 -0500
changeset 85550 544f5bc26164d05d42c708f05f716d278a94c569
parent 85549 d03bd265ed6c911f46e0b8f48537aaac2e05edd9
child 85551 2fccf5e774a79d3783d726975c4946551f969057
push id1
push usersledru@mozilla.com
push dateThu, 04 Dec 2014 17:57:20 +0000
bugs689598, 704710
milestone11.0
backs out838e8168ea50ac1403f4ccbb4fd88dc7ff25c15b
back out 838e8168ea50 / Bug 689598 to allow backing out 8c075fee9be4 / Bug 704710
widget/src/android/GfxInfo.cpp
widget/src/android/GfxInfo.h
--- a/widget/src/android/GfxInfo.cpp
+++ b/widget/src/android/GfxInfo.cpp
@@ -83,16 +83,18 @@ NS_IMETHODIMP
 GfxInfo::GetCleartypeParameters(nsAString & aCleartypeParams)
 {
   return NS_ERROR_FAILURE;
 }
 
 nsresult
 GfxInfo::Init()
 {
+  mSetCrashReportAnnotations = false;
+
   mAdapterDescription.AssignASCII(mozilla::gl::GetVendor());
   if (mozilla::AndroidBridge::Bridge()) {
     nsAutoString str;
 
     mAdapterDescription.Append(NS_LITERAL_STRING(", Model: '"));
     if (mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build", "MODEL", str)) {
       mAdapterDeviceID = str;
       mAdapterDescription.Append(str);
@@ -117,18 +119,16 @@ GfxInfo::Init()
         mAdapterDescription.Append(str);
       }
     }
 
     mAdapterDescription.Append(NS_LITERAL_STRING("'"));
     mAndroidSDKVersion = version;
   }
 
-  AddOpenGLCrashReportAnnotations();
-
   return GfxInfoBase::Init();
 }
 
 /* readonly attribute DOMString adapterDescription; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription)
 {
   aAdapterDescription = mAdapterDescription;
@@ -306,16 +306,21 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aF
   *aStatus = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
   OperatingSystem os = DRIVER_OS_ANDROID;
   if (aOS)
     *aOS = os;
 
   // Don't evaluate special cases when evaluating the downlaoded blocklist.
   if (!aDriverInfo.Length()) {
     if (aFeature == FEATURE_OPENGL_LAYERS) {
+      if (!mSetCrashReportAnnotations) {
+        AddOpenGLCrashReportAnnotations();
+        mSetCrashReportAnnotations = true;
+      }
+
       /* The following code is an old way to whitelist devices when we're ready.
        * It is staying here for reference. The best way to do this now is to add
        * an entry in the list above. There is a dummy entry which will whitelist a
        * device when uncommented and device/vendor IDs are inserted. It is
        * preferred that we stop whitelisting and instead go to blocklisting, where
        * everything is assumed to be okay as long as it's not in the blocklist. */
       // nsAutoString str;
       // /* Whitelist Galaxy S phones */
--- a/widget/src/android/GfxInfo.h
+++ b/widget/src/android/GfxInfo.h
@@ -86,16 +86,17 @@ protected:
                                         nsAString & aSuggestedDriverVersion, 
                                         const nsTArray<GfxDriverInfo>& aDriverInfo,
                                         OperatingSystem* aOS = nsnull);
   virtual const nsTArray<GfxDriverInfo>& GetGfxDriverInfo();
 
 private:
 
   void     AddOpenGLCrashReportAnnotations();
+  bool     mSetCrashReportAnnotations;
   nsString mRendererIDsString;
   nsString mAdapterRAMString;
 
   nsString mDeviceID;
   nsString mDriverVersion;
   nsString mDriverDate;
   nsString mDeviceKey;