summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/palemoon/base/content/browser.js1
-rw-r--r--dom/base/DOMIntersectionObserver.cpp3
-rw-r--r--dom/xslt/base/txURIUtils.cpp4
-rw-r--r--js/src/builtin/Array.js108
-rw-r--r--js/src/builtin/String.js12
-rw-r--r--js/src/builtin/SymbolObject.cpp29
-rw-r--r--js/src/builtin/SymbolObject.h4
-rw-r--r--js/src/jsarray.cpp7
-rw-r--r--js/src/jsstr.cpp16
-rw-r--r--js/src/jsstr.h4
-rw-r--r--js/src/tests/ecma_6/Array/unscopables.js2
-rw-r--r--js/src/vm/CommonPropertyNames.h2
-rw-r--r--js/src/vm/SelfHosting.cpp6
-rw-r--r--js/xpconnect/tests/chrome/test_xrayToJS.xul2
-rw-r--r--toolkit/mozapps/update/UpdateTelemetry.jsm488
-rw-r--r--toolkit/mozapps/update/content/updates.js14
-rw-r--r--toolkit/mozapps/update/moz.build4
-rw-r--r--toolkit/mozapps/update/nsUpdateService.js230
-rw-r--r--tools/lint/eslint/modules.json1
-rw-r--r--widget/cocoa/nsNativeThemeCocoa.mm5
20 files changed, 184 insertions, 758 deletions
diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js
index 3f8a584bf..cc362d23f 100644
--- a/application/palemoon/base/content/browser.js
+++ b/application/palemoon/base/content/browser.js
@@ -4481,7 +4481,6 @@ nsBrowserAccess.prototype = {
}
let loadInBackground = gPrefService.getBoolPref("browser.tabs.loadDivertedInBackground");
- let referrer = aOpener ? makeURI(aOpener.location.href) : null;
let tab = win.gBrowser.loadOneTab(aURI ? aURI.spec : "about:blank", {
triggeringPrincipal: triggeringPrincipal,
diff --git a/dom/base/DOMIntersectionObserver.cpp b/dom/base/DOMIntersectionObserver.cpp
index 389b93071..70b5534ba 100644
--- a/dom/base/DOMIntersectionObserver.cpp
+++ b/dom/base/DOMIntersectionObserver.cpp
@@ -339,6 +339,7 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
for (size_t i = 0; i < mObservationTargets.Length(); ++i) {
Element* target = mObservationTargets.ElementAt(i);
nsIFrame* targetFrame = target->GetPrimaryFrame();
+ nsIFrame* originalTargetFrame = targetFrame;
nsRect targetRect;
Maybe<nsRect> intersectionRect;
bool isSameDoc = root && root->GetComposedDoc() == target->GetComposedDoc();
@@ -424,7 +425,7 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
);
if (intersectionRect.isSome() && !isSameDoc) {
nsRect rect = intersectionRect.value();
- nsPresContext* presContext = targetFrame->PresContext();
+ nsPresContext* presContext = originalTargetFrame->PresContext();
nsLayoutUtils::TransformRect(rootFrame,
presContext->PresShell()->GetRootScrollFrame(), rect);
intersectionRect = Some(rect);
diff --git a/dom/xslt/base/txURIUtils.cpp b/dom/xslt/base/txURIUtils.cpp
index 3f3556f80..bce2f8d0f 100644
--- a/dom/xslt/base/txURIUtils.cpp
+++ b/dom/xslt/base/txURIUtils.cpp
@@ -45,6 +45,10 @@ void URIUtils::resolveHref(const nsAString& href, const nsAString& base,
void
URIUtils::ResetWithSource(nsIDocument *aNewDoc, nsINode *aSourceNode)
{
+ if (!aSourceNode) {
+ return;
+ }
+
nsCOMPtr<nsIDocument> sourceDoc = aSourceNode->OwnerDoc();
nsIPrincipal* sourcePrincipal = sourceDoc->NodePrincipal();
diff --git a/js/src/builtin/Array.js b/js/src/builtin/Array.js
index 30e6fb35f..05fc41bc1 100644
--- a/js/src/builtin/Array.js
+++ b/js/src/builtin/Array.js
@@ -1073,6 +1073,114 @@ function ArrayConcat(arg1) {
return A;
}
+// https://tc39.github.io/proposal-flatMap/
+// January 4, 2019
+function ArrayFlatMap(mapperFunction/*, thisArg*/) {
+ // Step 1.
+ var O = ToObject(this);
+
+ // Step 2.
+ var sourceLen = ToLength(O.length);
+
+ // Step 3.
+ if (!IsCallable(mapperFunction))
+ ThrowTypeError(JSMSG_NOT_FUNCTION, DecompileArg(0, mapperFunction));
+
+ // Step 4.
+ var T = arguments.length > 1 ? arguments[1] : undefined;
+
+ // Step 5.
+ var A = ArraySpeciesCreate(O, 0);
+
+ // Step 6.
+ FlattenIntoArray(A, O, sourceLen, 0, 1, mapperFunction, T);
+
+ // Step 7.
+ return A;
+}
+
+// https://tc39.github.io/proposal-flatMap/
+// January 4, 2019
+function ArrayFlat(/* depth */) {
+ // Step 1.
+ var O = ToObject(this);
+
+ // Step 2.
+ var sourceLen = ToLength(O.length);
+
+ // Step 3.
+ var depthNum = 1;
+
+ // Step 4.
+ if (arguments.length > 0 && arguments[0] !== undefined)
+ depthNum = ToInteger(arguments[0]);
+
+ // Step 5.
+ var A = ArraySpeciesCreate(O, 0);
+
+ // Step 6.
+ FlattenIntoArray(A, O, sourceLen, 0, depthNum);
+
+ // Step 7.
+ return A;
+}
+
+// https://tc39.github.io/proposal-flatMap/
+// January 4, 2019
+function FlattenIntoArray(target, source, sourceLen, start, depth, mapperFunction, thisArg) {
+ // Step 1.
+ var targetIndex = start;
+
+ // Steps 2-3.
+ for (var sourceIndex = 0; sourceIndex < sourceLen; sourceIndex++) {
+ // Steps 3.a-c.
+ if (sourceIndex in source) {
+ // Step 3.c.i.
+ var element = source[sourceIndex];
+
+ if (mapperFunction) {
+ // Step 3.c.ii.1.
+ assert(arguments.length === 7, "thisArg is present");
+
+ // Step 3.c.ii.2.
+ element = callContentFunction(mapperFunction, thisArg, element, sourceIndex, source);
+ }
+
+ // Step 3.c.iii.
+ var shouldFlatten = false;
+
+ // Step 3.c.iv.
+ if (depth > 0) {
+ // Step 3.c.iv.1.
+ shouldFlatten = IsArray(element);
+ }
+
+ // Step 3.c.v.
+ if (shouldFlatten) {
+ // Step 3.c.v.1.
+ var elementLen = ToLength(element.length);
+
+ // Step 3.c.v.2.
+ // Recursive call to walk the depth.
+ targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1);
+ } else {
+ // Step 3.c.vi.1.
+ if (targetIndex >= MAX_NUMERIC_INDEX)
+ ThrowTypeError(JSMSG_TOO_LONG_ARRAY);
+
+ // Step 3.c.vi.2.
+ _DefineDataProperty(target, targetIndex, element);
+
+ // Step 3.c.vi.3.
+ targetIndex++;
+ }
+ }
+ }
+
+ // Step 4.
+ return targetIndex;
+}
+
function ArrayStaticConcat(arr, arg1) {
if (arguments.length < 1)
ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, 'Array.concat');
diff --git a/js/src/builtin/String.js b/js/src/builtin/String.js
index e5b2ad552..f830b1aa2 100644
--- a/js/src/builtin/String.js
+++ b/js/src/builtin/String.js
@@ -828,16 +828,16 @@ function String_static_trim(string) {
return callFunction(std_String_trim, string);
}
-function String_static_trimLeft(string) {
+function String_static_trimStart(string) {
if (arguments.length < 1)
- ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, 'String.trimLeft');
- return callFunction(std_String_trimLeft, string);
+ ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, 'String.trimStart');
+ return callFunction(std_String_trimStart, string);
}
-function String_static_trimRight(string) {
+function String_static_trimEnd(string) {
if (arguments.length < 1)
- ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, 'String.trimRight');
- return callFunction(std_String_trimRight, string);
+ ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, 'String.trimEnd');
+ return callFunction(std_String_trimEnd, string);
}
function String_static_toLocaleLowerCase(string) {
diff --git a/js/src/builtin/SymbolObject.cpp b/js/src/builtin/SymbolObject.cpp
index cf48402d6..ae38d5371 100644
--- a/js/src/builtin/SymbolObject.cpp
+++ b/js/src/builtin/SymbolObject.cpp
@@ -33,6 +33,7 @@ SymbolObject::create(JSContext* cx, JS::HandleSymbol symbol)
}
const JSPropertySpec SymbolObject::properties[] = {
+ JS_PSG("description", descriptionGetter, 0),
JS_PS_END
};
@@ -227,6 +228,34 @@ SymbolObject::toPrimitive(JSContext* cx, unsigned argc, Value* vp)
return CallNonGenericMethod<IsSymbol, valueOf_impl>(cx, args);
}
+// ES2019 Stage 4 Draft / November 28, 2018
+// Symbol description accessor
+// See: https://tc39.github.io/proposal-Symbol-description/
+bool
+SymbolObject::descriptionGetter_impl(JSContext* cx, const CallArgs& args)
+{
+ // Get symbol object pointer.
+ HandleValue thisv = args.thisv();
+ MOZ_ASSERT(IsSymbol(thisv));
+ Rooted<Symbol*> sym(cx, thisv.isSymbol()
+ ? thisv.toSymbol()
+ : thisv.toObject().as<SymbolObject>().unbox());
+
+ // Return the symbol's description if present, otherwise return undefined.
+ if (JSString* str = sym->description())
+ args.rval().setString(str);
+ else
+ args.rval().setUndefined();
+ return true;
+}
+
+bool
+SymbolObject::descriptionGetter(JSContext* cx, unsigned argc, Value* vp)
+{
+ CallArgs args = CallArgsFromVp(argc, vp);
+ return CallNonGenericMethod<IsSymbol, descriptionGetter_impl>(cx, args);
+}
+
JSObject*
js::InitSymbolClass(JSContext* cx, HandleObject obj)
{
diff --git a/js/src/builtin/SymbolObject.h b/js/src/builtin/SymbolObject.h
index 0f204b494..e10b42d53 100644
--- a/js/src/builtin/SymbolObject.h
+++ b/js/src/builtin/SymbolObject.h
@@ -52,6 +52,10 @@ class SymbolObject : public NativeObject
static MOZ_MUST_USE bool valueOf(JSContext* cx, unsigned argc, Value* vp);
static MOZ_MUST_USE bool toPrimitive(JSContext* cx, unsigned argc, Value* vp);
+ // Properties defined on Symbol.prototype.
+ static MOZ_MUST_USE bool descriptionGetter_impl(JSContext* cx, const CallArgs& args);
+ static MOZ_MUST_USE bool descriptionGetter(JSContext* cx, unsigned argc, Value *vp);
+
static const JSPropertySpec properties[];
static const JSFunctionSpec methods[];
static const JSFunctionSpec staticMethods[];
diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp
index 7a67c0095..3b4c957dc 100644
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -3169,6 +3169,11 @@ static const JSFunctionSpec array_methods[] = {
/* ES7 additions */
JS_SELF_HOSTED_FN("includes", "ArrayIncludes", 2,0),
+
+ /* ES2019 additions */
+ JS_SELF_HOSTED_FN("flat", "ArrayFlat", 0,0),
+ JS_SELF_HOSTED_FN("flatMap", "ArrayFlatMap", 1,0),
+
JS_FS_END
};
@@ -3333,6 +3338,8 @@ array_proto_finish(JSContext* cx, JS::HandleObject ctor, JS::HandleObject proto)
!DefineProperty(cx, unscopables, cx->names().fill, value) ||
!DefineProperty(cx, unscopables, cx->names().find, value) ||
!DefineProperty(cx, unscopables, cx->names().findIndex, value) ||
+ !DefineProperty(cx, unscopables, cx->names().flat, value) ||
+ !DefineProperty(cx, unscopables, cx->names().flatMap, value) ||
!DefineProperty(cx, unscopables, cx->names().includes, value) ||
!DefineProperty(cx, unscopables, cx->names().keys, value) ||
!DefineProperty(cx, unscopables, cx->names().values, value))
diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp
index e3b5708ca..7765b1197 100644
--- a/js/src/jsstr.cpp
+++ b/js/src/jsstr.cpp
@@ -1970,14 +1970,14 @@ js::str_trim(JSContext* cx, unsigned argc, Value* vp)
}
bool
-js::str_trimLeft(JSContext* cx, unsigned argc, Value* vp)
+js::str_trimStart(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
return TrimString(cx, args, true, false);
}
bool
-js::str_trimRight(JSContext* cx, unsigned argc, Value* vp)
+js::str_trimEnd(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
return TrimString(cx, args, false, true);
@@ -2568,8 +2568,10 @@ static const JSFunctionSpec string_methods[] = {
JS_FN("startsWith", str_startsWith, 1,0),
JS_FN("endsWith", str_endsWith, 1,0),
JS_FN("trim", str_trim, 0,0),
- JS_FN("trimLeft", str_trimLeft, 0,0),
- JS_FN("trimRight", str_trimRight, 0,0),
+ JS_FN("trimLeft", str_trimStart, 0,0),
+ JS_FN("trimStart", str_trimStart, 0,0),
+ JS_FN("trimRight", str_trimEnd, 0,0),
+ JS_FN("trimEnd", str_trimEnd, 0,0),
JS_FN("toLocaleLowerCase", str_toLocaleLowerCase, 0,0),
JS_FN("toLocaleUpperCase", str_toLocaleUpperCase, 0,0),
JS_SELF_HOSTED_FN("localeCompare", "String_localeCompare", 1,0),
@@ -2881,8 +2883,10 @@ static const JSFunctionSpec string_static_methods[] = {
JS_SELF_HOSTED_FN("startsWith", "String_static_startsWith", 2,0),
JS_SELF_HOSTED_FN("endsWith", "String_static_endsWith", 2,0),
JS_SELF_HOSTED_FN("trim", "String_static_trim", 1,0),
- JS_SELF_HOSTED_FN("trimLeft", "String_static_trimLeft", 1,0),
- JS_SELF_HOSTED_FN("trimRight", "String_static_trimRight", 1,0),
+ JS_SELF_HOSTED_FN("trimLeft", "String_static_trimStart", 1,0),
+ JS_SELF_HOSTED_FN("trimStart", "String_static_trimStart", 1,0),
+ JS_SELF_HOSTED_FN("trimRight", "String_static_trimEnd", 1,0),
+ JS_SELF_HOSTED_FN("trimEnd", "String_static_trimEnd", 1,0),
JS_SELF_HOSTED_FN("toLocaleLowerCase","String_static_toLocaleLowerCase",1,0),
JS_SELF_HOSTED_FN("toLocaleUpperCase","String_static_toLocaleUpperCase",1,0),
JS_SELF_HOSTED_FN("normalize", "String_static_normalize", 1,0),
diff --git a/js/src/jsstr.h b/js/src/jsstr.h
index 118118839..38fbfa85e 100644
--- a/js/src/jsstr.h
+++ b/js/src/jsstr.h
@@ -367,10 +367,10 @@ extern bool
str_trim(JSContext* cx, unsigned argc, Value* vp);
extern bool
-str_trimLeft(JSContext* cx, unsigned argc, Value* vp);
+str_trimStart(JSContext* cx, unsigned argc, Value* vp);
extern bool
-str_trimRight(JSContext* cx, unsigned argc, Value* vp);
+str_trimEnd(JSContext* cx, unsigned argc, Value* vp);
extern bool
str_toLocaleLowerCase(JSContext* cx, unsigned argc, Value* vp);
diff --git a/js/src/tests/ecma_6/Array/unscopables.js b/js/src/tests/ecma_6/Array/unscopables.js
index 6685309a0..56b3aa520 100644
--- a/js/src/tests/ecma_6/Array/unscopables.js
+++ b/js/src/tests/ecma_6/Array/unscopables.js
@@ -26,6 +26,8 @@ assertDeepEq(keys, [
"fill",
"find",
"findIndex",
+ "flat",
+ "flatMap",
"includes",
"keys",
"values"
diff --git a/js/src/vm/CommonPropertyNames.h b/js/src/vm/CommonPropertyNames.h
index e971dc844..8a36df083 100644
--- a/js/src/vm/CommonPropertyNames.h
+++ b/js/src/vm/CommonPropertyNames.h
@@ -115,6 +115,8 @@
macro(firstDayOfWeek, firstDayOfWeek, "firstDayOfWeek") \
macro(fix, fix, "fix") \
macro(flags, flags, "flags") \
+ macro(flat, flat, "flat") \
+ macro(flatMap, flatMap, "flatMap") \
macro(float32, float32, "float32") \
macro(Float32x4, Float32x4, "Float32x4") \
macro(float64, float64, "float64") \
diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp
index 328a960b6..ccd4cc8d7 100644
--- a/js/src/vm/SelfHosting.cpp
+++ b/js/src/vm/SelfHosting.cpp
@@ -2200,8 +2200,10 @@ static const JSFunctionSpec intrinsic_functions[] = {
JS_INLINABLE_FN("std_String_charAt", str_charAt, 1,0, StringCharAt),
JS_FN("std_String_endsWith", str_endsWith, 1,0),
JS_FN("std_String_trim", str_trim, 0,0),
- JS_FN("std_String_trimLeft", str_trimLeft, 0,0),
- JS_FN("std_String_trimRight", str_trimRight, 0,0),
+ JS_FN("std_String_trimLeft", str_trimStart, 0,0),
+ JS_FN("std_String_trimStart", str_trimStart, 0,0),
+ JS_FN("std_String_trimRight", str_trimEnd, 0,0),
+ JS_FN("std_String_trimEnd", str_trimEnd, 0,0),
JS_FN("std_String_toLocaleLowerCase", str_toLocaleLowerCase, 0,0),
JS_FN("std_String_toLocaleUpperCase", str_toLocaleUpperCase, 0,0),
JS_FN("std_String_normalize", str_normalize, 0,0),
diff --git a/js/xpconnect/tests/chrome/test_xrayToJS.xul b/js/xpconnect/tests/chrome/test_xrayToJS.xul
index ed67a34fe..73de267a1 100644
--- a/js/xpconnect/tests/chrome/test_xrayToJS.xul
+++ b/js/xpconnect/tests/chrome/test_xrayToJS.xul
@@ -198,7 +198,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=933681
"pop", "shift", "unshift", "splice", "concat", "slice", "lastIndexOf", "indexOf",
"includes", "forEach", "map", "reduce", "reduceRight", "filter", "some", "every", "find",
"findIndex", "copyWithin", "fill", Symbol.iterator, Symbol.unscopables, "entries", "keys",
- "values", "constructor"];
+ "values", "constructor", "flat", "flatMap"];
if (isNightlyBuild) {
// ...nothing now
}
diff --git a/toolkit/mozapps/update/UpdateTelemetry.jsm b/toolkit/mozapps/update/UpdateTelemetry.jsm
deleted file mode 100644
index d64085143..000000000
--- a/toolkit/mozapps/update/UpdateTelemetry.jsm
+++ /dev/null
@@ -1,488 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = [
- "AUSTLMY"
-];
-
-const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/Services.jsm", this);
-
-this.AUSTLMY = {
- // Telemetry for the application update background update check occurs when
- // the background update timer fires after the update interval which is
- // determined by the app.update.interval preference and its telemetry
- // histogram IDs have the suffix '_NOTIFY'.
- // Telemetry for the externally initiated background update check occurs when
- // a call is made to |checkForBackgroundUpdates| which is typically initiated
- // by an application when it has determined that the application should have
- // received an update. This has separate telemetry so it is possible to
- // analyze using the telemetry data systems that have not been updating when
- // they should have.
-
- // The update check was performed by the call to checkForBackgroundUpdates in
- // nsUpdateService.js.
- EXTERNAL: "EXTERNAL",
- // The update check was performed by the call to notify in nsUpdateService.js.
- NOTIFY: "NOTIFY",
-
- /**
- * Values for the UPDATE_CHECK_CODE_NOTIFY and UPDATE_CHECK_CODE_EXTERNAL
- * Telemetry histograms.
- */
- // No update found (no notification)
- CHK_NO_UPDATE_FOUND: 0,
- // Update will be downloaded in the background (background download)
- CHK_DOWNLOAD_UPDATE: 1,
- // Showing prompt due to the update.xml specifying showPrompt
- // (update notification)
- CHK_SHOWPROMPT_SNIPPET: 2,
- // Showing prompt due to preference (update notification)
- CHK_SHOWPROMPT_PREF: 3,
- // Already has an active update in progress (no notification)
- CHK_HAS_ACTIVEUPDATE: 8,
- // A background download is already in progress (no notification)
- CHK_IS_DOWNLOADING: 9,
- // An update is already staged (no notification)
- CHK_IS_STAGED: 10,
- // An update is already downloaded (no notification)
- CHK_IS_DOWNLOADED: 11,
- // Background checks disabled by preference (no notification)
- CHK_PREF_DISABLED: 12,
- // Update checks disabled by admin locked preference (no notification)
- CHK_ADMIN_DISABLED: 13,
- // Unable to check for updates per hasUpdateMutex() (no notification)
- CHK_NO_MUTEX: 14,
- // Unable to check for updates per gCanCheckForUpdates (no notification). This
- // should be covered by other codes and is recorded just in case.
- CHK_UNABLE_TO_CHECK: 15,
- // Background checks disabled for the current session (no notification)
- CHK_DISABLED_FOR_SESSION: 16,
- // Unable to perform a background check while offline (no notification)
- CHK_OFFLINE: 17,
- // Note: codes 18 - 21 were removed along with the certificate checking code.
- // General update check failure and threshold reached
- // (check failure notification)
- CHK_GENERAL_ERROR_PROMPT: 22,
- // General update check failure and threshold not reached (no notification)
- CHK_GENERAL_ERROR_SILENT: 23,
- // No compatible update found though there were updates (no notification)
- CHK_NO_COMPAT_UPDATE_FOUND: 24,
- // Update found for a previous version (no notification)
- CHK_UPDATE_PREVIOUS_VERSION: 25,
- // Update found for a version with the never preference set (no notification)
- CHK_UPDATE_NEVER_PREF: 26,
- // Update found without a type attribute (no notification)
- CHK_UPDATE_INVALID_TYPE: 27,
- // The system is no longer supported (system unsupported notification)
- CHK_UNSUPPORTED: 28,
- // Unable to apply updates (manual install to update notification)
- CHK_UNABLE_TO_APPLY: 29,
- // Unable to check for updates due to no OS version (no notification)
- CHK_NO_OS_VERSION: 30,
- // Unable to check for updates due to no OS ABI (no notification)
- CHK_NO_OS_ABI: 31,
- // Invalid url for app.update.url default preference (no notification)
- CHK_INVALID_DEFAULT_URL: 32,
- // Update elevation failures or cancelations threshold reached for this
- // version, OSX only (no notification)
- CHK_ELEVATION_DISABLED_FOR_VERSION: 35,
- // User opted out of elevated updates for the available update version, OSX
- // only (no notification)
- CHK_ELEVATION_OPTOUT_FOR_VERSION: 36,
-
- /**
- * Submit a telemetry ping for the update check result code or a telemetry
- * ping for a count type histogram count when no update was found. The no
- * update found ping is separate since it is the typical result, is less
- * interesting than the other result codes, and it is easier to analyze the
- * other codes without including it.
- *
- * @param aSuffix
- * The histogram id suffix for histogram IDs:
- * UPDATE_CHECK_CODE_EXTERNAL
- * UPDATE_CHECK_CODE_NOTIFY
- * UPDATE_CHECK_NO_UPDATE_EXTERNAL
- * UPDATE_CHECK_NO_UPDATE_NOTIFY
- * @param aCode
- * An integer value as defined by the values that start with CHK_ in
- * the above section.
- */
- pingCheckCode: function UT_pingCheckCode(aSuffix, aCode) {
- try {
- if (aCode == this.CHK_NO_UPDATE_FOUND) {
- let id = "UPDATE_CHECK_NO_UPDATE_" + aSuffix;
- // count type histogram
- Services.telemetry.getHistogramById(id).add();
- } else {
- let id = "UPDATE_CHECK_CODE_" + aSuffix;
- // enumerated type histogram
- Services.telemetry.getHistogramById(id).add(aCode);
- }
- } catch (e) {
- Cu.reportError(e);
- }
- },
-
- /**
- * Submit a telemetry ping for a failed update check's unhandled error code
- * when the pingCheckCode is CHK_GENERAL_ERROR_SILENT. The histogram is a
- * keyed count type with key names that are prefixed with 'AUS_CHECK_EX_ERR_'.
- *
- * @param aSuffix
- * The histogram id suffix for histogram IDs:
- * UPDATE_CHK_EXTENDED_ERROR_EXTERNAL
- * UPDATE_CHK_EXTENDED_ERROR_NOTIFY
- * @param aCode
- * The extended error value return by a failed update check.
- */
- pingCheckExError: function UT_pingCheckExError(aSuffix, aCode) {
- try {
- let id = "UPDATE_CHECK_EXTENDED_ERROR_" + aSuffix;
- let val = "AUS_CHECK_EX_ERR_" + aCode;
- // keyed count type histogram
- Services.telemetry.getKeyedHistogramById(id).add(val);
- } catch (e) {
- Cu.reportError(e);
- }
- },
-
- // The state code and if present the status error code were read on startup.
- STARTUP: "STARTUP",
- // The state code and status error code if present were read after staging.
- STAGE: "STAGE",
-
- // Patch type Complete
- PATCH_COMPLETE: "COMPLETE",
- // Patch type partial
- PATCH_PARTIAL: "PARTIAL",
- // Patch type unknown
- PATCH_UNKNOWN: "UNKNOWN",
-
- /**
- * Values for the UPDATE_DOWNLOAD_CODE_COMPLETE and
- * UPDATE_DOWNLOAD_CODE_PARTIAL Telemetry histograms.
- */
- DWNLD_SUCCESS: 0,
- DWNLD_RETRY_OFFLINE: 1,
- DWNLD_RETRY_NET_TIMEOUT: 2,
- DWNLD_RETRY_CONNECTION_REFUSED: 3,
- DWNLD_RETRY_NET_RESET: 4,
- DWNLD_ERR_NO_UPDATE: 5,
- DWNLD_ERR_NO_UPDATE_PATCH: 6,
- DWNLD_ERR_NO_PATCH_FILE: 7,
- DWNLD_ERR_PATCH_SIZE_LARGER: 8,
- DWNLD_ERR_PATCH_SIZE_NOT_EQUAL: 9,
- DWNLD_ERR_BINDING_ABORTED: 10,
- DWNLD_ERR_ABORT: 11,
- DWNLD_ERR_DOCUMENT_NOT_CACHED: 12,
- DWNLD_ERR_VERIFY_NO_REQUEST: 13,
- DWNLD_ERR_VERIFY_PATCH_SIZE_NOT_EQUAL: 14,
- DWNLD_ERR_VERIFY_NO_HASH_MATCH: 15,
-
- /**
- * Submit a telemetry ping for the update download result code.
- *
- * @param aIsComplete
- * If true the histogram is for a patch type complete, if false the
- * histogram is for a patch type partial, and when undefined the
- * histogram is for an unknown patch type. This is used to determine
- * the histogram ID out of the following histogram IDs:
- * UPDATE_DOWNLOAD_CODE_COMPLETE
- * UPDATE_DOWNLOAD_CODE_PARTIAL
- * @param aCode
- * An integer value as defined by the values that start with DWNLD_ in
- * the above section.
- */
- pingDownloadCode: function UT_pingDownloadCode(aIsComplete, aCode) {
- let patchType = this.PATCH_UNKNOWN;
- if (aIsComplete === true) {
- patchType = this.PATCH_COMPLETE;
- } else if (aIsComplete === false) {
- patchType = this.PATCH_PARTIAL;
- }
- try {
- let id = "UPDATE_DOWNLOAD_CODE_" + patchType;
- // enumerated type histogram
- Services.telemetry.getHistogramById(id).add(aCode);
- } catch (e) {
- Cu.reportError(e);
- }
- },
-
- /**
- * Submit a telemetry ping for the update status state code.
- *
- * @param aSuffix
- * The histogram id suffix for histogram IDs:
- * UPDATE_STATE_CODE_COMPLETE_STARTUP
- * UPDATE_STATE_CODE_PARTIAL_STARTUP
- * UPDATE_STATE_CODE_UNKNOWN_STARTUP
- * UPDATE_STATE_CODE_COMPLETE_STAGE
- * UPDATE_STATE_CODE_PARTIAL_STAGE
- * UPDATE_STATE_CODE_UNKNOWN_STAGE
- * @param aCode
- * An integer value as defined by the values that start with STATE_ in
- * the above section for the update state from the update.status file.
- */
- pingStateCode: function UT_pingStateCode(aSuffix, aCode) {
- try {
- let id = "UPDATE_STATE_CODE_" + aSuffix;
- // enumerated type histogram
- Services.telemetry.getHistogramById(id).add(aCode);
- } catch (e) {
- Cu.reportError(e);
- }
- },
-
- /**
- * Submit a telemetry ping for the update status error code. This does not
- * submit a success value which can be determined from the state code.
- *
- * @param aSuffix
- * The histogram id suffix for histogram IDs:
- * UPDATE_STATUS_ERROR_CODE_COMPLETE_STARTUP
- * UPDATE_STATUS_ERROR_CODE_PARTIAL_STARTUP
- * UPDATE_STATUS_ERROR_CODE_UNKNOWN_STARTUP
- * UPDATE_STATUS_ERROR_CODE_COMPLETE_STAGE
- * UPDATE_STATUS_ERROR_CODE_PARTIAL_STAGE
- * UPDATE_STATUS_ERROR_CODE_UNKNOWN_STAGE
- * @param aCode
- * An integer value for the error code from the update.status file.
- */
- pingStatusErrorCode: function UT_pingStatusErrorCode(aSuffix, aCode) {
- try {
- let id = "UPDATE_STATUS_ERROR_CODE_" + aSuffix;
- // enumerated type histogram
- Services.telemetry.getHistogramById(id).add(aCode);
- } catch (e) {
- Cu.reportError(e);
- }
- },
-
- /**
- * Submit the interval in days since the last notification for this background
- * update check or a boolean if the last notification is in the future.
- *
- * @param aSuffix
- * The histogram id suffix for histogram IDs:
- * UPDATE_INVALID_LASTUPDATETIME_EXTERNAL
- * UPDATE_INVALID_LASTUPDATETIME_NOTIFY
- * UPDATE_LAST_NOTIFY_INTERVAL_DAYS_EXTERNAL
- * UPDATE_LAST_NOTIFY_INTERVAL_DAYS_NOTIFY
- */
- pingLastUpdateTime: function UT_pingLastUpdateTime(aSuffix) {
- const PREF_APP_UPDATE_LASTUPDATETIME = "app.update.lastUpdateTime.background-update-timer";
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_LASTUPDATETIME)) {
- let lastUpdateTimeSeconds = Services.prefs.getIntPref(PREF_APP_UPDATE_LASTUPDATETIME);
- if (lastUpdateTimeSeconds) {
- let currentTimeSeconds = Math.round(Date.now() / 1000);
- if (lastUpdateTimeSeconds > currentTimeSeconds) {
- try {
- let id = "UPDATE_INVALID_LASTUPDATETIME_" + aSuffix;
- // count type histogram
- Services.telemetry.getHistogramById(id).add();
- } catch (e) {
- Cu.reportError(e);
- }
- } else {
- let intervalDays = (currentTimeSeconds - lastUpdateTimeSeconds) /
- (60 * 60 * 24);
- try {
- let id = "UPDATE_LAST_NOTIFY_INTERVAL_DAYS_" + aSuffix;
- // exponential type histogram
- Services.telemetry.getHistogramById(id).add(intervalDays);
- } catch (e) {
- Cu.reportError(e);
- }
- }
- }
- }
- },
-
- /**
- * Submit a telemetry ping for the last page displayed by the update wizard.
- *
- * @param aPageID
- * The page id for the last page displayed.
- */
- pingWizLastPageCode: function UT_pingWizLastPageCode(aPageID) {
- let pageMap = { invalid: 0,
- dummy: 1,
- checking: 2,
- pluginupdatesfound: 3,
- noupdatesfound: 4,
- manualUpdate: 5,
- unsupported: 6,
- updatesfoundbasic: 8,
- updatesfoundbillboard: 9,
- downloading: 12,
- errors: 13,
- errorextra: 14,
- errorpatching: 15,
- finished: 16,
- finishedBackground: 17,
- installed: 18 };
- try {
- let id = "UPDATE_WIZ_LAST_PAGE_CODE";
- // enumerated type histogram
- Services.telemetry.getHistogramById(id).add(pageMap[aPageID] ||
- pageMap.invalid);
- } catch (e) {
- Cu.reportError(e);
- }
- },
-
- /**
- * Submit a telemetry ping for a boolean type histogram that indicates if the
- * service is installed and a telemetry ping for a boolean type histogram that
- * indicates if the service was at some point installed and is now
- * uninstalled.
- *
- * @param aSuffix
- * The histogram id suffix for histogram IDs:
- * UPDATE_SERVICE_INSTALLED_EXTERNAL
- * UPDATE_SERVICE_INSTALLED_NOTIFY
- * UPDATE_SERVICE_MANUALLY_UNINSTALLED_EXTERNAL
- * UPDATE_SERVICE_MANUALLY_UNINSTALLED_NOTIFY
- * @param aInstalled
- * Whether the service is installed.
- */
- pingServiceInstallStatus: function UT_PSIS(aSuffix, aInstalled) {
- // Report the error but don't throw since it is more important to
- // successfully update than to throw.
- if (!("@mozilla.org/windows-registry-key;1" in Cc)) {
- Cu.reportError(Cr.NS_ERROR_NOT_AVAILABLE);
- return;
- }
-
- try {
- let id = "UPDATE_SERVICE_INSTALLED_" + aSuffix;
- // boolean type histogram
- Services.telemetry.getHistogramById(id).add(aInstalled);
- } catch (e) {
- Cu.reportError(e);
- }
-
- let attempted = 0;
- try {
- let wrk = Cc["@mozilla.org/windows-registry-key;1"].
- createInstance(Ci.nsIWindowsRegKey);
- wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
- "SOFTWARE\\Mozilla\\MaintenanceService",
- wrk.ACCESS_READ | wrk.WOW64_64);
- // Was the service at some point installed, but is now uninstalled?
- attempted = wrk.readIntValue("Attempted");
- wrk.close();
- } catch (e) {
- // Since this will throw if the registry key doesn't exist (e.g. the
- // service has never been installed) don't report an error.
- }
-
- try {
- let id = "UPDATE_SERVICE_MANUALLY_UNINSTALLED_" + aSuffix;
- if (!aInstalled && attempted) {
- // count type histogram
- Services.telemetry.getHistogramById(id).add();
- }
- } catch (e) {
- Cu.reportError(e);
- }
- },
-
- /**
- * Submit a telemetry ping for a count type histogram when the expected value
- * does not equal the boolean value of a pref or if the pref isn't present
- * when the expected value does not equal default value. This lessens the
- * amount of data submitted to telemetry.
- *
- * @param aID
- * The histogram ID to report to.
- * @param aPref
- * The preference to check.
- * @param aDefault
- * The default value when the preference isn't present.
- * @param aExpected (optional)
- * If specified and the value is the same as the value that will be
- * added the value won't be added to telemetry.
- */
- pingBoolPref: function UT_pingBoolPref(aID, aPref, aDefault, aExpected) {
- try {
- let val = aDefault;
- if (Services.prefs.getPrefType(aPref) != Ci.nsIPrefBranch.PREF_INVALID) {
- val = Services.prefs.getBoolPref(aPref);
- }
- if (val != aExpected) {
- // count type histogram
- Services.telemetry.getHistogramById(aID).add();
- }
- } catch (e) {
- Cu.reportError(e);
- }
- },
-
- /**
- * Submit a telemetry ping for a histogram with the integer value of a
- * preference when it is not the expected value or the default value when it
- * is not the expected value. This lessens the amount of data submitted to
- * telemetry.
- *
- * @param aID
- * The histogram ID to report to.
- * @param aPref
- * The preference to check.
- * @param aDefault
- * The default value when the pref is not set.
- * @param aExpected (optional)
- * If specified and the value is the same as the value that will be
- * added the value won't be added to telemetry.
- */
- pingIntPref: function UT_pingIntPref(aID, aPref, aDefault, aExpected) {
- try {
- let val = aDefault;
- if (Services.prefs.getPrefType(aPref) != Ci.nsIPrefBranch.PREF_INVALID) {
- val = Services.prefs.getIntPref(aPref);
- }
- if (aExpected === undefined || val != aExpected) {
- // enumerated or exponential type histogram
- Services.telemetry.getHistogramById(aID).add(val);
- }
- } catch (e) {
- Cu.reportError(e);
- }
- },
-
- /**
- * Submit a telemetry ping for all histogram types that take a single
- * parameter to the telemetry add function and the count type histogram when
- * the aExpected parameter is specified. If the aExpected parameter is
- * specified and it equals the value specified by the aValue
- * parameter the telemetry submission will be skipped.
- *
- * @param aID
- * The histogram ID to report to.
- * @param aValue
- * The value to add when aExpected is not defined or the value to
- * check if it is equal to when aExpected is defined.
- * @param aExpected (optional)
- * If specified and the value is the same as the value specified by
- * aValue parameter the submission will be skipped.
- */
- pingGeneric: function UT_pingGeneric(aID, aValue, aExpected) {
- try {
- if (aExpected === undefined) {
- Services.telemetry.getHistogramById(aID).add(aValue);
- } else if (aValue != aExpected) {
- // count type histogram
- Services.telemetry.getHistogramById(aID).add();
- }
- } catch (e) {
- Cu.reportError(e);
- }
- }
-};
-Object.freeze(AUSTLMY);
diff --git a/toolkit/mozapps/update/content/updates.js b/toolkit/mozapps/update/content/updates.js
index 9996014b5..3e05566f1 100644
--- a/toolkit/mozapps/update/content/updates.js
+++ b/toolkit/mozapps/update/content/updates.js
@@ -11,10 +11,9 @@
// so we have to use different names.
const {classes: CoC, interfaces: CoI, results: CoR, utils: CoU} = Components;
-/* globals DownloadUtils, Services, AUSTLMY */
+/* globals DownloadUtils, Services */
CoU.import("resource://gre/modules/DownloadUtils.jsm", this);
CoU.import("resource://gre/modules/Services.jsm", this);
-CoU.import("resource://gre/modules/UpdateTelemetry.jsm", this);
const XMLNS_XUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
@@ -116,15 +115,6 @@ var gUpdates = {
_runUnload: true,
/**
- * Submit on close telemtry values for the update wizard.
- * @param pageID
- * The page id for the last page displayed.
- */
- _submitTelemetry: function(aPageID) {
- AUSTLMY.pingWizLastPageCode(aPageID);
- },
-
- /**
* Helper function for setButtons
* Resets button to original label & accesskey if string is null.
*/
@@ -242,7 +232,6 @@ var gUpdates = {
var pageid = document.documentElement.currentPage.pageid;
if ("onWizardFinish" in this._pages[pageid])
this._pages[pageid].onWizardFinish();
- this._submitTelemetry(pageid);
},
/**
@@ -254,7 +243,6 @@ var gUpdates = {
var pageid = document.documentElement.currentPage.pageid;
if ("onWizardCancel" in this._pages[pageid])
this._pages[pageid].onWizardCancel();
- this._submitTelemetry(pageid);
},
/**
diff --git a/toolkit/mozapps/update/moz.build b/toolkit/mozapps/update/moz.build
index 78a6996b7..5f1d56764 100644
--- a/toolkit/mozapps/update/moz.build
+++ b/toolkit/mozapps/update/moz.build
@@ -23,10 +23,6 @@ EXTRA_COMPONENTS += [
'nsUpdateServiceStub.js',
]
-EXTRA_JS_MODULES += [
- 'UpdateTelemetry.jsm',
-]
-
JAR_MANIFESTS += ['jar.mn']
with Files('**'):
diff --git a/toolkit/mozapps/update/nsUpdateService.js b/toolkit/mozapps/update/nsUpdateService.js
index d9d09ba46..a68d815aa 100644
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -12,7 +12,6 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
Cu.import("resource://gre/modules/FileUtils.jsm", this);
Cu.import("resource://gre/modules/Services.jsm", this);
Cu.import("resource://gre/modules/ctypes.jsm", this);
-Cu.import("resource://gre/modules/UpdateTelemetry.jsm", this);
Cu.import("resource://gre/modules/AppConstants.jsm", this);
Cu.importGlobalProperties(["XMLHttpRequest"]);
@@ -950,63 +949,6 @@ function handleFallbackToCompleteUpdate(update, postStaging) {
}
function pingStateAndStatusCodes(aUpdate, aStartup, aStatus) {
- let patchType = AUSTLMY.PATCH_UNKNOWN;
- if (aUpdate && aUpdate.selectedPatch && aUpdate.selectedPatch.type) {
- if (aUpdate.selectedPatch.type == "complete") {
- patchType = AUSTLMY.PATCH_COMPLETE;
- } else if (aUpdate.selectedPatch.type == "partial") {
- patchType = AUSTLMY.PATCH_PARTIAL;
- }
- }
-
- let suffix = patchType + "_" + (aStartup ? AUSTLMY.STARTUP : AUSTLMY.STAGE);
- let stateCode = 0;
- let parts = aStatus.split(":");
- if (parts.length > 0) {
- switch (parts[0]) {
- case STATE_NONE:
- stateCode = 2;
- break;
- case STATE_DOWNLOADING:
- stateCode = 3;
- break;
- case STATE_PENDING:
- stateCode = 4;
- break;
- case STATE_APPLYING:
- stateCode = 6;
- break;
- case STATE_APPLIED:
- stateCode = 7;
- break;
- case STATE_APPLIED_OS:
- stateCode = 8;
- break;
- case STATE_SUCCEEDED:
- stateCode = 10;
- break;
- case STATE_DOWNLOAD_FAILED:
- stateCode = 11;
- break;
- case STATE_FAILED:
- stateCode = 12;
- break;
- case STATE_PENDING_ELEVATE:
- stateCode = 13;
- break;
- default:
- stateCode = 1;
- }
-
- if (parts.length > 1) {
- let statusErrorCode = INVALID_UPDATER_STATE_CODE;
- if (parts[0] == STATE_FAILED) {
- statusErrorCode = parseInt(parts[1]) || INVALID_UPDATER_STATUS_CODE;
- }
- AUSTLMY.pingStatusErrorCode(suffix, statusErrorCode);
- }
- }
- AUSTLMY.pingStateCode(suffix, stateCode);
}
/**
@@ -1764,14 +1706,9 @@ UpdateService.prototype = {
if (update.errorCode == NETWORK_ERROR_OFFLINE) {
// Register an online observer to try again
this._registerOnlineObserver();
- if (this._pingSuffix) {
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_OFFLINE);
- }
return;
}
- // Send the error code to telemetry
- AUSTLMY.pingCheckExError(this._pingSuffix, update.errorCode);
update.errorCode = BACKGROUNDCHECK_MULTIPLE_FAILURES;
let errCount = Services.prefs.getIntPref(PREF_APP_UPDATE_BACKGROUNDERRORS, 0);
errCount++;
@@ -1783,9 +1720,6 @@ UpdateService.prototype = {
let prompter = Cc["@mozilla.org/updates/update-prompt;1"].
createInstance(Ci.nsIUpdatePrompt);
prompter.showUpdateError(update);
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_GENERAL_ERROR_PROMPT);
- } else {
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_GENERAL_ERROR_SILENT);
}
},
@@ -1830,11 +1764,6 @@ UpdateService.prototype = {
this._checkForBackgroundUpdates(false);
},
- // The suffix used for background update check telemetry histogram ID's.
- get _pingSuffix() {
- return this._isNotify ? AUSTLMY.NOTIFY : AUSTLMY.EXTERNAL;
- },
-
/**
* Checks for updates in the background.
* @param isNotify
@@ -1844,119 +1773,10 @@ UpdateService.prototype = {
_checkForBackgroundUpdates: function AUS__checkForBackgroundUpdates(isNotify) {
this._isNotify = isNotify;
- // Histogram IDs:
- // UPDATE_PING_COUNT_EXTERNAL
- // UPDATE_PING_COUNT_NOTIFY
- AUSTLMY.pingGeneric("UPDATE_PING_COUNT_" + this._pingSuffix,
- true, false);
-
- // Histogram IDs:
- // UPDATE_UNABLE_TO_APPLY_EXTERNAL
- // UPDATE_UNABLE_TO_APPLY_NOTIFY
- AUSTLMY.pingGeneric("UPDATE_UNABLE_TO_APPLY_" + this._pingSuffix,
- getCanApplyUpdates(), true);
- // Histogram IDs:
- // UPDATE_CANNOT_STAGE_EXTERNAL
- // UPDATE_CANNOT_STAGE_NOTIFY
- AUSTLMY.pingGeneric("UPDATE_CANNOT_STAGE_" + this._pingSuffix,
- getCanStageUpdates(), true);
- // Histogram IDs:
- // UPDATE_INVALID_LASTUPDATETIME_EXTERNAL
- // UPDATE_INVALID_LASTUPDATETIME_NOTIFY
- // UPDATE_LAST_NOTIFY_INTERVAL_DAYS_EXTERNAL
- // UPDATE_LAST_NOTIFY_INTERVAL_DAYS_NOTIFY
- AUSTLMY.pingLastUpdateTime(this._pingSuffix);
- // Histogram IDs:
- // UPDATE_NOT_PREF_UPDATE_ENABLED_EXTERNAL
- // UPDATE_NOT_PREF_UPDATE_ENABLED_NOTIFY
- AUSTLMY.pingBoolPref("UPDATE_NOT_PREF_UPDATE_ENABLED_" + this._pingSuffix,
- PREF_APP_UPDATE_ENABLED, true, true);
- // Histogram IDs:
- // UPDATE_NOT_PREF_UPDATE_AUTO_EXTERNAL
- // UPDATE_NOT_PREF_UPDATE_AUTO_NOTIFY
- AUSTLMY.pingBoolPref("UPDATE_NOT_PREF_UPDATE_AUTO_" + this._pingSuffix,
- PREF_APP_UPDATE_AUTO, true, true);
- // Histogram IDs:
- // UPDATE_NOT_PREF_UPDATE_STAGING_ENABLED_EXTERNAL
- // UPDATE_NOT_PREF_UPDATE_STAGING_ENABLED_NOTIFY
- AUSTLMY.pingBoolPref("UPDATE_NOT_PREF_UPDATE_STAGING_ENABLED_" +
- this._pingSuffix,
- PREF_APP_UPDATE_STAGING_ENABLED, true, true);
- if (AppConstants.platform == "win" || AppConstants.platform == "macosx") {
- // Histogram IDs:
- // UPDATE_PREF_UPDATE_CANCELATIONS_EXTERNAL
- // UPDATE_PREF_UPDATE_CANCELATIONS_NOTIFY
- AUSTLMY.pingIntPref("UPDATE_PREF_UPDATE_CANCELATIONS_" + this._pingSuffix,
- PREF_APP_UPDATE_CANCELATIONS, 0, 0);
- }
- if (AppConstants.platform == "macosx") {
- // Histogram IDs:
- // UPDATE_PREF_UPDATE_CANCELATIONS_OSX_EXTERNAL
- // UPDATE_PREF_UPDATE_CANCELATIONS_OSX_NOTIFY
- AUSTLMY.pingIntPref("UPDATE_PREF_UPDATE_CANCELATIONS_OSX_" +
- this._pingSuffix,
- PREF_APP_UPDATE_CANCELATIONS_OSX, 0, 0);
- }
- let prefType = Services.prefs.getPrefType(PREF_APP_UPDATE_URL_OVERRIDE);
- let overridePrefHasValue = prefType != Ci.nsIPrefBranch.PREF_INVALID;
- // Histogram IDs:
- // UPDATE_HAS_PREF_URL_OVERRIDE_EXTERNAL
- // UPDATE_HAS_PREF_URL_OVERRIDE_NOTIFY
- AUSTLMY.pingGeneric("UPDATE_HAS_PREF_URL_OVERRIDE_" + this._pingSuffix,
- overridePrefHasValue, false);
-
- // If a download is in progress or the patch has been staged do nothing.
- if (this.isDownloading) {
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_IS_DOWNLOADING);
- return;
- }
-
if (this._downloader && this._downloader.patchIsStaged) {
- let readState = readStatusFile(getUpdatesDir());
- if (readState == STATE_PENDING ||
- readState == STATE_PENDING_ELEVATE) {
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_IS_DOWNLOADED);
- } else {
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_IS_STAGED);
- }
return;
}
- let validUpdateURL = true;
- try {
- this.backgroundChecker.getUpdateURL(false);
- } catch (e) {
- validUpdateURL = false;
- }
- // The following checks are done here so they can be differentiated from
- // foreground checks.
- if (!UpdateUtils.OSVersion) {
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_NO_OS_VERSION);
- } else if (!UpdateUtils.ABI) {
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_NO_OS_ABI);
- } else if (!validUpdateURL) {
- if (overridePrefHasValue) {
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_URL_OVERRIDE)) {
- AUSTLMY.pingCheckCode(this._pingSuffix,
- AUSTLMY.CHK_INVALID_USER_OVERRIDE_URL);
- } else {
- AUSTLMY.pingCheckCode(this._pingSuffix,
- AUSTLMY.CHK_INVALID_DEFAULT_OVERRIDE_URL);
- }
- } else {
- AUSTLMY.pingCheckCode(this._pingSuffix,
- AUSTLMY.CHK_INVALID_DEFAULT_URL);
- }
- } else if (!Services.prefs.getBoolPref(PREF_APP_UPDATE_ENABLED, true)) {
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_PREF_DISABLED);
- } else if (!hasUpdateMutex()) {
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_NO_MUTEX);
- } else if (!gCanCheckForUpdates) {
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_UNABLE_TO_CHECK);
- } else if (!this.backgroundChecker._enabled) {
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_DISABLED_FOR_SESSION);
- }
-
this.backgroundChecker.checkForUpdates(this, false);
},
@@ -1970,7 +1790,6 @@ UpdateService.prototype = {
*/
selectUpdate: function AUS_selectUpdate(updates) {
if (updates.length == 0) {
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_NO_UPDATE_FOUND);
return null;
}
@@ -1983,7 +1802,6 @@ UpdateService.prototype = {
var majorUpdate = null;
var minorUpdate = null;
var vc = Services.vc;
- let lastCheckCode = AUSTLMY.CHK_NO_COMPAT_UPDATE_FOUND;
updates.forEach(function(aUpdate) {
// Ignore updates for older versions of the applications and updates for
@@ -1996,7 +1814,6 @@ UpdateService.prototype = {
LOG("UpdateService:selectUpdate - skipping update because the " +
"update's application version is less than or equal to " +
"the current application version.");
- lastCheckCode = AUSTLMY.CHK_UPDATE_PREVIOUS_VERSION;
return;
}
@@ -2008,7 +1825,6 @@ UpdateService.prototype = {
Services.prefs.getBoolPref(neverPrefName, false)) {
LOG("UpdateService:selectUpdate - skipping update because the " +
"preference " + neverPrefName + " is true");
- lastCheckCode = AUSTLMY.CHK_UPDATE_NEVER_PREF;
return;
}
@@ -2028,7 +1844,6 @@ UpdateService.prototype = {
default:
LOG("UpdateService:selectUpdate - skipping unknown update type: " +
aUpdate.type);
- lastCheckCode = AUSTLMY.CHK_UPDATE_INVALID_TYPE;
break;
}
});
@@ -2059,16 +1874,11 @@ UpdateService.prototype = {
"install this update, but the user has exceeded the max " +
"number of elevation attempts.");
update.elevationFailure = true;
- AUSTLMY.pingCheckCode(
- this._pingSuffix,
- AUSTLMY.CHK_ELEVATION_DISABLED_FOR_VERSION);
} else if (vc.compare(rejectedVersion, update.appVersion) == 0) {
LOG("UpdateService:selectUpdate - the user requires elevation to " +
"install this update, but elevation is disabled for this " +
"version.");
update.elevationFailure = true;
- AUSTLMY.pingCheckCode(this._pingSuffix,
- AUSTLMY.CHK_ELEVATION_OPTOUT_FOR_VERSION);
} else {
LOG("UpdateService:selectUpdate - the user requires elevation to " +
"install the update.");
@@ -2088,8 +1898,6 @@ UpdateService.prototype = {
Services.prefs.clearUserPref(PREF_APP_UPDATE_ELEVATE_NEVER);
}
}
- } else if (!update) {
- AUSTLMY.pingCheckCode(this._pingSuffix, lastCheckCode);
}
return update;
@@ -2107,13 +1915,11 @@ UpdateService.prototype = {
var um = Cc["@mozilla.org/updates/update-manager;1"].
getService(Ci.nsIUpdateManager);
if (um.activeUpdate) {
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_HAS_ACTIVEUPDATE);
return;
}
var updateEnabled = Services.prefs.getBoolPref(PREF_APP_UPDATE_ENABLED, true);
if (!updateEnabled) {
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_PREF_DISABLED);
LOG("UpdateService:_selectAndInstallUpdate - not prompting because " +
"update is disabled");
return;
@@ -2132,7 +1938,6 @@ UpdateService.prototype = {
"update is not supported for this system");
this._showPrompt(update);
}
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_UNSUPPORTED);
return;
}
@@ -2140,7 +1945,6 @@ UpdateService.prototype = {
LOG("UpdateService:_selectAndInstallUpdate - the user is unable to " +
"apply updates... prompting");
this._showPrompt(update);
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_UNABLE_TO_APPLY);
return;
}
@@ -2163,7 +1967,6 @@ UpdateService.prototype = {
if (update.showPrompt) {
LOG("UpdateService:_selectAndInstallUpdate - prompting because the " +
"update snippet specified showPrompt");
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_SHOWPROMPT_SNIPPET);
this._showPrompt(update);
return;
}
@@ -2171,7 +1974,6 @@ UpdateService.prototype = {
if (!Services.prefs.getBoolPref(PREF_APP_UPDATE_AUTO, true)) {
LOG("UpdateService:_selectAndInstallUpdate - prompting because silent " +
"install is disabled");
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_SHOWPROMPT_PREF);
this._showPrompt(update);
return;
}
@@ -2181,7 +1983,6 @@ UpdateService.prototype = {
if (status == STATE_NONE) {
cleanupActiveUpdate();
}
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_DOWNLOAD_UPDATE);
},
_showPrompt: function AUS__showPrompt(update) {
@@ -3087,8 +2888,6 @@ Downloader.prototype = {
_verifyDownload: function Downloader__verifyDownload() {
LOG("Downloader:_verifyDownload called");
if (!this._request) {
- AUSTLMY.pingDownloadCode(this.isCompleteUpdate,
- AUSTLMY.DWNLD_ERR_VERIFY_NO_REQUEST);
return false;
}
@@ -3097,8 +2896,6 @@ Downloader.prototype = {
// Ensure that the file size matches the expected file size.
if (destination.fileSize != this._patch.size) {
LOG("Downloader:_verifyDownload downloaded size != expected size.");
- AUSTLMY.pingDownloadCode(this.isCompleteUpdate,
- AUSTLMY.DWNLD_ERR_VERIFY_PATCH_SIZE_NOT_EQUAL);
return false;
}
@@ -3143,8 +2940,6 @@ Downloader.prototype = {
}
LOG("Downloader:_verifyDownload hashes do not match. ");
- AUSTLMY.pingDownloadCode(this.isCompleteUpdate,
- AUSTLMY.DWNLD_ERR_VERIFY_NO_HASH_MATCH);
return false;
},
@@ -3271,7 +3066,6 @@ Downloader.prototype = {
downloadUpdate: function Downloader_downloadUpdate(update) {
LOG("UpdateService:_downloadUpdate");
if (!update) {
- AUSTLMY.pingDownloadCode(undefined, AUSTLMY.DWNLD_ERR_NO_UPDATE);
throw Cr.NS_ERROR_NULL_POINTER;
}
@@ -3284,7 +3078,6 @@ Downloader.prototype = {
this._patch = this._selectPatch(update, updateDir);
if (!this._patch) {
LOG("Downloader:downloadUpdate - no patch to download");
- AUSTLMY.pingDownloadCode(undefined, AUSTLMY.DWNLD_ERR_NO_UPDATE_PATCH);
return readStatusFile(updateDir);
}
this.isCompleteUpdate = this._patch.type == "complete";
@@ -3296,8 +3089,6 @@ Downloader.prototype = {
patchFile = this._getUpdateArchiveFile();
}
if (!patchFile) {
- AUSTLMY.pingDownloadCode(this.isCompleteUpdate,
- AUSTLMY.DWNLD_ERR_NO_PATCH_FILE);
return STATE_NONE;
}
@@ -3401,8 +3192,6 @@ Downloader.prototype = {
// It's important that we use a different code than
// NS_ERROR_CORRUPTED_CONTENT so that tests can verify the difference
// between a hash error and a wrong download error.
- AUSTLMY.pingDownloadCode(this.isCompleteUpdate,
- AUSTLMY.DWNLD_ERR_PATCH_SIZE_LARGER);
this.cancel(Cr.NS_ERROR_UNEXPECTED);
return;
}
@@ -3413,8 +3202,6 @@ Downloader.prototype = {
// It's important that we use a different code than
// NS_ERROR_CORRUPTED_CONTENT so that tests can verify the difference
// between a hash error and a wrong download error.
- AUSTLMY.pingDownloadCode(this.isCompleteUpdate,
- AUSTLMY.DWNLD_ERR_PATCH_SIZE_NOT_EQUAL);
this.cancel(Cr.NS_ERROR_UNEXPECTED);
return;
}
@@ -3495,7 +3282,6 @@ Downloader.prototype = {
if (this.background) {
shouldShowPrompt = !getCanStageUpdates();
}
- AUSTLMY.pingDownloadCode(this.isCompleteUpdate, AUSTLMY.DWNLD_SUCCESS);
// Tell the updater.exe we're ready to apply.
writeStatusFile(getUpdatesDir(), state);
@@ -3525,8 +3311,6 @@ Downloader.prototype = {
// calling downloadUpdate on the active update which continues
// downloading the file from where it was.
LOG("Downloader:onStopRequest - offline, register online observer: true");
- AUSTLMY.pingDownloadCode(this.isCompleteUpdate,
- AUSTLMY.DWNLD_RETRY_OFFLINE);
shouldRegisterOnlineObserver = true;
deleteActiveUpdate = false;
// Each of NS_ERROR_NET_TIMEOUT, ERROR_CONNECTION_REFUSED,
@@ -3540,25 +3324,11 @@ Downloader.prototype = {
status == Cr.NS_ERROR_DOCUMENT_NOT_CACHED) &&
this.updateService._consecutiveSocketErrors < maxFail) {
LOG("Downloader:onStopRequest - socket error, shouldRetrySoon: true");
- let dwnldCode = AUSTLMY.DWNLD_RETRY_CONNECTION_REFUSED;
- if (status == Cr.NS_ERROR_NET_TIMEOUT) {
- dwnldCode = AUSTLMY.DWNLD_RETRY_NET_TIMEOUT;
- } else if (status == Cr.NS_ERROR_NET_RESET) {
- dwnldCode = AUSTLMY.DWNLD_RETRY_NET_RESET;
- } else if (status == Cr.NS_ERROR_DOCUMENT_NOT_CACHED) {
- dwnldCode = AUSTLMY.DWNLD_ERR_DOCUMENT_NOT_CACHED;
- }
- AUSTLMY.pingDownloadCode(this.isCompleteUpdate, dwnldCode);
shouldRetrySoon = true;
deleteActiveUpdate = false;
} else if (status != Cr.NS_BINDING_ABORTED &&
status != Cr.NS_ERROR_ABORT) {
LOG("Downloader:onStopRequest - non-verification failure");
- let dwnldCode = AUSTLMY.DWNLD_ERR_BINDING_ABORTED;
- if (status == Cr.NS_ERROR_ABORT) {
- dwnldCode = AUSTLMY.DWNLD_ERR_ABORT;
- }
- AUSTLMY.pingDownloadCode(this.isCompleteUpdate, dwnldCode);
// Some sort of other failure, log this in the |statusText| property
state = STATE_DOWNLOAD_FAILED;
diff --git a/tools/lint/eslint/modules.json b/tools/lint/eslint/modules.json
index 30b5d3968..1ff546978 100644
--- a/tools/lint/eslint/modules.json
+++ b/tools/lint/eslint/modules.json
@@ -216,7 +216,6 @@
"ToolboxProcess.jsm": ["BrowserToolboxProcess"],
"tps.jsm": ["ACTIONS", "TPS"],
"Traversal.jsm": ["TraversalRules", "TraversalHelper"],
- "UpdateTelemetry.jsm": ["AUSTLMY"],
"userapi.js": ["UserAPI10Client"],
"util.js": ["getChromeWindow", "XPCOMUtils", "Services", "Utils", "Async", "Svc", "Str"],
"utils.js": ["applicationName", "assert", "Copy", "getBrowserObject", "getChromeWindow", "getWindows", "getWindowByTitle", "getWindowByType", "getWindowId", "getMethodInWindows", "getPreference", "saveDataURL", "setPreference", "sleep", "startTimer", "stopTimer", "takeScreenshot", "unwrapNode", "waitFor", "btoa", "encryptPayload", "isConfiguredWithLegacyIdentity", "ensureLegacyIdentityManager", "setBasicCredentials", "makeIdentityConfig", "configureIdentity", "SyncTestingInfrastructure", "waitForZeroTimer", "Promise", "add_identity_test", "MockFxaStorageManager", "AccountState", "sumHistogram", "CommonUtils", "CryptoUtils", "TestingUtils"],
diff --git a/widget/cocoa/nsNativeThemeCocoa.mm b/widget/cocoa/nsNativeThemeCocoa.mm
index 597c25a48..fc4f7f2e9 100644
--- a/widget/cocoa/nsNativeThemeCocoa.mm
+++ b/widget/cocoa/nsNativeThemeCocoa.mm
@@ -2778,9 +2778,8 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
NSMutableDictionary* options = [NSMutableDictionary dictionaryWithObjectsAndKeys:
(isOverlay ? @"kCUIWidgetOverlayScrollBar" : @"scrollbar"), @"widget",
(isSmall ? @"small" : @"regular"), @"size",
- (isOverlay && isOnTopOfDarkBackground ? @"kCUIVariantWhite" : @""),
- @"kCUIVariantKey",
- (isOnTopOfDarkBackground ? @"kCUIVariantWhite" : @""), @"kCUIVariantKey",
+ (isHorizontal ? @"kCUIOrientHorizontal" : @"kCUIOrientVertical"), @"kCUIOrientationKey",
+ (isOverlay && isOnTopOfDarkBackground ? @"kCUIVariantWhite" : @""), @"kCUIVariantKey",
[NSNumber numberWithBool:YES], @"indiconly",
[NSNumber numberWithBool:YES], @"kCUIThumbProportionKey",
[NSNumber numberWithBool:YES], @"is.flipped",