From 6a05ae4b9196991fe54d21ae630d599481a09331 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Fri, 10 Mar 2017 17:32:04 +0100 Subject: [PATCH] fixup! Bug #4234: Use the Firefox Update Process for Tor Browser. Bug 19316: add support for a minInstructionSet attribute in the update manifests. --- toolkit/mozapps/update/nsUpdateService.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/toolkit/mozapps/update/nsUpdateService.js b/toolkit/mozapps/update/nsUpdateService.js index 4ad5bb8..2157a6a 100644 --- a/toolkit/mozapps/update/nsUpdateService.js +++ b/toolkit/mozapps/update/nsUpdateService.js @@ -1505,12 +1505,23 @@ function Update(update) { if (update.hasAttribute("unsupported")) { this.unsupported = ("true" == update.getAttribute("unsupported")); - } else if (update.hasAttribute("minSupportedOSVersion")) { - let minOSVersion = update.getAttribute("minSupportedOSVersion"); - try { - let osVersion = Services.sysinfo.getProperty("version"); - this.unsupported = (Services.vc.compare(osVersion, minOSVersion) < 0); - } catch (e) {} + } else { + if (update.hasAttribute("minSupportedOSVersion")) { + let minOSVersion = update.getAttribute("minSupportedOSVersion"); + try { + let osVersion = Services.sysinfo.getProperty("version"); + this.unsupported = (Services.vc.compare(osVersion, minOSVersion) < 0); + } catch (e) {} + } + if (update.hasAttribute("minSupportedHasSSE2")) { + let minInstructionSet = update.getAttribute("minInstructionSet"); + if (['MMX', 'SSE', 'SSE2', 'SSE3', + 'SSE4A', 'SSE4_1', 'SSE4_2'].indexOf(minInstructionSet) >= 0) { + try { + this.unsupported &= Services.sysinfo.getProperty("has" + minInstructionSet); + } catch (e) {} + } + } } if (this._patches.length == 0 && !this.unsupported) {