Backout 7a6b39895ac2 and 7cb727e67531 to potentially be replaced with better solution. r=backout
authorStephen A Pohl <spohl.mozilla.bugs@gmail.com>
Tue, 17 Oct 2017 15:46:01 -0400
changeset 386684 7ae1c0108e987e22160b5de706eae128f18ef75a
parent 386683 f3fcdeba5f882d9c7f0c4f468da9beb66dc7e657
child 386685 cb8c65940190581eb878f9999ae71a50d9fec873
push id96293
push userspohl@mozilla.com
push dateTue, 17 Oct 2017 19:46:20 +0000
treeherdermozilla-inbound@7ae1c0108e98 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
milestone58.0a1
backs out7a6b39895ac2393514d2fba5cb60d0e2b9c47c72
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
Backout 7a6b39895ac2 and 7cb727e67531 to potentially be replaced with better solution. r=backout
toolkit/components/telemetry/TelemetryEnvironment.jsm
toolkit/components/telemetry/docs/data/environment.rst
toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
xpcom/base/nsSystemInfo.cpp
--- a/toolkit/components/telemetry/TelemetryEnvironment.jsm
+++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm
@@ -1661,17 +1661,16 @@ EnvironmentCache.prototype = {
 
     let data = {
       memoryMB,
       virtualMaxMB: virtualMB,
       cpu: this._getCpuData(),
       os: this._getOSData(),
       hdd: this._getHDDData(),
       gfx: this._getGFXData(),
-      hasTouchbar: getSysinfoProperty("hasTouchbar", false),
     };
 
     if (AppConstants.platform === "win") {
       data.isWow64 = getSysinfoProperty("isWow64", null);
     } else if (AppConstants.platform == "android") {
       data.device = this._getDeviceData();
     }
 
--- a/toolkit/components/telemetry/docs/data/environment.rst
+++ b/toolkit/components/telemetry/docs/data/environment.rst
@@ -198,17 +198,16 @@ Structure:
               gpuProcess: { // Out-of-process compositing ("GPU process") feature
                 status: <string>, // "Available" means currently in use
               },
               advancedLayers: { // Advanced Layers compositing. Only present if D3D11 enabled.
                 status: <string>,    // See the status codes above.
               },
             },
           },
-        hasTouchbar: <bool>, // Mac only
       },
       addons: {
         activeAddons: { // the currently enabled add-ons
           <addon id>: {
             blocklisted: <bool>,
             description: <string>, // null if not available
             name: <string>,
             userDisabled: <bool>,
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
@@ -655,21 +655,16 @@ function checkSystemSection(data) {
     }
 
     let features = gfxInfo.getFeatures();
     Assert.equal(features.compositor, gfxData.features.compositor);
     Assert.equal(features.gpuProcess.status, gfxData.features.gpuProcess.status);
     Assert.equal(features.opengl, gfxData.features.opengl);
     Assert.equal(features.webgl, gfxData.features.webgl);
   } catch (e) {}
-
-  if (gIsMac) {
-    Assert.equal(typeof data.system.hasTouchbar, "boolean",
-      "hasTouchbar must be available on Mac and have the correct type.");
-  }
 }
 
 function checkActiveAddon(data, partialRecord) {
   let signedState = mozinfo.addon_signing ? "number" : "undefined";
   // system add-ons have an undefined signState
   if (data.isSystem)
     signedState = "undefined";
 
--- a/xpcom/base/nsSystemInfo.cpp
+++ b/xpcom/base/nsSystemInfo.cpp
@@ -675,32 +675,16 @@ nsSystemInfo::Init()
 #endif
 
 #if defined(XP_MACOSX)
   nsAutoString countryCode;
   if (NS_SUCCEEDED(GetSelectedCityInfo(countryCode))) {
     rv = SetPropertyAsAString(NS_LITERAL_STRING("countryCode"), countryCode);
     NS_ENSURE_SUCCESS(rv, rv);
   }
-
-  bool hasTouchbar = false;
-  len = 0;
-  sysctlbyname("hw.model", nullptr, &len, nullptr, 0);
-  if (len) {
-    char* model = (char*)malloc(len * sizeof(char));
-    sysctlbyname("hw.model", model, &len, nullptr, 0);
-    if (strcmp(model, "MacBookPro13,2") == 0 || // i5, late-2016
-        strcmp(model, "MacBookPro13,3") == 0 || // i7, late-2016
-        strcmp(model, "MacBookPro14,2") == 0 || // i5, mid-2017
-        strcmp(model, "MacBookPro14,3") == 0) { // i7, mid-2017
-      hasTouchbar = true;
-    }
-    free(model);
-  }
-  SetPropertyAsBool(NS_LITERAL_STRING("hasTouchbar"), hasTouchbar);
 #endif
 
 #if defined(MOZ_WIDGET_GTK)
   // This must be done here because NSPR can only separate OS's when compiled, not libraries.
   // 64 bytes is going to be well enough for "GTK " followed by 3 integers
   // separated with dots.
   char gtkver[64];
   ssize_t gtkver_len = 0;