diff options
Diffstat (limited to 'toolkit')
56 files changed, 477 insertions, 1120 deletions
diff --git a/toolkit/components/alerts/nsAlertsService.cpp b/toolkit/components/alerts/nsAlertsService.cpp index dd67ad983..73dbb265c 100644 --- a/toolkit/components/alerts/nsAlertsService.cpp +++ b/toolkit/components/alerts/nsAlertsService.cpp @@ -6,7 +6,6 @@ #include "mozilla/dom/ContentChild.h" #include "mozilla/dom/PermissionMessageUtils.h" #include "mozilla/Preferences.h" -#include "mozilla/Telemetry.h" #include "nsXULAppAPI.h" #include "nsAlertsService.h" @@ -292,9 +291,6 @@ NS_IMETHODIMP nsAlertsService::SetManualDoNotDisturb(bool aDoNotDisturb) NS_ENSURE_TRUE(alertsDND, NS_ERROR_NOT_IMPLEMENTED); nsresult rv = alertsDND->SetManualDoNotDisturb(aDoNotDisturb); - if (NS_SUCCEEDED(rv)) { - Telemetry::Accumulate(Telemetry::ALERTS_SERVICE_DND_ENABLED, 1); - } return rv; #endif } diff --git a/toolkit/components/downloads/ApplicationReputation.cpp b/toolkit/components/downloads/ApplicationReputation.cpp index 1c94d6713..a369ca884 100644 --- a/toolkit/components/downloads/ApplicationReputation.cpp +++ b/toolkit/components/downloads/ApplicationReputation.cpp @@ -34,7 +34,6 @@ #include "mozilla/LoadContext.h" #include "mozilla/Preferences.h" #include "mozilla/Services.h" -#include "mozilla/Telemetry.h" #include "mozilla/TimeStamp.h" #include "nsAutoPtr.h" @@ -59,7 +58,6 @@ using mozilla::DocShellOriginAttributes; using mozilla::PrincipalOriginAttributes; using mozilla::Preferences; using mozilla::TimeStamp; -using mozilla::Telemetry::Accumulate; using safe_browsing::ClientDownloadRequest; using safe_browsing::ClientDownloadRequest_CertificateChain; using safe_browsing::ClientDownloadRequest_Resource; @@ -356,7 +354,6 @@ PendingDBLookup::HandleEvent(const nsACString& tables) Preferences::GetCString(PREF_DOWNLOAD_BLOCK_TABLE, &blockList); if (!mAllowlistOnly && FindInReadable(blockList, tables)) { mPendingLookup->mBlocklistCount++; - Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_LOCAL, BLOCK_LIST); LOG(("Found principal %s on blocklist [this = %p]", mSpec.get(), this)); return mPendingLookup->OnComplete(true, NS_OK, nsIApplicationReputationService::VERDICT_DANGEROUS); @@ -366,13 +363,11 @@ PendingDBLookup::HandleEvent(const nsACString& tables) Preferences::GetCString(PREF_DOWNLOAD_ALLOW_TABLE, &allowList); if (FindInReadable(allowList, tables)) { mPendingLookup->mAllowlistCount++; - Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_LOCAL, ALLOW_LIST); LOG(("Found principal %s on allowlist [this = %p]", mSpec.get(), this)); // Don't call onComplete, since blocklisting trumps allowlisting } else { LOG(("Didn't find principal %s on any list [this = %p]", mSpec.get(), this)); - Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_LOCAL, NO_LIST); } return mPendingLookup->LookupNext(); } @@ -1144,8 +1139,6 @@ PendingLookup::OnComplete(bool shouldBlock, nsresult rv, uint32_t verdict) mTimeoutTimer = nullptr; } - Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SHOULD_BLOCK, - shouldBlock); double t = (TimeStamp::Now() - mStartTime).ToMilliseconds(); LOG(("Application Reputation verdict is %lu, obtained in %f ms [this = %p]", verdict, t, this)); @@ -1393,8 +1386,6 @@ PendingLookup::Notify(nsITimer* aTimer) { LOG(("Remote lookup timed out [this = %p]", this)); MOZ_ASSERT(aTimer == mTimeoutTimer); - Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_REMOTE_LOOKUP_TIMEOUT, - true); mChannel->Cancel(NS_ERROR_NET_TIMEOUT); mTimeoutTimer->Cancel(); return NS_OK; @@ -1457,8 +1448,6 @@ PendingLookup::OnStopRequest(nsIRequest *aRequest, bool shouldBlock = false; uint32_t verdict = nsIApplicationReputationService::VERDICT_SAFE; - Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_REMOTE_LOOKUP_TIMEOUT, - false); nsresult rv = OnStopRequestInternal(aRequest, aContext, aResult, &shouldBlock, &verdict); @@ -1473,8 +1462,6 @@ PendingLookup::OnStopRequestInternal(nsIRequest *aRequest, bool* aShouldBlock, uint32_t* aVerdict) { if (NS_FAILED(aResult)) { - Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SERVER, - SERVER_RESPONSE_FAILED); return aResult; } @@ -1483,22 +1470,16 @@ PendingLookup::OnStopRequestInternal(nsIRequest *aRequest, nsresult rv; nsCOMPtr<nsIHttpChannel> channel = do_QueryInterface(aRequest, &rv); if (NS_FAILED(rv)) { - Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SERVER, - SERVER_RESPONSE_FAILED); return rv; } uint32_t status = 0; rv = channel->GetResponseStatus(&status); if (NS_FAILED(rv)) { - Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SERVER, - SERVER_RESPONSE_FAILED); return rv; } if (status != 200) { - Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SERVER, - SERVER_RESPONSE_FAILED); return NS_ERROR_NOT_AVAILABLE; } @@ -1506,16 +1487,9 @@ PendingLookup::OnStopRequestInternal(nsIRequest *aRequest, safe_browsing::ClientDownloadResponse response; if (!response.ParseFromString(buf)) { LOG(("Invalid protocol buffer response [this = %p]: %s", this, buf.c_str())); - Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SERVER, - SERVER_RESPONSE_INVALID); return NS_ERROR_CANNOT_CONVERT_DATA; } - Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SERVER, - SERVER_RESPONSE_VALID); - // Clamp responses 0-7, we only know about 0-4 for now. - Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SERVER_VERDICT, - std::min<uint32_t>(response.verdict(), 7)); switch(response.verdict()) { case safe_browsing::ClientDownloadResponse::DANGEROUS: *aShouldBlock = Preferences::GetBool(PREF_BLOCK_DANGEROUS, true); @@ -1583,11 +1557,8 @@ ApplicationReputationService::QueryReputation( NS_ENSURE_ARG_POINTER(aQuery); NS_ENSURE_ARG_POINTER(aCallback); - Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_COUNT, true); nsresult rv = QueryReputationInternal(aQuery, aCallback); if (NS_FAILED(rv)) { - Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SHOULD_BLOCK, - false); aCallback->OnComplete(false, rv, nsIApplicationReputationService::VERDICT_SAFE); } diff --git a/toolkit/components/osfile/modules/osfile_async_front.jsm b/toolkit/components/osfile/modules/osfile_async_front.jsm index 964e53084..93c7e66d6 100644 --- a/toolkit/components/osfile/modules/osfile_async_front.jsm +++ b/toolkit/components/osfile/modules/osfile_async_front.jsm @@ -56,7 +56,6 @@ Cu.import("resource://gre/modules/Task.jsm", this); // The implementation of communications Cu.import("resource://gre/modules/PromiseWorker.jsm", this); Cu.import("resource://gre/modules/Services.jsm", this); -Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", this); Cu.import("resource://gre/modules/AsyncShutdown.jsm", this); var Native = Cu.import("resource://gre/modules/osfile/osfile_native.jsm", {}); @@ -1171,13 +1170,10 @@ File.writeAtomic = function writeAtomic(path, buffer, options = {}) { if (isTypedArray(buffer) && (!("bytes" in options))) { options.bytes = buffer.byteLength; }; - let refObj = {}; - TelemetryStopwatch.start("OSFILE_WRITEATOMIC_JANK_MS", refObj); let promise = Scheduler.post("writeAtomic", [Type.path.toMsg(path), Type.void_t.in_ptr.toMsg(buffer), options], [options, buffer, path]); - TelemetryStopwatch.finish("OSFILE_WRITEATOMIC_JANK_MS", refObj); return promise; }; diff --git a/toolkit/components/perfmonitoring/nsPerformanceStats.cpp b/toolkit/components/perfmonitoring/nsPerformanceStats.cpp index eb924de46..33aeaf7c2 100644 --- a/toolkit/components/perfmonitoring/nsPerformanceStats.cpp +++ b/toolkit/components/perfmonitoring/nsPerformanceStats.cpp @@ -27,7 +27,6 @@ #include "mozilla/ArrayUtils.h" #include "mozilla/EventStateManager.h" #include "mozilla/Services.h" -#include "mozilla/Telemetry.h" #if defined(XP_WIN) #include <processthreadsapi.h> @@ -957,22 +956,7 @@ nsPerformanceStatsService::SetJankAlertBufferingDelay(uint32_t value) { nsresult nsPerformanceStatsService::UpdateTelemetry() { - // Promote everything to floating-point explicitly before dividing. - const double processStayed = mProcessStayed; - const double processMoved = mProcessMoved; - - if (processStayed <= 0 || processMoved <= 0 || processStayed + processMoved <= 0) { - // Overflow/underflow/nothing to report - return NS_OK; - } - - const double proportion = (100 * processStayed) / (processStayed + processMoved); - if (proportion < 0 || proportion > 100) { - // Overflow/underflow - return NS_OK; - } - - mozilla::Telemetry::Accumulate(mozilla::Telemetry::PERF_MONITORING_TEST_CPU_RESCHEDULING_PROPORTION_MOVED, (uint32_t)proportion); + /* STUB */ return NS_OK; } diff --git a/toolkit/components/places/Database.cpp b/toolkit/components/places/Database.cpp index 37502e2a1..a87c14b37 100644 --- a/toolkit/components/places/Database.cpp +++ b/toolkit/components/places/Database.cpp @@ -615,9 +615,6 @@ Database::BackupAndReplaceDatabaseFile(nsCOMPtr<mozIStorageService>& aStorage) // Set up a pref to try replacing the database at the next startup. Preferences::SetBool(PREF_FORCE_DATABASE_REPLACEMENT, true); } - // Report the corruption through telemetry. - Telemetry::Accumulate(Telemetry::PLACES_DATABASE_CORRUPTION_HANDLING_STAGE, - static_cast<int8_t>(stage)); }); // Close database connection if open. diff --git a/toolkit/components/places/FaviconHelpers.cpp b/toolkit/components/places/FaviconHelpers.cpp index 69c202338..ca08cdff4 100644 --- a/toolkit/components/places/FaviconHelpers.cpp +++ b/toolkit/components/places/FaviconHelpers.cpp @@ -14,7 +14,6 @@ #include "nsNavHistory.h" #include "nsFaviconService.h" #include "mozilla/storage.h" -#include "mozilla/Telemetry.h" #include "nsNetUtil.h" #include "nsPrintfCString.h" #include "nsStreamUtils.h" @@ -581,33 +580,6 @@ AsyncFetchAndSetIconForPage::OnStopRequest(nsIRequest* aRequest, mIcon.expiration = GetExpirationTimeFromChannel(channel); - // Telemetry probes to measure the favicon file sizes for each different file type. - // This allow us to measure common file sizes while also observing each type popularity. - if (mIcon.mimeType.EqualsLiteral("image/png")) { - mozilla::Telemetry::Accumulate(mozilla::Telemetry::PLACES_FAVICON_PNG_SIZES, mIcon.data.Length()); - } - else if (mIcon.mimeType.EqualsLiteral("image/x-icon") || - mIcon.mimeType.EqualsLiteral("image/vnd.microsoft.icon")) { - mozilla::Telemetry::Accumulate(mozilla::Telemetry::PLACES_FAVICON_ICO_SIZES, mIcon.data.Length()); - } - else if (mIcon.mimeType.EqualsLiteral("image/jpeg") || - mIcon.mimeType.EqualsLiteral("image/pjpeg")) { - mozilla::Telemetry::Accumulate(mozilla::Telemetry::PLACES_FAVICON_JPEG_SIZES, mIcon.data.Length()); - } - else if (mIcon.mimeType.EqualsLiteral("image/gif")) { - mozilla::Telemetry::Accumulate(mozilla::Telemetry::PLACES_FAVICON_GIF_SIZES, mIcon.data.Length()); - } - else if (mIcon.mimeType.EqualsLiteral("image/bmp") || - mIcon.mimeType.EqualsLiteral("image/x-windows-bmp")) { - mozilla::Telemetry::Accumulate(mozilla::Telemetry::PLACES_FAVICON_BMP_SIZES, mIcon.data.Length()); - } - else if (mIcon.mimeType.EqualsLiteral("image/svg+xml")) { - mozilla::Telemetry::Accumulate(mozilla::Telemetry::PLACES_FAVICON_SVG_SIZES, mIcon.data.Length()); - } - else { - mozilla::Telemetry::Accumulate(mozilla::Telemetry::PLACES_FAVICON_OTHER_SIZES, mIcon.data.Length()); - } - rv = OptimizeIconSize(mIcon, favicons); NS_ENSURE_SUCCESS(rv, rv); diff --git a/toolkit/components/places/Helpers.cpp b/toolkit/components/places/Helpers.cpp index 66c4e79a9..dda162197 100644 --- a/toolkit/components/places/Helpers.cpp +++ b/toolkit/components/places/Helpers.cpp @@ -385,9 +385,7 @@ AsyncStatementCallbackNotifier::HandleCompletion(uint16_t aReason) NS_IMETHODIMP AsyncStatementTelemetryTimer::HandleCompletion(uint16_t aReason) { - if (aReason == mozIStorageStatementCallback::REASON_FINISHED) { - Telemetry::AccumulateTimeDelta(mHistogramId, mStart); - } + /* STUB */ return NS_OK; } diff --git a/toolkit/components/places/UnifiedComplete.js b/toolkit/components/places/UnifiedComplete.js index acd358b11..2efae9cbe 100644 --- a/toolkit/components/places/UnifiedComplete.js +++ b/toolkit/components/places/UnifiedComplete.js @@ -262,8 +262,6 @@ Cu.import("resource://gre/modules/Services.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch", - "resource://gre/modules/TelemetryStopwatch.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Preferences", @@ -887,10 +885,6 @@ Search.prototype = { if (!this.pending) return; - TelemetryStopwatch.start(TELEMETRY_1ST_RESULT, this); - if (this._searchString) - TelemetryStopwatch.start(TELEMETRY_6_FIRST_RESULTS, this); - // Since we call the synchronous parseSubmissionURL function later, we must // wait for the initialization of PlacesSearchAutocompleteProvider first. yield PlacesSearchAutocompleteProvider.ensureInitialized(); @@ -1468,9 +1462,6 @@ Search.prototype = { }, _onResultRow: function (row) { - if (this._localMatchesCount == 0) { - TelemetryStopwatch.finish(TELEMETRY_1ST_RESULT, this); - } let queryType = row.getResultByIndex(QUERYINDEX_QUERYTYPE); let match; switch (queryType) { @@ -1566,9 +1557,6 @@ Search.prototype = { match.style, match.finalCompleteValue); - if (this._result.matchCount == 6) - TelemetryStopwatch.finish(TELEMETRY_6_FIRST_RESULTS, this); - this.notifyResults(true); }, @@ -2088,8 +2076,6 @@ UnifiedComplete.prototype = { * results or not. */ finishSearch: function (notify=false) { - TelemetryStopwatch.cancel(TELEMETRY_1ST_RESULT, this); - TelemetryStopwatch.cancel(TELEMETRY_6_FIRST_RESULTS, this); // Clear state now to avoid race conditions, see below. let search = this._currentSearch; if (!search) diff --git a/toolkit/components/places/nsPlacesAutoComplete.js b/toolkit/components/places/nsPlacesAutoComplete.js index 29bdae4c1..9c6452ecd 100644 --- a/toolkit/components/places/nsPlacesAutoComplete.js +++ b/toolkit/components/places/nsPlacesAutoComplete.js @@ -8,8 +8,6 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch", - "resource://gre/modules/TelemetryStopwatch.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Task", @@ -1510,8 +1508,6 @@ urlInlineComplete.prototype = { // Do a synchronous search on the table of hosts. let query = this._hostQuery; query.params.search_string = this._currentSearchString.toLowerCase(); - // This is just to measure the delay to reach the UI, not the query time. - TelemetryStopwatch.start(DOMAIN_QUERY_TELEMETRY); let wrapper = new AutoCompleteStatementCallbackWrapper(this, { handleResult: aResultSet => { if (this._pendingSearch != pendingSearch) @@ -1541,7 +1537,6 @@ urlInlineComplete.prototype = { handleCompletion: aReason => { if (this._pendingSearch != pendingSearch) return; - TelemetryStopwatch.finish(DOMAIN_QUERY_TELEMETRY); this._finishSearch(); } }, this._db); diff --git a/toolkit/components/prompts/content/commonDialog.js b/toolkit/components/prompts/content/commonDialog.js index ef4686654..70b373d1f 100644 --- a/toolkit/components/prompts/content/commonDialog.js +++ b/toolkit/components/prompts/content/commonDialog.js @@ -50,8 +50,6 @@ function commonDialogOnLoad() { Dialog = new CommonDialog(args, ui); Dialog.onLoad(dialog); - // resize the window to the content - window.sizeToContent(); window.getAttention(); } diff --git a/toolkit/components/reader/AboutReader.jsm b/toolkit/components/reader/AboutReader.jsm index c5d04476d..6ec959eba 100644 --- a/toolkit/components/reader/AboutReader.jsm +++ b/toolkit/components/reader/AboutReader.jsm @@ -14,7 +14,6 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "AsyncPrefs", "resource://gre/modules/AsyncPrefs.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "NarrateControls", "resource://gre/modules/narrate/NarrateControls.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "Rect", "resource://gre/modules/Geometry.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm"); diff --git a/toolkit/components/reader/JSDOMParser.js b/toolkit/components/reader/JSDOMParser.js index dd9d37230..debdb08eb 100644 --- a/toolkit/components/reader/JSDOMParser.js +++ b/toolkit/components/reader/JSDOMParser.js @@ -618,6 +618,13 @@ }; var Element = function (tag) { + // We use this to find the closing tag. + this._matchingTag = tag; + // We're explicitly a non-namespace aware parser, we just pretend it's all HTML. + var lastColonIndex = tag.lastIndexOf(":"); + if (lastColonIndex != -1) { + tag = tag.substring(lastColonIndex + 1); + } this.attributes = []; this.childNodes = []; this.children = []; @@ -785,7 +792,13 @@ break; } } - } + }, + + hasAttribute: function (name) { + return this.attributes.some(function (attr) { + return attr.name == name; + }); + }, }; var Style = function (node) { @@ -1062,9 +1075,10 @@ return null; // Read any text as Text node + var textNode; if (c !== "<") { --this.currentChar; - var textNode = new Text(); + textNode = new Text(); var n = this.html.indexOf("<", this.currentChar); if (n === -1) { textNode.innerHTML = this.html.substring(this.currentChar, this.html.length); @@ -1076,6 +1090,18 @@ return textNode; } + if (this.match("![CDATA[")) { + var endChar = this.html.indexOf("]]>", this.currentChar); + if (endChar === -1) { + this.error("unclosed CDATA section"); + return null; + } + textNode = new Text(); + textNode.textContent = this.html.substring(this.currentChar, endChar); + this.currentChar = endChar + ("]]>").length; + return textNode; + } + c = this.peekNext(); // Read Comment node. Normally, Comment nodes know their inner @@ -1107,7 +1133,7 @@ // If this isn't a void Element, read its child nodes if (!closed) { this.readChildren(node); - var closingTag = "</" + localName + ">"; + var closingTag = "</" + node._matchingTag + ">"; if (!this.match(closingTag)) { this.error("expected '" + closingTag + "' and got " + this.html.substr(this.currentChar, closingTag.length)); return null; diff --git a/toolkit/components/reader/Readability.js b/toolkit/components/reader/Readability.js index 064d2ae88..c2bba0cd3 100644 --- a/toolkit/components/reader/Readability.js +++ b/toolkit/components/reader/Readability.js @@ -29,14 +29,19 @@ /** * Public constructor. - * @param {Object} uri The URI descriptor object. * @param {HTMLDocument} doc The document to parse. * @param {Object} options The options object. */ -function Readability(uri, doc, options) { +function Readability(doc, options) { + // In some older versions, people passed a URI as the first argument. Cope: + if (options && options.documentElement) { + doc = options; + options = arguments[2]; + } else if (!doc || !doc.documentElement) { + throw new Error("First argument to Readability constructor should be a document object."); + } options = options || {}; - this._uri = uri; this._doc = doc; this._articleTitle = null; this._articleByline = null; @@ -47,7 +52,7 @@ function Readability(uri, doc, options) { this._debug = !!options.debug; this._maxElemsToParse = options.maxElemsToParse || this.DEFAULT_MAX_ELEMS_TO_PARSE; this._nbTopCandidates = options.nbTopCandidates || this.DEFAULT_N_TOP_CANDIDATES; - this._wordThreshold = options.wordThreshold || this.DEFAULT_WORD_THRESHOLD; + this._charThreshold = options.charThreshold || this.DEFAULT_CHAR_THRESHOLD; this._classesToPreserve = this.CLASSES_TO_PRESERVE.concat(options.classesToPreserve || []); // Start with all flags set @@ -93,6 +98,10 @@ Readability.prototype = { FLAG_WEIGHT_CLASSES: 0x2, FLAG_CLEAN_CONDITIONALLY: 0x4, + // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType + ELEMENT_NODE: 1, + TEXT_NODE: 3, + // Max number of nodes supported by this parser. Default: 0 (no limit) DEFAULT_MAX_ELEMS_TO_PARSE: 0, @@ -103,13 +112,13 @@ Readability.prototype = { // Element tags to score by default. DEFAULT_TAGS_TO_SCORE: "section,h2,h3,h4,h5,h6,p,td,pre".toUpperCase().split(","), - // The default number of words an article must have in order to return a result - DEFAULT_WORD_THRESHOLD: 500, + // The default number of chars an article must have in order to return a result + DEFAULT_CHAR_THRESHOLD: 500, // All of the regular expressions in use within readability. // Defined up here so we don't instantiate them repeatedly in loops. REGEXPS: { - unlikelyCandidates: /banner|breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|foot|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup|yom-remote/i, + unlikelyCandidates: /-ad-|banner|breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|foot|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup|yom-remote/i, okMaybeItsACandidate: /and|article|body|column|main|shadow/i, positive: /article|body|content|entry|hentry|h-entry|main|page|pagination|post|text|blog|story/i, negative: /hidden|^hid$| hid$| hid |^hid |banner|combx|comment|com-|contact|foot|footer|footnote|masthead|media|meta|outbrain|promo|related|scroll|share|shoutbox|sidebar|skyscraper|sponsor|shopping|tags|tool|widget/i, @@ -132,8 +141,19 @@ Readability.prototype = { DEPRECATED_SIZE_ATTRIBUTE_ELEMS: [ "TABLE", "TH", "TD", "HR", "PRE" ], + // The commented out elements qualify as phrasing content but tend to be + // removed by readability when put into paragraphs, so we ignore them here. + PHRASING_ELEMS: [ + // "CANVAS", "IFRAME", "SVG", "VIDEO", + "ABBR", "AUDIO", "B", "BDO", "BR", "BUTTON", "CITE", "CODE", "DATA", + "DATALIST", "DFN", "EM", "EMBED", "I", "IMG", "INPUT", "KBD", "LABEL", + "MARK", "MATH", "METER", "NOSCRIPT", "OBJECT", "OUTPUT", "PROGRESS", "Q", + "RUBY", "SAMP", "SCRIPT", "SELECT", "SMALL", "SPAN", "STRONG", "SUB", + "SUP", "TEXTAREA", "TIME", "VAR", "WBR" + ], + // These are the classes that readability sets itself. - CLASSES_TO_PRESERVE: [ "readability-styled", "page" ], + CLASSES_TO_PRESERVE: [ "page" ], /** * Run any post-process modifications to article content as necessary. @@ -216,6 +236,21 @@ Readability.prototype = { }, /** + * Iterate over a NodeList, return true if all of the provided iterate + * function calls return true, false otherwise. + * + * For convenience, the current object context is applied to the + * provided iterate function. + * + * @param NodeList nodeList The NodeList. + * @param Function fn The iterate function. + * @return Boolean + */ + _everyNode: function(nodeList, fn) { + return Array.prototype.every.call(nodeList, fn, this); + }, + + /** * Concat all nodelists passed as arguments. * * @return ...NodeList @@ -327,7 +362,7 @@ Readability.prototype = { var origTitle = ""; try { - curTitle = origTitle = doc.title; + curTitle = origTitle = doc.title.trim(); // If they had an element with id "title" in their HTML if (typeof curTitle !== "string") @@ -355,8 +390,9 @@ Readability.prototype = { doc.getElementsByTagName('h1'), doc.getElementsByTagName('h2') ); + var trimmedTitle = curTitle.trim(); var match = this._someNode(headings, function(heading) { - return heading.textContent === curTitle; + return heading.textContent.trim() === trimmedTitle; }); // If we don't, let's extract the title out of the original title string. @@ -421,7 +457,7 @@ Readability.prototype = { _nextElement: function (node) { var next = node; while (next - && (next.nodeType != Node.ELEMENT_NODE) + && (next.nodeType != this.ELEMENT_NODE) && this.REGEXPS.whitespace.test(next.textContent)) { next = next.nextSibling; } @@ -464,16 +500,22 @@ Readability.prototype = { while (next) { // If we've hit another <br><br>, we're done adding children to this <p>. if (next.tagName == "BR") { - var nextElem = this._nextElement(next); + var nextElem = this._nextElement(next.nextSibling); if (nextElem && nextElem.tagName == "BR") break; } + if (!this._isPhrasingContent(next)) break; + // Otherwise, make this node a child of the new <p>. var sibling = next.nextSibling; p.appendChild(next); next = sibling; } + + while (p.lastChild && this._isWhitespace(p.lastChild)) p.removeChild(p.lastChild); + + if (p.parentNode.tagName === "P") this._setNodeTag(p.parentNode, "DIV"); } }); }, @@ -523,6 +565,7 @@ Readability.prototype = { this._clean(articleContent, "h1"); this._clean(articleContent, "footer"); this._clean(articleContent, "link"); + this._clean(articleContent, "aside"); // Clean out elements have "share" in their id/class combinations from final top candidates, // which means we don't remove the top candidates even they have "share". @@ -579,6 +622,19 @@ Readability.prototype = { if (next && next.tagName == "P") br.parentNode.removeChild(br); }); + + // Remove single-cell tables + this._forEachNode(this._getAllNodesWithTag(articleContent, ["table"]), function(table) { + var tbody = this._hasSingleTagInsideElement(table, "TBODY") ? table.firstElementChild : table; + if (this._hasSingleTagInsideElement(tbody, "TR")) { + var row = tbody.firstElementChild; + if (this._hasSingleTagInsideElement(row, "TD")) { + var cell = row.firstElementChild; + cell = this._setNodeTag(cell, this._everyNode(cell.childNodes, this._isPhrasingContent) ? "P" : "DIV"); + table.parentNode.replaceChild(cell, table); + } + } + }); }, /** @@ -658,37 +714,6 @@ Readability.prototype = { return node && node.nextElementSibling; }, - /** - * Like _getNextNode, but for DOM implementations with no - * firstElementChild/nextElementSibling functionality... - */ - _getNextNodeNoElementProperties: function(node, ignoreSelfAndKids) { - function nextSiblingEl(n) { - do { - n = n.nextSibling; - } while (n && n.nodeType !== n.ELEMENT_NODE); - return n; - } - // First check for kids if those aren't being ignored - if (!ignoreSelfAndKids && node.children[0]) { - return node.children[0]; - } - // Then for siblings... - var next = nextSiblingEl(node); - if (next) { - return next; - } - // And finally, move up the parent chain *and* find a sibling - // (because this is depth-first traversal, we will have already - // seen the parent nodes themselves). - do { - node = node.parentNode; - if (node) - next = nextSiblingEl(node); - } while (node && !next); - return node && next; - }, - _checkByline: function(node, matchString) { if (this._articleByline) { return false; @@ -751,6 +776,12 @@ Readability.prototype = { while (node) { var matchString = node.className + " " + node.id; + if (!this._isProbablyVisible(node)) { + this.log("Removing hidden node - " + matchString); + node = this._removeAndGetNext(node); + continue; + } + // Check to see if this node is a byline, and remove it if it is. if (this._checkByline(node, matchString)) { node = this._removeAndGetNext(node); @@ -784,11 +815,31 @@ Readability.prototype = { // Turn all divs that don't have children block level elements into p's if (node.tagName === "DIV") { + // Put phrasing content into paragraphs. + var p = null; + var childNode = node.firstChild; + while (childNode) { + var nextSibling = childNode.nextSibling; + if (this._isPhrasingContent(childNode)) { + if (p !== null) { + p.appendChild(childNode); + } else if (!this._isWhitespace(childNode)) { + p = doc.createElement('p'); + node.replaceChild(p, childNode); + p.appendChild(childNode); + } + } else if (p !== null) { + while (p.lastChild && this._isWhitespace(p.lastChild)) p.removeChild(p.lastChild); + p = null; + } + childNode = nextSibling; + } + // Sites like http://mobile.slate.com encloses each paragraph with a DIV // element. DIVs with only a P element inside and no text content can be // safely converted into plain P elements to avoid confusing the scoring // algorithm with DIVs with are, in practice, paragraphs. - if (this._hasSinglePInsideElement(node)) { + if (this._hasSingleTagInsideElement(node, "P") && this._getLinkDensity(node) < 0.25) { var newNode = node.children[0]; node.parentNode.replaceChild(newNode, node); node = newNode; @@ -796,17 +847,6 @@ Readability.prototype = { } else if (!this._hasChildBlockElement(node)) { node = this._setNodeTag(node, "P"); elementsToScore.push(node); - } else { - // EXPERIMENTAL - this._forEachNode(node.childNodes, function(childNode) { - if (childNode.nodeType === Node.TEXT_NODE && childNode.textContent.trim().length > 0) { - var p = doc.createElement('p'); - p.textContent = childNode.textContent; - p.style.display = 'inline'; - p.className = 'readability-styled'; - node.replaceChild(p, childNode); - } - }); } } node = this._getNextNode(node); @@ -846,7 +886,7 @@ Readability.prototype = { // Initialize and score ancestors. this._forEachNode(ancestors, function(ancestor, level) { - if (!ancestor.tagName) + if (!ancestor.tagName || !ancestor.parentNode || typeof(ancestor.parentNode.tagName) === 'undefined') return; if (typeof(ancestor.readability) === 'undefined') { @@ -1085,7 +1125,7 @@ Readability.prototype = { // finding the content, and the sieve approach gives us a higher likelihood of // finding the -right- content. var textLength = this._getInnerText(articleContent, true).length; - if (textLength < this._wordThreshold) { + if (textLength < this._charThreshold) { parseSuccessful = false; page.innerHTML = pageCacheHtml; @@ -1233,27 +1273,28 @@ Readability.prototype = { }, /** - * Check if this node has only whitespace and a single P element + * Check if this node has only whitespace and a single element with given tag * Returns false if the DIV node contains non-empty text nodes - * or if it contains no P or more than 1 element. + * or if it contains no element with given tag or more than 1 element. * * @param Element + * @param string tag of child element **/ - _hasSinglePInsideElement: function(element) { - // There should be exactly 1 element child which is a P: - if (element.children.length != 1 || element.children[0].tagName !== "P") { + _hasSingleTagInsideElement: function(element, tag) { + // There should be exactly 1 element child with given tag + if (element.children.length != 1 || element.children[0].tagName !== tag) { return false; } // And there should be no text nodes with real content return !this._someNode(element.childNodes, function(node) { - return node.nodeType === Node.TEXT_NODE && + return node.nodeType === this.TEXT_NODE && this.REGEXPS.hasContent.test(node.textContent); }); }, _isElementWithoutContent: function(node) { - return node.nodeType === Node.ELEMENT_NODE && + return node.nodeType === this.ELEMENT_NODE && node.textContent.trim().length == 0 && (node.children.length == 0 || node.children.length == node.getElementsByTagName("br").length + node.getElementsByTagName("hr").length); @@ -1271,6 +1312,21 @@ Readability.prototype = { }); }, + /*** + * Determine if a node qualifies as phrasing content. + * https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content + **/ + _isPhrasingContent: function(node) { + return node.nodeType === this.TEXT_NODE || this.PHRASING_ELEMS.indexOf(node.tagName) !== -1 || + ((node.tagName === "A" || node.tagName === "DEL" || node.tagName === "INS") && + this._everyNode(node.childNodes, this._isPhrasingContent)); + }, + + _isWhitespace: function(node) { + return (node.nodeType === this.TEXT_NODE && node.textContent.trim().length === 0) || + (node.nodeType === this.ELEMENT_NODE && node.tagName === "BR"); + }, + /** * Get the inner text of a node - cross browser compatibly. * This also strips out any excess whitespace to be found. @@ -1312,16 +1368,14 @@ Readability.prototype = { if (!e || e.tagName.toLowerCase() === 'svg') return; - if (e.className !== 'readability-styled') { - // Remove `style` and deprecated presentational attributes - for (var i = 0; i < this.PRESENTATIONAL_ATTRIBUTES.length; i++) { - e.removeAttribute(this.PRESENTATIONAL_ATTRIBUTES[i]); - } + // Remove `style` and deprecated presentational attributes + for (var i = 0; i < this.PRESENTATIONAL_ATTRIBUTES.length; i++) { + e.removeAttribute(this.PRESENTATIONAL_ATTRIBUTES[i]); + } - if (this.DEPRECATED_SIZE_ATTRIBUTE_ELEMS.indexOf(e.tagName) !== -1) { - e.removeAttribute('width'); - e.removeAttribute('height'); - } + if (this.DEPRECATED_SIZE_ATTRIBUTE_ELEMS.indexOf(e.tagName) !== -1) { + e.removeAttribute('width'); + e.removeAttribute('height'); } var cur = e.firstElementChild; @@ -1639,6 +1693,10 @@ Readability.prototype = { this._flags = this._flags & ~flag; }, + _isProbablyVisible: function(node) { + return node.style.display != "none" && !node.hasAttribute("hidden"); + }, + /** * Decides whether or not the document is reader-able without parsing the whole thing. * @@ -1663,9 +1721,9 @@ Readability.prototype = { nodes = [].concat.apply(Array.from(set), nodes); } - // FIXME we should have a fallback for helperIsVisible, but this is - // problematic because of jsdom's elem.style handling - see - // https://github.com/mozilla/readability/pull/186 for context. + if (!helperIsVisible) { + helperIsVisible = this._isProbablyVisible; + } var score = 0; // This is a little cheeky, we use the accumulator 'score' to decide what to return from @@ -1719,9 +1777,6 @@ Readability.prototype = { } } - if (typeof this._doc.documentElement.firstElementChild === "undefined") { - this._getNextNode = this._getNextNodeNoElementProperties; - } // Remove script tags from the document. this._removeScripts(this._doc); @@ -1750,7 +1805,6 @@ Readability.prototype = { var textContent = articleContent.textContent; return { - uri: this._uri, title: this._articleTitle, byline: metadata.byline || this._articleByline, dir: this._articleDir, diff --git a/toolkit/components/reader/ReaderMode.jsm b/toolkit/components/reader/ReaderMode.jsm index e9eb83154..218e12d60 100644 --- a/toolkit/components/reader/ReaderMode.jsm +++ b/toolkit/components/reader/ReaderMode.jsm @@ -195,7 +195,7 @@ this.ReaderMode = { // We pass in a helper function to determine if a node is visible, because // it uses gecko APIs that the engine-agnostic readability code can't rely // upon. - return new Readability(uri, doc).isProbablyReaderable(this.isNodeVisible.bind(this, utils)); + return new Readability(doc).isProbablyReaderable(this.isNodeVisible.bind(this, utils)); }, isNodeVisible(utils, node) { diff --git a/toolkit/components/reader/ReaderWorker.js b/toolkit/components/reader/ReaderWorker.js index 69426788b..9cc684e9b 100644 --- a/toolkit/components/reader/ReaderWorker.js +++ b/toolkit/components/reader/ReaderWorker.js @@ -48,6 +48,6 @@ var Agent = { */ parseDocument(uri, serializedDoc, options) { let doc = new JSDOMParser().parse(serializedDoc, uri.spec); - return new Readability(uri, doc, options).parse(); + return new Readability(doc, options).parse(); }, }; diff --git a/toolkit/components/search/current/nsSearchService.js b/toolkit/components/search/current/nsSearchService.js index 9f9003516..99e73b50b 100644 --- a/toolkit/components/search/current/nsSearchService.js +++ b/toolkit/components/search/current/nsSearchService.js @@ -21,8 +21,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch", - "resource://gre/modules/TelemetryStopwatch.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "SearchStaticData", "resource://gre/modules/SearchStaticData.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "setTimeout", @@ -3873,21 +3871,17 @@ SearchService.prototype = { LOG("SearchService.init"); let self = this; if (!this._initStarted) { - TelemetryStopwatch.start("SEARCH_SERVICE_INIT_MS"); this._initStarted = true; Task.spawn(function* task() { try { // Complete initialization by calling asynchronous initializer. yield self._asyncInit(); - TelemetryStopwatch.finish("SEARCH_SERVICE_INIT_MS"); } catch (ex) { if (ex.result == Cr.NS_ERROR_ALREADY_INITIALIZED) { // No need to pursue asynchronous because synchronous fallback was // called and has finished. - TelemetryStopwatch.finish("SEARCH_SERVICE_INIT_MS"); } else { self._initObservers.reject(ex); - TelemetryStopwatch.cancel("SEARCH_SERVICE_INIT_MS"); } } }); diff --git a/toolkit/components/search/moz.build b/toolkit/components/search/moz.build index 4cc86ff9e..2accffd00 100644 --- a/toolkit/components/search/moz.build +++ b/toolkit/components/search/moz.build @@ -6,10 +6,10 @@ XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini'] -if CONFIG['MC_PALEMOON']: - DIRS += ['orginal'] -else: +if CONFIG['MC_BASILISK'] or CONFIG['HYPE_ICEWEASEL'] or CONFIG['HYPE_ICEDOVE']: DIRS += ['current'] +else: + DIRS += ['orginal'] with Files('**'): BUG_COMPONENT = ('Firefox', 'Search') diff --git a/toolkit/components/search/orginal/nsSearchService.js b/toolkit/components/search/orginal/nsSearchService.js index 56d378b39..8d81e1a27 100644 --- a/toolkit/components/search/orginal/nsSearchService.js +++ b/toolkit/components/search/orginal/nsSearchService.js @@ -2237,7 +2237,10 @@ Engine.prototype = { get lazySerializeTask() { if (!this._lazySerializeTask) { let task = function taskCallback() { - this._serializeToFile(); + // This check should be done by caller, but it is better to be safe than sorry. + if (!this._readOnly && this._file) { + this._serializeToFile(); + } }.bind(this); this._lazySerializeTask = new DeferredTask(task, LAZY_SERIALIZE_DELAY); } @@ -2245,6 +2248,17 @@ Engine.prototype = { return this._lazySerializeTask; }, + // This API is required by some search engine management extensions, so let's restore it. + // Old API was using a timer to do its work, but this can lead us too far. If extension is + // rely on such subtle internal details, that extension should be fixed, not browser. + _lazySerializeToFile: function SRCH_ENG_lazySerializeToFile() { + // This check should be done by caller, but it is better to be safe than sorry. + // Besides, we don't have to create a task for r/o or non-file engines. + if (!this._readOnly && this._file) { + this.lazySerializeTask.arm(); + } + }, + /** * Serializes the engine object to file. */ @@ -3058,6 +3072,10 @@ SearchService.prototype = { continue; } + // Write out serialized search engine files when rebuilding cache. + // Do it lazily, to: 1) reuse existing API; 2) make browser interface more responsive + engine._lazySerializeToFile(); + let cacheKey = parent.path; if (!cache.directories[cacheKey]) { let cacheEntry = {}; diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp index 391389605..53f8c5670 100644 --- a/toolkit/components/startup/nsAppStartup.cpp +++ b/toolkit/components/startup/nsAppStartup.cpp @@ -758,11 +758,6 @@ nsAppStartup::GetStartupInfo(JSContext* aCx, JS::MutableHandle<JS::Value> aRetva procTime = TimeStamp::ProcessCreation(error); - if (error) { - Telemetry::Accumulate(Telemetry::STARTUP_MEASUREMENT_ERRORS, - StartupTimeline::PROCESS_CREATION); - } - StartupTimeline::Record(StartupTimeline::PROCESS_CREATION, procTime); } @@ -777,8 +772,6 @@ nsAppStartup::GetStartupInfo(JSContext* aCx, JS::MutableHandle<JS::Value> aRetva // Always define main to aid with bug 689256. stamp = procTime; MOZ_ASSERT(!stamp.IsNull()); - Telemetry::Accumulate(Telemetry::STARTUP_MEASUREMENT_ERRORS, - StartupTimeline::MAIN); } if (!stamp.IsNull()) { @@ -787,8 +780,6 @@ nsAppStartup::GetStartupInfo(JSContext* aCx, JS::MutableHandle<JS::Value> aRetva / PR_USEC_PER_MSEC; JS::Rooted<JSObject*> date(aCx, JS::NewDateObject(aCx, JS::TimeClip(prStamp))); JS_DefineProperty(aCx, obj, StartupTimeline::Describe(ev), date, JSPROP_ENUMERATE); - } else { - Telemetry::Accumulate(Telemetry::STARTUP_MEASUREMENT_ERRORS, ev); } } } @@ -887,9 +878,6 @@ nsAppStartup::TrackStartupCrashBegin(bool *aIsSafeModeNecessary) if (PR_Now() / PR_USEC_PER_SEC <= lastSuccessfulStartup) return NS_ERROR_FAILURE; - // The last startup was a crash so include it in the count regardless of when it happened. - Telemetry::Accumulate(Telemetry::STARTUP_CRASH_DETECTED, true); - if (inSafeMode) { GetAutomaticSafeModeNecessary(aIsSafeModeNecessary); return NS_OK; diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 7132c07b0..f61a67efc 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -2560,78 +2560,6 @@ "kind": "boolean", "description": "Rate of page load from offline cache" }, - "HTTP_CACHE_IO_QUEUE_2_OPEN_PRIORITY": { - "alert_emails": ["hbambas@mozilla.com"], - "bug_numbers": [1294183], - "expires_in_version": "55", - "kind": "enumerated", - "n_values": 10, - "description": "HTTP Cache IO queue length" - }, - "HTTP_CACHE_IO_QUEUE_2_READ_PRIORITY": { - "alert_emails": ["hbambas@mozilla.com"], - "bug_numbers": [1294183], - "expires_in_version": "55", - "kind": "enumerated", - "n_values": 10, - "description": "HTTP Cache IO queue length" - }, - "HTTP_CACHE_IO_QUEUE_2_MANAGEMENT": { - "alert_emails": ["hbambas@mozilla.com"], - "bug_numbers": [1294183], - "expires_in_version": "55", - "kind": "enumerated", - "n_values": 10, - "description": "HTTP Cache IO queue length" - }, - "HTTP_CACHE_IO_QUEUE_2_OPEN": { - "alert_emails": ["hbambas@mozilla.com"], - "bug_numbers": [1294183], - "expires_in_version": "55", - "kind": "enumerated", - "n_values": 10, - "description": "HTTP Cache IO queue length" - }, - "HTTP_CACHE_IO_QUEUE_2_READ": { - "alert_emails": ["hbambas@mozilla.com"], - "bug_numbers": [1294183], - "expires_in_version": "55", - "kind": "enumerated", - "n_values": 10, - "description": "HTTP Cache IO queue length" - }, - "HTTP_CACHE_IO_QUEUE_2_WRITE": { - "alert_emails": ["hbambas@mozilla.com"], - "bug_numbers": [1294183], - "expires_in_version": "55", - "kind": "enumerated", - "n_values": 10, - "description": "HTTP Cache IO queue length" - }, - "HTTP_CACHE_IO_QUEUE_2_WRITE_PRIORITY": { - "alert_emails": ["hbambas@mozilla.com"], - "bug_numbers": [1294183], - "expires_in_version": "55", - "kind": "enumerated", - "n_values": 10, - "description": "HTTP Cache IO queue length" - }, - "HTTP_CACHE_IO_QUEUE_2_INDEX": { - "alert_emails": ["hbambas@mozilla.com"], - "bug_numbers": [1294183], - "expires_in_version": "55", - "kind": "enumerated", - "n_values": 10, - "description": "HTTP Cache IO queue length" - }, - "HTTP_CACHE_IO_QUEUE_2_EVICT": { - "alert_emails": ["hbambas@mozilla.com"], - "bug_numbers": [1294183], - "expires_in_version": "55", - "kind": "enumerated", - "n_values": 10, - "description": "HTTP Cache IO queue length" - }, "CACHE_DEVICE_SEARCH_2": { "expires_in_version": "never", "kind": "exponential", @@ -8426,31 +8354,6 @@ "n_values": 7, "description": "Final status of the CacheFileInputStream (0=ok, 1=other error, 2=out of memory, 3=disk full, 4=file corrupted, 5=file not found, 6=binding aborted)" }, - "NETWORK_CACHE_FS_TYPE": { - "expires_in_version": "42", - "kind": "enumerated", - "n_values": 5, - "description": "Type of FS that the cache is stored on (0=NTFS (Win), 1=FAT32 (Win), 2=FAT (Win), 3=other FS (Win), 4=other OS)" - }, - "NETWORK_CACHE_SIZE_FULL_FAT": { - "expires_in_version": "42", - "kind": "linear", - "high": 500, - "n_buckets": 50, - "description": "Size (in MB) of a cache that reached a file count limit" - }, - "NETWORK_CACHE_HIT_MISS_STAT_PER_CACHE_SIZE": { - "expires_in_version": "never", - "kind": "enumerated", - "n_values": 40, - "description": "Hit/Miss count split by cache size in file count (0=Hit 0-5000, 1=Miss 0-5000, 2=Hit 5001-10000, ...)" - }, - "NETWORK_CACHE_HIT_RATE_PER_CACHE_SIZE": { - "expires_in_version": "never", - "kind": "enumerated", - "n_values": 400, - "description": "Hit rate for a specific cache size in file count. The hit rate is split into 20 buckets, the lower limit of the range in percents is 5*n/20. The cache size is divided into 20 ranges of length 5000, the lower limit of the range is 5000*(n%20)" - }, "NETWORK_CACHE_METADATA_FIRST_READ_TIME_MS": { "expires_in_version": "never", "kind": "exponential", @@ -8479,12 +8382,6 @@ "n_buckets": 256, "description": "Actual size of the metadata parsed from the disk." }, - "NETWORK_CACHE_HASH_STATS": { - "expires_in_version": "46", - "kind": "enumerated", - "n_values": 160, - "description": "The longest hash match between a newly added entry and all the existing entries." - }, "DATABASE_LOCKED_EXCEPTION": { "expires_in_version": "42", "kind": "enumerated", diff --git a/toolkit/components/telemetry/TelemetryStopwatch.jsm b/toolkit/components/telemetry/TelemetryStopwatch.jsm deleted file mode 100644 index ab6c6eafb..000000000 --- a/toolkit/components/telemetry/TelemetryStopwatch.jsm +++ /dev/null @@ -1,335 +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/. */ - -const Cc = Components.classes; -const Ci = Components.interfaces; -const Cu = Components.utils; - -this.EXPORTED_SYMBOLS = ["TelemetryStopwatch"]; - -Cu.import("resource://gre/modules/Log.jsm", this); -var Telemetry = Cc["@mozilla.org/base/telemetry;1"] - .getService(Ci.nsITelemetry); - -// Weak map does not allow using null objects as keys. These objects are used -// as 'null' placeholders. -const NULL_OBJECT = {}; -const NULL_KEY = {}; - -/** - * Timers is a variation of a Map used for storing information about running - * Stopwatches. Timers has the following data structure: - * - * { - * "HISTOGRAM_NAME": WeakMap { - * Object || NULL_OBJECT: Map { - * "KEY" || NULL_KEY: startTime - * ... - * } - * ... - * } - * ... - * } - * - * - * @example - * // Stores current time for a keyed histogram "PLAYING_WITH_CUTE_ANIMALS". - * Timers.put("PLAYING_WITH_CUTE_ANIMALS", null, "CATS", Date.now()); - * - * @example - * // Returns information about a simple Stopwatch. - * let startTime = Timers.get("PLAYING_WITH_CUTE_ANIMALS", null, "CATS"); - */ -let Timers = { - _timers: new Map(), - - _validTypes: function(histogram, obj, key) { - let nonEmptyString = value => { - return typeof value === "string" && value !== "" && value.length > 0; - }; - return nonEmptyString(histogram) && - typeof obj == "object" && - (key === NULL_KEY || nonEmptyString(key)); - }, - - get: function(histogram, obj, key) { - key = key === null ? NULL_KEY : key; - obj = obj || NULL_OBJECT; - - if (!this.has(histogram, obj, key)) { - return null; - } - - return this._timers.get(histogram).get(obj).get(key); - }, - - put: function(histogram, obj, key, startTime) { - key = key === null ? NULL_KEY : key; - obj = obj || NULL_OBJECT; - - if (!this._validTypes(histogram, obj, key)) { - return false; - } - - let objectMap = this._timers.get(histogram) || new WeakMap(); - let keyedInfo = objectMap.get(obj) || new Map(); - keyedInfo.set(key, startTime); - objectMap.set(obj, keyedInfo); - this._timers.set(histogram, objectMap); - return true; - }, - - has: function(histogram, obj, key) { - key = key === null ? NULL_KEY : key; - obj = obj || NULL_OBJECT; - - return this._timers.has(histogram) && - this._timers.get(histogram).has(obj) && - this._timers.get(histogram).get(obj).has(key); - }, - - delete: function(histogram, obj, key) { - key = key === null ? NULL_KEY : key; - obj = obj || NULL_OBJECT; - - if (!this.has(histogram, obj, key)) { - return false; - } - let objectMap = this._timers.get(histogram); - let keyedInfo = objectMap.get(obj); - if (keyedInfo.size > 1) { - keyedInfo.delete(key); - return true; - } - objectMap.delete(obj); - // NOTE: - // We never delete empty objecMaps from this._timers because there is no - // nice solution for tracking the number of objects in a WeakMap. - // WeakMap is not enumerable, so we can't deterministically say when it's - // empty. We accept that trade-off here, given that entries for short-lived - // objects will go away when they are no longer referenced - return true; - } -}; - -this.TelemetryStopwatch = { - /** - * Starts a timer associated with a telemetry histogram. The timer can be - * directly associated with a histogram, or with a pair of a histogram and - * an object. - * - * @param {String} aHistogram - a string which must be a valid histogram name. - * - * @param {Object} aObj - Optional parameter. If specified, the timer is - * associated with this object, meaning that multiple - * timers for the same histogram may be run - * concurrently, as long as they are associated with - * different objects. - * - * @returns {Boolean} True if the timer was successfully started, false - * otherwise. If a timer already exists, it can't be - * started again, and the existing one will be cleared in - * order to avoid measurements errors. - */ - start: function(aHistogram, aObj) { - return TelemetryStopwatchImpl.start(aHistogram, aObj, null); - }, - - /** - * Deletes the timer associated with a telemetry histogram. The timer can be - * directly associated with a histogram, or with a pair of a histogram and - * an object. Important: Only use this method when a legitimate cancellation - * should be done. - * - * @param {String} aHistogram - a string which must be a valid histogram name. - * - * @param {Object} aObj - Optional parameter. If specified, the timer is - * associated with this object, meaning that multiple - * timers or a same histogram may be run concurrently, - * as long as they are associated with different - * objects. - * - * @returns {Boolean} True if the timer exist and it was cleared, False - * otherwise. - */ - cancel: function(aHistogram, aObj) { - return TelemetryStopwatchImpl.cancel(aHistogram, aObj, null); - }, - - /** - * Returns the elapsed time for a particular stopwatch. Primarily for - * debugging purposes. Must be called prior to finish. - * - * @param {String} aHistogram - a string which must be a valid histogram name. - * If an invalid name is given, the function will - * throw. - * - * @param (Object) aObj - Optional parameter which associates the histogram - * timer with the given object. - * - * @returns {Integer} time in milliseconds or -1 if the stopwatch was not - * found. - */ - timeElapsed: function(aHistogram, aObj) { - return TelemetryStopwatchImpl.timeElapsed(aHistogram, aObj, null); - }, - - /** - * Stops the timer associated with the given histogram (and object), - * calculates the time delta between start and finish, and adds the value - * to the histogram. - * - * @param {String} aHistogram - a string which must be a valid histogram name. - * - * @param {Object} aObj - Optional parameter which associates the histogram - * timer with the given object. - * - * @returns {Boolean} True if the timer was succesfully stopped and the data - * was added to the histogram, False otherwise. - */ - finish: function(aHistogram, aObj) { - return TelemetryStopwatchImpl.finish(aHistogram, aObj, null); - }, - - /** - * Starts a timer associated with a keyed telemetry histogram. The timer can - * be directly associated with a histogram and its key. Similarly to - * @see{TelemetryStopwatch.stat} the histogram and its key can be associated - * with an object. Each key may have multiple associated objects and each - * object can be associated with multiple keys. - * - * @param {String} aHistogram - a string which must be a valid histogram name. - * - * @param {String} aKey - a string which must be a valid histgram key. - * - * @param {Object} aObj - Optional parameter. If specified, the timer is - * associated with this object, meaning that multiple - * timers for the same histogram may be run - * concurrently,as long as they are associated with - * different objects. - * - * @returns {Boolean} True if the timer was successfully started, false - * otherwise. If a timer already exists, it can't be - * started again, and the existing one will be cleared in - * order to avoid measurements errors. - */ - startKeyed: function(aHistogram, aKey, aObj) { - return TelemetryStopwatchImpl.start(aHistogram, aObj, aKey); - }, - - /** - * Deletes the timer associated with a keyed histogram. Important: Only use - * this method when a legitimate cancellation should be done. - * - * @param {String} aHistogram - a string which must be a valid histogram name. - * - * @param {String} aKey - a string which must be a valid histgram key. - * - * @param {Object} aObj - Optional parameter. If specified, the timer - * associated with this object is deleted. - * - * @return {Boolean} True if the timer exist and it was cleared, False - * otherwise. - */ - cancelKeyed: function(aHistogram, aKey, aObj) { - return TelemetryStopwatchImpl.cancel(aHistogram, aObj, aKey); - }, - - /** - * Returns the elapsed time for a particular stopwatch. Primarily for - * debugging purposes. Must be called prior to finish. - * - * @param {String} aHistogram - a string which must be a valid histogram name. - * - * @param {String} aKey - a string which must be a valid histgram key. - * - * @param {Object} aObj - Optional parameter. If specified, the timer - * associated with this object is used to calculate - * the elapsed time. - * - * @return {Integer} time in milliseconds or -1 if the stopwatch was not - * found. - */ - timeElapsedKeyed: function(aHistogram, aKey, aObj) { - return TelemetryStopwatchImpl.timeElapsed(aHistogram, aObj, aKey); - }, - - /** - * Stops the timer associated with the given keyed histogram (and object), - * calculates the time delta between start and finish, and adds the value - * to the keyed histogram. - * - * @param {String} aHistogram - a string which must be a valid histogram name. - * - * @param {String} aKey - a string which must be a valid histgram key. - * - * @param {Object} aObj - optional parameter which associates the histogram - * timer with the given object. - * - * @returns {Boolean} True if the timer was succesfully stopped and the data - * was added to the histogram, False otherwise. - */ - finishKeyed: function(aHistogram, aKey, aObj) { - return TelemetryStopwatchImpl.finish(aHistogram, aObj, aKey); - } -}; - -this.TelemetryStopwatchImpl = { - start: function(histogram, object, key) { - if (Timers.has(histogram, object, key)) { - Timers.delete(histogram, object, key); - Cu.reportError(`TelemetryStopwatch: key "${histogram}" was already ` + - "initialized"); - return false; - } - - return Timers.put(histogram, object, key, Components.utils.now()); - }, - - cancel: function (histogram, object, key) { - return Timers.delete(histogram, object, key); - }, - - timeElapsed: function(histogram, object, key) { - let startTime = Timers.get(histogram, object, key); - if (startTime === null) { - Cu.reportError("TelemetryStopwatch: requesting elapsed time for " + - `nonexisting stopwatch. Histogram: "${histogram}", ` + - `key: "${key}"`); - return -1; - } - - try { - let delta = Components.utils.now() - startTime - return Math.round(delta); - } catch (e) { - Cu.reportError("TelemetryStopwatch: failed to calculate elapsed time " + - `for Histogram: "${histogram}", key: "${key}", ` + - `exception: ${Log.exceptionStr(e)}`); - return -1; - } - }, - - finish: function(histogram, object, key) { - let delta = this.timeElapsed(histogram, object, key); - if (delta == -1) { - return false; - } - - try { - if (key) { - Telemetry.getKeyedHistogramById(histogram).add(key, delta); - } else { - Telemetry.getHistogramById(histogram).add(delta); - } - } catch (e) { - Cu.reportError("TelemetryStopwatch: failed to update the Histogram " + - `"${histogram}", using key: "${key}", ` + - `exception: ${Log.exceptionStr(e)}`); - return false; - } - - return Timers.delete(histogram, object, key); - } -} diff --git a/toolkit/components/telemetry/histogram-whitelists.json b/toolkit/components/telemetry/histogram-whitelists.json index deb1bd5b3..529d9f4d5 100644 --- a/toolkit/components/telemetry/histogram-whitelists.json +++ b/toolkit/components/telemetry/histogram-whitelists.json @@ -429,15 +429,10 @@ "MOZ_SQLITE_WEBAPPS_WRITE_B", "MOZ_SQLITE_WEBAPPS_WRITE_MAIN_THREAD_MS", "MOZ_SQLITE_WEBAPPS_WRITE_MS", - "NETWORK_CACHE_FS_TYPE", - "NETWORK_CACHE_HASH_STATS", - "NETWORK_CACHE_HIT_MISS_STAT_PER_CACHE_SIZE", - "NETWORK_CACHE_HIT_RATE_PER_CACHE_SIZE", "NETWORK_CACHE_METADATA_FIRST_READ_SIZE", "NETWORK_CACHE_METADATA_FIRST_READ_TIME_MS", "NETWORK_CACHE_METADATA_SECOND_READ_TIME_MS", "NETWORK_CACHE_METADATA_SIZE", - "NETWORK_CACHE_SIZE_FULL_FAT", "NETWORK_CACHE_V1_HIT_TIME_MS", "NETWORK_CACHE_V1_MISS_TIME_MS", "NETWORK_CACHE_V1_TRUNCATE_TIME_MS", @@ -1276,15 +1271,10 @@ "MOZ_SQLITE_WEBAPPS_WRITE_MS", "MOZ_STORAGE_ASYNC_REQUESTS_MS", "MOZ_STORAGE_ASYNC_REQUESTS_SUCCESS", - "NETWORK_CACHE_FS_TYPE", - "NETWORK_CACHE_HASH_STATS", - "NETWORK_CACHE_HIT_MISS_STAT_PER_CACHE_SIZE", - "NETWORK_CACHE_HIT_RATE_PER_CACHE_SIZE", "NETWORK_CACHE_METADATA_FIRST_READ_SIZE", "NETWORK_CACHE_METADATA_FIRST_READ_TIME_MS", "NETWORK_CACHE_METADATA_SECOND_READ_TIME_MS", "NETWORK_CACHE_METADATA_SIZE", - "NETWORK_CACHE_SIZE_FULL_FAT", "NETWORK_CACHE_V1_HIT_TIME_MS", "NETWORK_CACHE_V1_MISS_TIME_MS", "NETWORK_CACHE_V1_TRUNCATE_TIME_MS", @@ -1862,10 +1852,8 @@ "DEVTOOLS_READ_HEAP_SNAPSHOT_MS", "DEVTOOLS_HEAP_SNAPSHOT_NODE_COUNT", "DEVTOOLS_HEAP_SNAPSHOT_EDGE_COUNT", - "NETWORK_CACHE_HIT_RATE_PER_CACHE_SIZE", "NETWORK_CACHE_METADATA_FIRST_READ_SIZE", "NETWORK_CACHE_METADATA_SIZE", - "NETWORK_CACHE_HASH_STATS", "SSL_CIPHER_SUITE_FULL", "SSL_CIPHER_SUITE_RESUMED", "SSL_HANDSHAKE_RESULT", diff --git a/toolkit/components/telemetry/moz.build b/toolkit/components/telemetry/moz.build index 118d61b71..7765c59b4 100644 --- a/toolkit/components/telemetry/moz.build +++ b/toolkit/components/telemetry/moz.build @@ -64,7 +64,6 @@ EXTRA_JS_MODULES += [ 'TelemetryReportingPolicy.jsm', 'TelemetrySend.jsm', 'TelemetrySession.jsm', - 'TelemetryStopwatch.jsm', 'TelemetryStorage.jsm', 'TelemetryTimestamps.jsm', 'TelemetryUtils.jsm', diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryStopwatch.js b/toolkit/components/telemetry/tests/unit/test_TelemetryStopwatch.js deleted file mode 100644 index d162d9b17..000000000 --- a/toolkit/components/telemetry/tests/unit/test_TelemetryStopwatch.js +++ /dev/null @@ -1,156 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -var tmpScope = {}; -Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", tmpScope); -var TelemetryStopwatch = tmpScope.TelemetryStopwatch; - -const HIST_NAME = "TELEMETRY_SEND_SUCCESS"; -const HIST_NAME2 = "RANGE_CHECKSUM_ERRORS"; -const KEYED_HIST = { id: "TELEMETRY_INVALID_PING_TYPE_SUBMITTED", key: "TEST" }; - -var refObj = {}, refObj2 = {}; - -var originalCount1, originalCount2; - -function run_test() { - let histogram = Telemetry.getHistogramById(HIST_NAME); - let snapshot = histogram.snapshot(); - originalCount1 = snapshot.counts.reduce((a, b) => a += b); - - histogram = Telemetry.getHistogramById(HIST_NAME2); - snapshot = histogram.snapshot(); - originalCount2 = snapshot.counts.reduce((a, b) => a += b); - - histogram = Telemetry.getKeyedHistogramById(KEYED_HIST.id); - snapshot = histogram.snapshot(KEYED_HIST.key); - originalCount3 = snapshot.counts.reduce((a, b) => a += b); - - do_check_false(TelemetryStopwatch.start(3)); - do_check_false(TelemetryStopwatch.start({})); - do_check_false(TelemetryStopwatch.start("", 3)); - do_check_false(TelemetryStopwatch.start("", "")); - do_check_false(TelemetryStopwatch.start({}, {})); - - do_check_true(TelemetryStopwatch.start("mark1")); - do_check_true(TelemetryStopwatch.start("mark2")); - - do_check_true(TelemetryStopwatch.start("mark1", refObj)); - do_check_true(TelemetryStopwatch.start("mark2", refObj)); - - // Same timer can't be re-started before being stopped - do_check_false(TelemetryStopwatch.start("mark1")); - do_check_false(TelemetryStopwatch.start("mark1", refObj)); - - // Can't stop a timer that was accidentaly started twice - do_check_false(TelemetryStopwatch.finish("mark1")); - do_check_false(TelemetryStopwatch.finish("mark1", refObj)); - - do_check_true(TelemetryStopwatch.start("NON-EXISTENT_HISTOGRAM")); - do_check_false(TelemetryStopwatch.finish("NON-EXISTENT_HISTOGRAM")); - - do_check_true(TelemetryStopwatch.start("NON-EXISTENT_HISTOGRAM", refObj)); - do_check_false(TelemetryStopwatch.finish("NON-EXISTENT_HISTOGRAM", refObj)); - - do_check_true(TelemetryStopwatch.start(HIST_NAME)); - do_check_true(TelemetryStopwatch.start(HIST_NAME2)); - do_check_true(TelemetryStopwatch.start(HIST_NAME, refObj)); - do_check_true(TelemetryStopwatch.start(HIST_NAME2, refObj)); - do_check_true(TelemetryStopwatch.start(HIST_NAME, refObj2)); - do_check_true(TelemetryStopwatch.start(HIST_NAME2, refObj2)); - - do_check_true(TelemetryStopwatch.finish(HIST_NAME)); - do_check_true(TelemetryStopwatch.finish(HIST_NAME2)); - do_check_true(TelemetryStopwatch.finish(HIST_NAME, refObj)); - do_check_true(TelemetryStopwatch.finish(HIST_NAME2, refObj)); - do_check_true(TelemetryStopwatch.finish(HIST_NAME, refObj2)); - do_check_true(TelemetryStopwatch.finish(HIST_NAME2, refObj2)); - - // Verify that TS.finish deleted the timers - do_check_false(TelemetryStopwatch.finish(HIST_NAME)); - do_check_false(TelemetryStopwatch.finish(HIST_NAME, refObj)); - - // Verify that they can be used again - do_check_true(TelemetryStopwatch.start(HIST_NAME)); - do_check_true(TelemetryStopwatch.start(HIST_NAME, refObj)); - do_check_true(TelemetryStopwatch.finish(HIST_NAME)); - do_check_true(TelemetryStopwatch.finish(HIST_NAME, refObj)); - - do_check_false(TelemetryStopwatch.finish("unknown-mark")); // Unknown marker - do_check_false(TelemetryStopwatch.finish("unknown-mark", {})); // Unknown object - do_check_false(TelemetryStopwatch.finish(HIST_NAME, {})); // Known mark on unknown object - - // Test cancel - do_check_true(TelemetryStopwatch.start(HIST_NAME)); - do_check_true(TelemetryStopwatch.start(HIST_NAME, refObj)); - do_check_true(TelemetryStopwatch.cancel(HIST_NAME)); - do_check_true(TelemetryStopwatch.cancel(HIST_NAME, refObj)); - - // Verify that can not cancel twice - do_check_false(TelemetryStopwatch.cancel(HIST_NAME)); - do_check_false(TelemetryStopwatch.cancel(HIST_NAME, refObj)); - - // Verify that cancel removes the timers - do_check_false(TelemetryStopwatch.finish(HIST_NAME)); - do_check_false(TelemetryStopwatch.finish(HIST_NAME, refObj)); - - // Verify that keyed stopwatch reject invalid keys. - for (let key of [3, {}, ""]) { - do_check_false(TelemetryStopwatch.startKeyed(KEYED_HIST.id, key)); - } - - // Verify that keyed histograms can be started. - do_check_true(TelemetryStopwatch.startKeyed("HISTOGRAM", "KEY1")); - do_check_true(TelemetryStopwatch.startKeyed("HISTOGRAM", "KEY2")); - do_check_true(TelemetryStopwatch.startKeyed("HISTOGRAM", "KEY1", refObj)); - do_check_true(TelemetryStopwatch.startKeyed("HISTOGRAM", "KEY2", refObj)); - - // Restarting keyed histograms should fail. - do_check_false(TelemetryStopwatch.startKeyed("HISTOGRAM", "KEY1")); - do_check_false(TelemetryStopwatch.startKeyed("HISTOGRAM", "KEY1", refObj)); - - // Finishing a stopwatch of a non existing histogram should return false. - do_check_false(TelemetryStopwatch.finishKeyed("HISTOGRAM", "KEY2")); - do_check_false(TelemetryStopwatch.finishKeyed("HISTOGRAM", "KEY2", refObj)); - - // Starting & finishing a keyed stopwatch for an existing histogram should work. - do_check_true(TelemetryStopwatch.startKeyed(KEYED_HIST.id, KEYED_HIST.key)); - do_check_true(TelemetryStopwatch.finishKeyed(KEYED_HIST.id, KEYED_HIST.key)); - // Verify that TS.finish deleted the timers - do_check_false(TelemetryStopwatch.finishKeyed(KEYED_HIST.id, KEYED_HIST.key)); - - // Verify that they can be used again - do_check_true(TelemetryStopwatch.startKeyed(KEYED_HIST.id, KEYED_HIST.key)); - do_check_true(TelemetryStopwatch.finishKeyed(KEYED_HIST.id, KEYED_HIST.key)); - - do_check_false(TelemetryStopwatch.finishKeyed("unknown-mark", "unknown-key")); - do_check_false(TelemetryStopwatch.finishKeyed(KEYED_HIST.id, "unknown-key")); - - // Verify that keyed histograms can only be canceled through "keyed" API. - do_check_true(TelemetryStopwatch.startKeyed(KEYED_HIST.id, KEYED_HIST.key)); - do_check_false(TelemetryStopwatch.cancel(KEYED_HIST.id, KEYED_HIST.key)); - do_check_true(TelemetryStopwatch.cancelKeyed(KEYED_HIST.id, KEYED_HIST.key)); - do_check_false(TelemetryStopwatch.cancelKeyed(KEYED_HIST.id, KEYED_HIST.key)); - - finishTest(); -} - -function finishTest() { - let histogram = Telemetry.getHistogramById(HIST_NAME); - let snapshot = histogram.snapshot(); - let newCount = snapshot.counts.reduce((a, b) => a += b); - - do_check_eq(newCount - originalCount1, 5, "The correct number of histograms were added for histogram 1."); - - histogram = Telemetry.getHistogramById(HIST_NAME2); - snapshot = histogram.snapshot(); - newCount = snapshot.counts.reduce((a, b) => a += b); - - do_check_eq(newCount - originalCount2, 3, "The correct number of histograms were added for histogram 2."); - - histogram = Telemetry.getKeyedHistogramById(KEYED_HIST.id); - snapshot = histogram.snapshot(KEYED_HIST.key); - newCount = snapshot.counts.reduce((a, b) => a += b); - - do_check_eq(newCount - originalCount3, 2, "The correct number of histograms were added for histogram 3."); -} diff --git a/toolkit/components/telemetry/tests/unit/xpcshell.ini b/toolkit/components/telemetry/tests/unit/xpcshell.ini index 42354c4cd..224516f57 100644 --- a/toolkit/components/telemetry/tests/unit/xpcshell.ini +++ b/toolkit/components/telemetry/tests/unit/xpcshell.ini @@ -41,7 +41,6 @@ tags = addons [test_TelemetryController_idle.js] [test_TelemetryControllerShutdown.js] tags = addons -[test_TelemetryStopwatch.js] [test_TelemetryControllerBuildID.js] [test_TelemetrySendOldPings.js] skip-if = os == "android" # Disabled due to intermittent orange on Android diff --git a/toolkit/components/thumbnails/test/test_thumbnails_interfaces.js b/toolkit/components/thumbnails/test/test_thumbnails_interfaces.js index 8272b2e06..a8fe51418 100644 --- a/toolkit/components/thumbnails/test/test_thumbnails_interfaces.js +++ b/toolkit/components/thumbnails/test/test_thumbnails_interfaces.js @@ -22,10 +22,4 @@ function run_test() { null, null); ok(uri instanceof Ci.nsIFileURL, "moz-page-thumb:// is a FileURL"); ok(uri.file, "This moz-page-thumb:// object is backed by a file"); - - // and check that the error case works as specified - let bad = Services.io.newURI("moz-page-thumb://wronghost/?url=http%3A%2F%2Fwww.mozilla.org%2F", - null, null); - Assert.throws(() => handler.resolveURI(bad), /NS_ERROR_NOT_AVAILABLE/i, - "moz-page-thumb object with wrong host must not resolve to a file path"); } diff --git a/toolkit/components/url-classifier/Classifier.cpp b/toolkit/components/url-classifier/Classifier.cpp index bbaeaf535..b9d0ace1b 100644 --- a/toolkit/components/url-classifier/Classifier.cpp +++ b/toolkit/components/url-classifier/Classifier.cpp @@ -15,7 +15,6 @@ #include "nsNetCID.h" #include "nsPrintfCString.h" #include "nsThreadUtils.h" -#include "mozilla/Telemetry.h" #include "mozilla/Logging.h" #include "mozilla/SyncRunnable.h" #include "mozilla/Base64.h" @@ -413,8 +412,6 @@ Classifier::Check(const nsACString& aSpec, uint32_t aFreshnessGuarantee, LookupResultArray& aResults) { - Telemetry::AutoTimer<Telemetry::URLCLASSIFIER_CL_CHECK_TIME> timer; - // Get the set of fragments based on the url. This is necessary because we // only look up at most 5 URLs per aSpec, even if aSpec has more than 5 // components. @@ -498,9 +495,6 @@ Classifier::Check(const nsACString& aSpec, matchingStatistics |= PrefixMatch::eMatchV2Prefix; } } - - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_PREFIX_MATCH, - static_cast<uint8_t>(matchingStatistics)); } return NS_OK; @@ -509,8 +503,6 @@ Classifier::Check(const nsACString& aSpec, nsresult Classifier::ApplyUpdates(nsTArray<TableUpdate*>* aUpdates) { - Telemetry::AutoTimer<Telemetry::URLCLASSIFIER_CL_UPDATE_TIME> timer; - PRIntervalTime clockStart = 0; if (LOG_ENABLED()) { clockStart = PR_IntervalNow(); diff --git a/toolkit/components/url-classifier/LookupCache.cpp b/toolkit/components/url-classifier/LookupCache.cpp index 5a3b1e36d..7c4d7682b 100644 --- a/toolkit/components/url-classifier/LookupCache.cpp +++ b/toolkit/components/url-classifier/LookupCache.cpp @@ -6,7 +6,6 @@ #include "LookupCache.h" #include "HashStore.h" #include "nsISeekableStream.h" -#include "mozilla/Telemetry.h" #include "mozilla/Logging.h" #include "nsNetUtil.h" #include "prprf.h" @@ -451,9 +450,6 @@ nsresult LookupCacheV2::Build(AddPrefixArray& aAddPrefixes, AddCompleteArray& aAddCompletes) { - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_LC_COMPLETIONS, - static_cast<uint32_t>(aAddCompletes.Length())); - mUpdateCompletions.Clear(); mUpdateCompletions.SetCapacity(aAddCompletes.Length()); for (uint32_t i = 0; i < aAddCompletes.Length(); i++) { @@ -462,9 +458,6 @@ LookupCacheV2::Build(AddPrefixArray& aAddPrefixes, aAddCompletes.Clear(); mUpdateCompletions.Sort(); - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_LC_PREFIXES, - static_cast<uint32_t>(aAddPrefixes.Length())); - nsresult rv = ConstructPrefixSet(aAddPrefixes); NS_ENSURE_SUCCESS(rv, rv); mPrimed = true; @@ -548,8 +541,6 @@ static void EnsureSorted(T* aArray) nsresult LookupCacheV2::ConstructPrefixSet(AddPrefixArray& aAddPrefixes) { - Telemetry::AutoTimer<Telemetry::URLCLASSIFIER_PS_CONSTRUCT_TIME> timer; - nsTArray<uint32_t> array; if (!array.SetCapacity(aAddPrefixes.Length(), fallible)) { return NS_ERROR_OUT_OF_MEMORY; diff --git a/toolkit/components/url-classifier/LookupCacheV4.cpp b/toolkit/components/url-classifier/LookupCacheV4.cpp index 7258ae358..a96e4931a 100644 --- a/toolkit/components/url-classifier/LookupCacheV4.cpp +++ b/toolkit/components/url-classifier/LookupCacheV4.cpp @@ -144,9 +144,6 @@ LookupCacheV4::LoadFromFile(nsIFile* aFile) } rv = VerifyChecksum(checksum); - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_VLPS_LOAD_CORRUPT, - rv == NS_ERROR_FILE_CORRUPTED); - return rv; } @@ -231,8 +228,6 @@ LookupCacheV4::ApplyUpdate(TableUpdateV4* aTableUpdate, if (!isOldMapEmpty && !isAddMapEmpty) { if (smallestOldPrefix == smallestAddPrefix) { LOG(("Add prefix should not exist in the original prefix set.")); - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR_TYPE, - DUPLICATE_PREFIX); return NS_ERROR_FAILURE; } @@ -274,15 +269,11 @@ LookupCacheV4::ApplyUpdate(TableUpdateV4* aTableUpdate, // the number of original prefix plus add prefix. if (index <= 0) { LOG(("There are still prefixes remaining after reaching maximum runs.")); - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR_TYPE, - INFINITE_LOOP); return NS_ERROR_FAILURE; } if (removalIndex < removalArray.Length()) { LOG(("There are still prefixes to remove after exhausting the old PrefixSet.")); - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR_TYPE, - WRONG_REMOVAL_INDICES); return NS_ERROR_FAILURE; } @@ -290,8 +281,6 @@ LookupCacheV4::ApplyUpdate(TableUpdateV4* aTableUpdate, crypto->Finish(false, checksum); if (aTableUpdate->Checksum().IsEmpty()) { LOG(("Update checksum missing.")); - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR_TYPE, - MISSING_CHECKSUM); // Generate our own checksum to tableUpdate to ensure there is always // checksum in .metadata @@ -300,8 +289,6 @@ LookupCacheV4::ApplyUpdate(TableUpdateV4* aTableUpdate, } else if (aTableUpdate->Checksum() != checksum){ LOG(("Checksum mismatch after applying partial update")); - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR_TYPE, - CHECKSUM_MISMATCH); return NS_ERROR_FAILURE; } diff --git a/toolkit/components/url-classifier/VariableLengthPrefixSet.cpp b/toolkit/components/url-classifier/VariableLengthPrefixSet.cpp index e9d6770d3..a387a698c 100644 --- a/toolkit/components/url-classifier/VariableLengthPrefixSet.cpp +++ b/toolkit/components/url-classifier/VariableLengthPrefixSet.cpp @@ -209,8 +209,6 @@ VariableLengthPrefixSet::LoadFromFile(nsIFile* aFile) NS_ENSURE_ARG_POINTER(aFile); - Telemetry::AutoTimer<Telemetry::URLCLASSIFIER_VLPS_FILELOAD_TIME> timer; - nsCOMPtr<nsIInputStream> localInFile; nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(localInFile), aFile, PR_RDONLY | nsIFile::OS_READAHEAD); @@ -255,15 +253,12 @@ VariableLengthPrefixSet::StoreToFile(nsIFile* aFile) uint32_t fileSize = 0; // Preallocate the file storage - { - nsCOMPtr<nsIFileOutputStream> fos(do_QueryInterface(localOutFile)); - Telemetry::AutoTimer<Telemetry::URLCLASSIFIER_VLPS_FALLOCATE_TIME> timer; + nsCOMPtr<nsIFileOutputStream> fos(do_QueryInterface(localOutFile)); - fileSize += mFixedPrefixSet->CalculatePreallocateSize(); - fileSize += CalculatePreallocateSize(); + fileSize += mFixedPrefixSet->CalculatePreallocateSize(); + fileSize += CalculatePreallocateSize(); - Unused << fos->Preallocate(fileSize); - } + Unused << fos->Preallocate(fileSize); // Convert to buffered stream nsCOMPtr<nsIOutputStream> out = diff --git a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp index 2ad8b6b51..d3018aa2d 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp @@ -37,7 +37,6 @@ #include "mozilla/Mutex.h" #include "mozilla/Preferences.h" #include "mozilla/TimeStamp.h" -#include "mozilla/Telemetry.h" #include "mozilla/Logging.h" #include "prprf.h" #include "prnetdb.h" @@ -320,9 +319,6 @@ nsUrlClassifierDBServiceWorker::HandlePendingLookups() MutexAutoUnlock unlock(mPendingLookupLock); DoLookup(lookup.mKey, lookup.mTables, lookup.mCallback); } - double lookupTime = (TimeStamp::Now() - lookup.mStartTime).ToMilliseconds(); - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_LOOKUP_TIME, - static_cast<uint32_t>(lookupTime)); } return NS_OK; @@ -1818,8 +1814,6 @@ nsUrlClassifierDBService::Shutdown() gShuttingDownThread = true; - Telemetry::AutoTimer<Telemetry::URLCLASSIFIER_SHUTDOWN_TIME> timer; - mCompleters.Clear(); nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); diff --git a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp index 874565470..3cfdf7a35 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp @@ -315,8 +315,6 @@ nsUrlClassifierPrefixSet::LoadFromFile(nsIFile* aFile) { MutexAutoLock lock(mLock); - Telemetry::AutoTimer<Telemetry::URLCLASSIFIER_PS_FILELOAD_TIME> timer; - nsCOMPtr<nsIInputStream> localInFile; nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(localInFile), aFile, PR_RDONLY | nsIFile::OS_READAHEAD); @@ -356,17 +354,13 @@ nsUrlClassifierPrefixSet::StoreToFile(nsIFile* aFile) uint32_t fileSize; - // Preallocate the file storage - { - nsCOMPtr<nsIFileOutputStream> fos(do_QueryInterface(localOutFile)); - Telemetry::AutoTimer<Telemetry::URLCLASSIFIER_PS_FALLOCATE_TIME> timer; + nsCOMPtr<nsIFileOutputStream> fos(do_QueryInterface(localOutFile)); - fileSize = CalculatePreallocateSize(); + fileSize = CalculatePreallocateSize(); - // Ignore failure, the preallocation is a hint and we write out the entire - // file later on - Unused << fos->Preallocate(fileSize); - } + // Ignore failure, the preallocation is a hint and we write out the entire + // file later on + Unused << fos->Preallocate(fileSize); // Convert to buffered stream nsCOMPtr<nsIOutputStream> out = diff --git a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp index 554bff342..e230f6951 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp @@ -646,9 +646,6 @@ nsUrlClassifierStreamUpdater::OnStartRequest(nsIRequest *request, if (NS_FAILED(status)) { // Assume we're overloading the server and trigger backoff. downloadError = true; - mozilla::Telemetry::Accumulate(mozilla::Telemetry::URLCLASSIFIER_UPDATE_REMOTE_STATUS, - 15 /* unknown response code */); - } else { bool succeeded = false; rv = httpChannel->GetRequestSucceeded(&succeeded); @@ -657,8 +654,6 @@ nsUrlClassifierStreamUpdater::OnStartRequest(nsIRequest *request, uint32_t requestStatus; rv = httpChannel->GetResponseStatus(&requestStatus); NS_ENSURE_SUCCESS(rv, rv); - mozilla::Telemetry::Accumulate(mozilla::Telemetry::URLCLASSIFIER_UPDATE_REMOTE_STATUS, - HTTPStatusToBucket(requestStatus)); LOG(("nsUrlClassifierStreamUpdater::OnStartRequest %s (%d)", succeeded ? "succeeded" : "failed", requestStatus)); if (!succeeded) { diff --git a/toolkit/content/browser-content.js b/toolkit/content/browser-content.js index 2276f8a0d..e1114672c 100644 --- a/toolkit/content/browser-content.js +++ b/toolkit/content/browser-content.js @@ -841,6 +841,35 @@ var FindBar = { fakeEvent[k] = event[k]; } } +#ifdef MC_PALEMOON + let findBarId = "FindToolbar"; + // The FindBar is in the chrome window's context, not in tabbrowser + // - see also bug 537013 + let chromeWin = null; + try { + chromeWin = content + .QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIWebNavigation) + .QueryInterface(Ci.nsIDocShellTreeItem) + .rootTreeItem + .QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIDOMWindow) + .QueryInterface(Ci.nsIDOMChromeWindow); + } catch (e) { + Cu.reportError( + "The FindBar - the chrome window's context was not detected:\n" + e); + } + if (chromeWin && chromeWin.document.getElementById(findBarId)) { + try { + chromeWin.document.getElementById(findBarId) + .browser = Services.wm.getMostRecentWindow("navigator:browser") + .gBrowser.mCurrentBrowser; + } catch (e) { + Cu.reportError( + "The FindBar - cannot set the property 'browser':\n" + e); + } + } +#endif // sendSyncMessage returns an array of the responses from all listeners let rv = sendSyncMessage("Findbar:Keypress", { diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn index e1d432cb3..c11d3abed 100644 --- a/toolkit/content/jar.mn +++ b/toolkit/content/jar.mn @@ -39,7 +39,7 @@ toolkit.jar: content/global/plugins.html content/global/plugins.css content/global/browser-child.js - content/global/browser-content.js +* content/global/browser-content.js * content/global/buildconfig.html content/global/contentAreaUtils.js #ifndef MOZ_FENNEC diff --git a/toolkit/content/license.html b/toolkit/content/license.html index a348fdfa6..7221a8ae2 100644 --- a/toolkit/content/license.html +++ b/toolkit/content/license.html @@ -97,6 +97,7 @@ <li><a href="about:license#gears">Google Gears License</a></li> <li><a href="about:license#gears-istumbler">Google Gears/iStumbler License</a></li> <li><a href="about:license#vp8">Google VP8 License</a></li> + <li><a href="about:license#gsl">GSL License</a></li> <li><a href="about:license#gyp">gyp License</a></li> <li><a href="about:license#halloc">halloc License</a></li> <li><a href="about:license#harfbuzz">HarfBuzz License</a></li> @@ -3285,6 +3286,38 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <hr> + <h1><a id="gsl"></a>GSL License</h1> + + <p>This license applies to <span class="path">mfbt/Span.h</span> and + <span class="path">mfbt/tests/gtest/TestSpan.cpp</span>.</p> + <!-- https://github.com/Microsoft/GSL/blob/3819df6e378ffccf0e29465afe99c3b324c2aa70/LICENSE --> +<pre> +Copyright (c) 2015 Microsoft Corporation. All rights reserved. + +This code is licensed under the MIT License (MIT). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +</pre> + + + <hr> + <h1><a id="gyp"></a>gyp License</h1> <p>This license applies to certain files in the directory diff --git a/toolkit/content/widgets/browser.xml b/toolkit/content/widgets/browser.xml index e595c847d..a30ff1c43 100644 --- a/toolkit/content/widgets/browser.xml +++ b/toolkit/content/widgets/browser.xml @@ -389,10 +389,11 @@ <method name="getTabBrowser"> <body> <![CDATA[ - var tabBrowser = this.parentNode; - while (tabBrowser && tabBrowser.localName != "tabbrowser") - tabBrowser = tabBrowser.parentNode; - return tabBrowser; + for (let node = this.parentNode; node instanceof Element; node = node.parentNode) { + if (node.localName == "tabbrowser") + return node; + } + return null; ]]> </body> </method> diff --git a/toolkit/content/widgets/findbar.xml b/toolkit/content/widgets/findbar.xml index b92fb1d05..c312a6a25 100644 --- a/toolkit/content/widgets/findbar.xml +++ b/toolkit/content/widgets/findbar.xml @@ -282,6 +282,7 @@ return this._browser; ]]></getter> <setter><![CDATA[ + let prefsvc = this._prefsvc; if (this._browser) { if (this._browser.messageManager) { this._browser.messageManager.removeMessageListener("Findbar:Keypress", this); @@ -300,7 +301,9 @@ this._browser.messageManager.addMessageListener("Findbar:Mouseup", this); this._browser.finder.addResultListener(this); - this._findField.value = this._browser._lastSearchString; + if (prefsvc.getBoolPref("findbar.termPerTab") == true) { + this._findField.value = this._browser._lastSearchString; + } } return val; ]]></setter> diff --git a/toolkit/content/widgets/tabbox.xml b/toolkit/content/widgets/tabbox.xml index 02adb70b3..60c395c13 100644 --- a/toolkit/content/widgets/tabbox.xml +++ b/toolkit/content/widgets/tabbox.xml @@ -792,19 +792,6 @@ <field name="arrowKeysShouldWrap" readonly="true"> /Mac/.test(navigator.platform) </field> - <property name="TelemetryStopwatch" readonly="true"> - <getter><![CDATA[ - let module = {}; - Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", module); - Object.defineProperty(this, "TelemetryStopwatch", { - configurable: true, - enumerable: true, - writable: true, - value: module.TelemetryStopwatch - }); - return module.TelemetryStopwatch; - ]]></getter> - </property> </implementation> <handlers> @@ -814,11 +801,6 @@ return; if (this != this.parentNode.selectedItem) { // Not selected yet - let stopwatchid = this.parentNode.getAttribute("stopwatchid"); - if (stopwatchid) { - this.TelemetryStopwatch.start(stopwatchid); - } - // Call this before setting the 'ignorefocus' attribute because this // will pass on focus if the formerly selected tab was focused as well. this.parentNode._selectNewTab(this); @@ -836,10 +818,6 @@ this.setAttribute("ignorefocus", "true"); setTimeout(tab => tab.removeAttribute("ignorefocus"), 0, this); } - - if (stopwatchid) { - this.TelemetryStopwatch.finish(stopwatchid); - } } // Otherwise this tab is already selected and we will fall // through to mousedown behavior which sets focus on the current tab, diff --git a/toolkit/locales/Makefile.in b/toolkit/locales/Makefile.in index 189e0b1b0..198d9aaa8 100644 --- a/toolkit/locales/Makefile.in +++ b/toolkit/locales/Makefile.in @@ -16,7 +16,9 @@ libs-%: @$(MAKE) -C ../../netwerk/locales/ libs AB_CD=$* XPI_NAME=locale-$* @$(MAKE) -C ../../dom/locales/ libs AB_CD=$* XPI_NAME=locale-$* @$(MAKE) -C ../../security/manager/locales/ libs AB_CD=$* XPI_NAME=locale-$* +ifdef MOZ_DEVTOOLS_SERVER @$(MAKE) -C ../../devtools/shared/locales/ libs AB_CD=$* XPI_NAME=locale-$* +endif @$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* # target to be used by multi-locale l10n builds, just add this locale diff --git a/toolkit/moz.configure b/toolkit/moz.configure index 7d3065f53..792fb113d 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -358,6 +358,20 @@ set_config('MOZ_FMP4', fmp4) set_define('MOZ_FMP4', fmp4) add_old_configure_assignment('MOZ_FMP4', fmp4) +# Libaom AV1 Video Codec Support +# ============================================================== +option('--enable-av1', + help='Enable libaom for av1 video support') + +@depends('--enable-av1') +def av1(value): + enabled = bool(value) + if enabled: + return True + +set_config('MOZ_AV1', av1) +set_define('MOZ_AV1', av1) + # Miscellaneous # ============================================================== option(name='--enable-chrome-format', diff --git a/toolkit/mozapps/extensions/AddonManager.jsm b/toolkit/mozapps/extensions/AddonManager.jsm index d453a8981..4cd2c3d0a 100644 --- a/toolkit/mozapps/extensions/AddonManager.jsm +++ b/toolkit/mozapps/extensions/AddonManager.jsm @@ -123,13 +123,13 @@ function providerName(aProvider) { * parent 'addons' level logger accordingly. */ var PrefObserver = { - init: function PrefObserver_init() { + init: function() { Services.prefs.addObserver(PREF_LOGGING_ENABLED, this, false); Services.obs.addObserver(this, "xpcom-shutdown", false); this.observe(null, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, PREF_LOGGING_ENABLED); }, - observe: function PrefObserver_observe(aSubject, aTopic, aData) { + observe: function(aSubject, aTopic, aData) { if (aTopic == "xpcom-shutdown") { Services.prefs.removeObserver(PREF_LOGGING_ENABLED, this); Services.obs.removeObserver(this, "xpcom-shutdown"); @@ -323,7 +323,7 @@ AsyncObjectCaller.prototype = { * Passes the next object to the listener or calls noMoreObjects if there * are none left. */ - callNext: function AOC_callNext() { + callNext: function() { if (this.objects.length == 0) { this.listener.noMoreObjects(this); return; @@ -449,7 +449,7 @@ AddonAuthor.prototype = { url: null, // Returns the author's name, defaulting to the empty string - toString: function AddonAuthor_toString() { + toString: function() { return this.name || ""; } } @@ -493,7 +493,7 @@ AddonScreenshot.prototype = { caption: null, // Returns the screenshot URL, defaulting to the empty string - toString: function AddonScreenshot_toString() { + toString: function() { return this.url || ""; } } @@ -640,11 +640,11 @@ var AddonManagerInternal = { // Store telemetry details per addon provider telemetryDetails: {}, - recordTimestamp: function AMI_recordTimestamp(name, value) { + recordTimestamp: function(name, value) { this.TelemetryTimestamps.add(name, value); }, - validateBlocklist: function AMI_validateBlocklist() { + validateBlocklist: function() { let appBlocklist = FileUtils.getFile(KEY_APPDIR, [FILE_BLOCKLIST]); // If there is no application shipped blocklist then there is nothing to do @@ -771,7 +771,7 @@ var AddonManagerInternal = { * Initializes the AddonManager, loading any known providers and initializing * them. */ - startup: function AMI_startup() { + startup: function() { try { if (gStarted) return; @@ -925,7 +925,7 @@ var AddonManagerInternal = { * @param aTypes * An optional array of add-on types */ - registerProvider: function AMI_registerProvider(aProvider, aTypes) { + registerProvider: function(aProvider, aTypes) { if (!aProvider || typeof aProvider != "object") throw Components.Exception("aProvider must be specified", Cr.NS_ERROR_INVALID_ARG); @@ -977,7 +977,7 @@ var AddonManagerInternal = { * For providers that have async shutdown methods returning Promises, * the caller should wait for that Promise to resolve. */ - unregisterProvider: function AMI_unregisterProvider(aProvider) { + unregisterProvider: function(aProvider) { if (!aProvider || typeof aProvider != "object") throw Components.Exception("aProvider must be specified", Cr.NS_ERROR_INVALID_ARG); @@ -1032,7 +1032,7 @@ var AddonManagerInternal = { * * @param aProvider Provider object to mark safe */ - markProviderSafe: function AMI_markProviderSafe(aProvider) { + markProviderSafe: function(aProvider) { if (!gStarted) { throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1062,7 +1062,7 @@ var AddonManagerInternal = { * The method name to call * @see callProvider */ - callProviders: function AMI_callProviders(aMethod, ...aArgs) { + callProviders: function(aMethod, ...aArgs) { if (!aMethod || typeof aMethod != "string") throw Components.Exception("aMethod must be a non-empty string", Cr.NS_ERROR_INVALID_ARG); @@ -1163,7 +1163,7 @@ var AddonManagerInternal = { * * @see nsIObserver */ - observe: function AMI_observe(aSubject, aTopic, aData) { + observe: function(aSubject, aTopic, aData) { switch (aData) { case PREF_EM_CHECK_COMPATIBILITY: { let oldValue = gCheckCompatibility; @@ -1247,7 +1247,7 @@ var AddonManagerInternal = { * The optional application version to use for %APP_VERSION% * @return The appropriately escaped URI. */ - escapeAddonURI: function AMI_escapeAddonURI(aAddon, aUri, aAppVersion) + escapeAddonURI: function(aAddon, aUri, aAppVersion) { if (!aAddon || typeof aAddon != "object") throw Components.Exception("aAddon must be an Addon object", @@ -1318,7 +1318,7 @@ var AddonManagerInternal = { * @return Promise{null} Resolves when the background update check is complete * (the resulting addon installations may still be in progress). */ - backgroundUpdateCheck: function AMI_backgroundUpdateCheck() { + backgroundUpdateCheck: function() { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1347,7 +1347,7 @@ var AddonManagerInternal = { // be applied updates.push(new Promise((resolve, reject) => { addon.findUpdates({ - onUpdateAvailable: function BUC_onUpdateAvailable(aAddon, aInstall) { + onUpdateAvailable: function(aAddon, aInstall) { // Start installing updates when the add-on can be updated and // background updates should be applied. logger.debug("Found update for add-on ${id}", aAddon); @@ -1389,7 +1389,7 @@ var AddonManagerInternal = { * @param aID * The ID of the add-on */ - addStartupChange: function AMI_addStartupChange(aType, aID) { + addStartupChange: function(aType, aID) { if (!aType || typeof aType != "string") throw Components.Exception("aType must be a non-empty string", Cr.NS_ERROR_INVALID_ARG); @@ -1418,7 +1418,7 @@ var AddonManagerInternal = { * @param aID * The ID of the add-on */ - removeStartupChange: function AMI_removeStartupChange(aType, aID) { + removeStartupChange: function(aType, aID) { if (!aType || typeof aType != "string") throw Components.Exception("aType must be a non-empty string", Cr.NS_ERROR_INVALID_ARG); @@ -1444,7 +1444,7 @@ var AddonManagerInternal = { * @param aMethod * The method on the listeners to call */ - callManagerListeners: function AMI_callManagerListeners(aMethod, ...aArgs) { + callManagerListeners: function(aMethod, ...aArgs) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1475,7 +1475,7 @@ var AddonManagerInternal = { * An optional array of extra InstallListeners to also call * @return false if any of the listeners returned false, true otherwise */ - callInstallListeners: function AMI_callInstallListeners(aMethod, + callInstallListeners: function(aMethod, aExtraListeners, ...aArgs) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", @@ -1517,7 +1517,7 @@ var AddonManagerInternal = { * @param aMethod * The method on the listeners to call */ - callAddonListeners: function AMI_callAddonListeners(aMethod, ...aArgs) { + callAddonListeners: function(aMethod, ...aArgs) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1551,7 +1551,7 @@ var AddonManagerInternal = { * A boolean indicating if the change will only take place the next * time the application is restarted */ - notifyAddonChanged: function AMI_notifyAddonChanged(aID, aType, aPendingRestart) { + notifyAddonChanged: function(aID, aType, aPendingRestart) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1588,7 +1588,7 @@ var AddonManagerInternal = { * their add-ons in response to an application change such as a blocklist * update. */ - updateAddonAppDisabledStates: function AMI_updateAddonAppDisabledStates() { + updateAddonAppDisabledStates: function() { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1603,7 +1603,7 @@ var AddonManagerInternal = { * @param aCallback * Function to call when operation is complete. */ - updateAddonRepositoryData: function AMI_updateAddonRepositoryData(aCallback) { + updateAddonRepositoryData: function(aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1613,11 +1613,11 @@ var AddonManagerInternal = { Cr.NS_ERROR_INVALID_ARG); new AsyncObjectCaller(this.providers, "updateAddonRepositoryData", { - nextObject: function updateAddonRepositoryData_nextObject(aCaller, aProvider) { + nextObject: function(aCaller, aProvider) { callProviderAsync(aProvider, "updateAddonRepositoryData", aCaller.callNext.bind(aCaller)); }, - noMoreObjects: function updateAddonRepositoryData_noMoreObjects(aCaller) { + noMoreObjects: function(aCaller) { safeCall(aCallback); // only tests should care about this Services.obs.notifyObservers(null, "TEST:addon-repository-data-updated", null); @@ -1646,7 +1646,7 @@ var AddonManagerInternal = { * An optional nsILoadGroup to associate any network requests with * @throws if the aUrl, aCallback or aMimetype arguments are not specified */ - getInstallForURL: function AMI_getInstallForURL(aUrl, aCallback, aMimetype, + getInstallForURL: function(aUrl, aCallback, aMimetype, aHash, aName, aIcons, aVersion, aBrowser) { if (!gStarted) @@ -1716,7 +1716,7 @@ var AddonManagerInternal = { * An optional mimetype hint for the add-on * @throws if the aFile or aCallback arguments are not specified */ - getInstallForFile: function AMI_getInstallForFile(aFile, aCallback, aMimetype) { + getInstallForFile: function(aFile, aCallback, aMimetype) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1734,7 +1734,7 @@ var AddonManagerInternal = { Cr.NS_ERROR_INVALID_ARG); new AsyncObjectCaller(this.providers, "getInstallForFile", { - nextObject: function getInstallForFile_nextObject(aCaller, aProvider) { + nextObject: function(aCaller, aProvider) { callProviderAsync(aProvider, "getInstallForFile", aFile, function getInstallForFile_safeCall(aInstall) { if (aInstall) @@ -1744,7 +1744,7 @@ var AddonManagerInternal = { }); }, - noMoreObjects: function getInstallForFile_noMoreObjects(aCaller) { + noMoreObjects: function(aCaller) { safeCall(aCallback, null); } }); @@ -1760,7 +1760,7 @@ var AddonManagerInternal = { * A callback which will be passed an array of AddonInstalls * @throws If the aCallback argument is not specified */ - getInstallsByTypes: function AMI_getInstallsByTypes(aTypes, aCallback) { + getInstallsByTypes: function(aTypes, aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1776,7 +1776,7 @@ var AddonManagerInternal = { let installs = []; new AsyncObjectCaller(this.providers, "getInstallsByTypes", { - nextObject: function getInstallsByTypes_nextObject(aCaller, aProvider) { + nextObject: function(aCaller, aProvider) { callProviderAsync(aProvider, "getInstallsByTypes", aTypes, function getInstallsByTypes_safeCall(aProviderInstalls) { if (aProviderInstalls) { @@ -1786,7 +1786,7 @@ var AddonManagerInternal = { }); }, - noMoreObjects: function getInstallsByTypes_noMoreObjects(aCaller) { + noMoreObjects: function(aCaller) { safeCall(aCallback, installs); } }); @@ -1798,7 +1798,7 @@ var AddonManagerInternal = { * @param aCallback * A callback which will be passed an array of AddonInstalls */ - getAllInstalls: function AMI_getAllInstalls(aCallback) { + getAllInstalls: function(aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1818,7 +1818,7 @@ var AddonManagerInternal = { * @return string containing the Addon ID or null * @see amIAddonManager.mapURIToAddonID */ - mapURIToAddonID: function AMI_mapURIToAddonID(aURI) { + mapURIToAddonID: function(aURI) { if (!(aURI instanceof Ci.nsIURI)) { throw Components.Exception("aURI is not a nsIURI", Cr.NS_ERROR_INVALID_ARG); @@ -1843,7 +1843,7 @@ var AddonManagerInternal = { * The mimetype to check * @return true if installation is enabled for the mimetype */ - isInstallEnabled: function AMI_isInstallEnabled(aMimetype) { + isInstallEnabled: function(aMimetype) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1871,7 +1871,7 @@ var AddonManagerInternal = { * The nsIPrincipal that initiated the install * @return true if the source is allowed to install this mimetype */ - isInstallAllowed: function AMI_isInstallAllowed(aMimetype, aInstallingPrincipal) { + isInstallAllowed: function(aMimetype, aInstallingPrincipal) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1906,10 +1906,7 @@ var AddonManagerInternal = { * @param aInstalls * The array of AddonInstalls to be installed */ - installAddonsFromWebpage: function AMI_installAddonsFromWebpage(aMimetype, - aBrowser, - aInstallingPrincipal, - aInstalls) { + installAddonsFromWebpage: function(aMimetype, aBrowser, aInstallingPrincipal, aInstalls) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -2011,7 +2008,7 @@ var AddonManagerInternal = { * @param aListener * The InstallListener to add */ - addInstallListener: function AMI_addInstallListener(aListener) { + addInstallListener: function(aListener) { if (!aListener || typeof aListener != "object") throw Components.Exception("aListener must be a InstallListener object", Cr.NS_ERROR_INVALID_ARG); @@ -2027,7 +2024,7 @@ var AddonManagerInternal = { * @param aListener * The InstallListener to remove */ - removeInstallListener: function AMI_removeInstallListener(aListener) { + removeInstallListener: function(aListener) { if (!aListener || typeof aListener != "object") throw Components.Exception("aListener must be a InstallListener object", Cr.NS_ERROR_INVALID_ARG); @@ -2050,7 +2047,7 @@ var AddonManagerInternal = { * The callback to pass the retrieved add-on to * @throws if the aID or aCallback arguments are not specified */ - getAddonByID: function AMI_getAddonByID(aID, aCallback) { + getAddonByID: function(aID, aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -2064,7 +2061,7 @@ var AddonManagerInternal = { Cr.NS_ERROR_INVALID_ARG); new AsyncObjectCaller(this.providers, "getAddonByID", { - nextObject: function getAddonByID_nextObject(aCaller, aProvider) { + nextObject: function(aCaller, aProvider) { callProviderAsync(aProvider, "getAddonByID", aID, function getAddonByID_safeCall(aAddon) { if (aAddon) @@ -2074,7 +2071,7 @@ var AddonManagerInternal = { }); }, - noMoreObjects: function getAddonByID_noMoreObjects(aCaller) { + noMoreObjects: function(aCaller) { safeCall(aCallback, null); } }); @@ -2089,7 +2086,7 @@ var AddonManagerInternal = { * The callback to pass the retrieved add-on to. * @throws if the aGUID or aCallback arguments are not specified */ - getAddonBySyncGUID: function AMI_getAddonBySyncGUID(aGUID, aCallback) { + getAddonBySyncGUID: function(aGUID, aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -2103,7 +2100,7 @@ var AddonManagerInternal = { Cr.NS_ERROR_INVALID_ARG); new AsyncObjectCaller(this.providers, "getAddonBySyncGUID", { - nextObject: function getAddonBySyncGUID_nextObject(aCaller, aProvider) { + nextObject: function(aCaller, aProvider) { callProviderAsync(aProvider, "getAddonBySyncGUID", aGUID, function getAddonBySyncGUID_safeCall(aAddon) { if (aAddon) { @@ -2114,7 +2111,7 @@ var AddonManagerInternal = { }); }, - noMoreObjects: function getAddonBySyncGUID_noMoreObjects(aCaller) { + noMoreObjects: function(aCaller) { safeCall(aCallback, null); } }); @@ -2129,7 +2126,7 @@ var AddonManagerInternal = { * The callback to pass an array of Addons to * @throws if the aID or aCallback arguments are not specified */ - getAddonsByIDs: function AMI_getAddonsByIDs(aIDs, aCallback) { + getAddonsByIDs: function(aIDs, aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -2145,7 +2142,7 @@ var AddonManagerInternal = { let addons = []; new AsyncObjectCaller(aIDs, null, { - nextObject: function getAddonsByIDs_nextObject(aCaller, aID) { + nextObject: function(aCaller, aID) { AddonManagerInternal.getAddonByID(aID, function getAddonsByIDs_getAddonByID(aAddon) { addons.push(aAddon); @@ -2153,7 +2150,7 @@ var AddonManagerInternal = { }); }, - noMoreObjects: function getAddonsByIDs_noMoreObjects(aCaller) { + noMoreObjects: function(aCaller) { safeCall(aCallback, addons); } }); @@ -2168,7 +2165,7 @@ var AddonManagerInternal = { * The callback to pass an array of Addons to. * @throws if the aCallback argument is not specified */ - getAddonsByTypes: function AMI_getAddonsByTypes(aTypes, aCallback) { + getAddonsByTypes: function(aTypes, aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -2184,7 +2181,7 @@ var AddonManagerInternal = { let addons = []; new AsyncObjectCaller(this.providers, "getAddonsByTypes", { - nextObject: function getAddonsByTypes_nextObject(aCaller, aProvider) { + nextObject: function(aCaller, aProvider) { callProviderAsync(aProvider, "getAddonsByTypes", aTypes, function getAddonsByTypes_concatAddons(aProviderAddons) { if (aProviderAddons) { @@ -2194,7 +2191,7 @@ var AddonManagerInternal = { }); }, - noMoreObjects: function getAddonsByTypes_noMoreObjects(aCaller) { + noMoreObjects: function(aCaller) { safeCall(aCallback, addons); } }); @@ -2206,7 +2203,7 @@ var AddonManagerInternal = { * @param aCallback * A callback which will be passed an array of Addons */ - getAllAddons: function AMI_getAllAddons(aCallback) { + getAllAddons: function(aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -2228,8 +2225,7 @@ var AddonManagerInternal = { * The callback to pass the array of Addons to * @throws if the aCallback argument is not specified */ - getAddonsWithOperationsByTypes: - function AMI_getAddonsWithOperationsByTypes(aTypes, aCallback) { + getAddonsWithOperationsByTypes: function(aTypes, aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -2245,8 +2241,7 @@ var AddonManagerInternal = { let addons = []; new AsyncObjectCaller(this.providers, "getAddonsWithOperationsByTypes", { - nextObject: function getAddonsWithOperationsByTypes_nextObject - (aCaller, aProvider) { + nextObject: function(aCaller, aProvider) { callProviderAsync(aProvider, "getAddonsWithOperationsByTypes", aTypes, function getAddonsWithOperationsByTypes_concatAddons (aProviderAddons) { @@ -2257,7 +2252,7 @@ var AddonManagerInternal = { }); }, - noMoreObjects: function getAddonsWithOperationsByTypes_noMoreObjects(caller) { + noMoreObjects: function(caller) { safeCall(aCallback, addons); } }); @@ -2269,7 +2264,7 @@ var AddonManagerInternal = { * @param aListener * The listener to add */ - addManagerListener: function AMI_addManagerListener(aListener) { + addManagerListener: function(aListener) { if (!aListener || typeof aListener != "object") throw Components.Exception("aListener must be an AddonManagerListener object", Cr.NS_ERROR_INVALID_ARG); @@ -2285,7 +2280,7 @@ var AddonManagerInternal = { * @param aListener * The listener to remove */ - removeManagerListener: function AMI_removeManagerListener(aListener) { + removeManagerListener: function(aListener) { if (!aListener || typeof aListener != "object") throw Components.Exception("aListener must be an AddonManagerListener object", Cr.NS_ERROR_INVALID_ARG); @@ -2305,7 +2300,7 @@ var AddonManagerInternal = { * @param aListener * The AddonListener to add */ - addAddonListener: function AMI_addAddonListener(aListener) { + addAddonListener: function(aListener) { if (!aListener || typeof aListener != "object") throw Components.Exception("aListener must be an AddonListener object", Cr.NS_ERROR_INVALID_ARG); @@ -2321,7 +2316,7 @@ var AddonManagerInternal = { * @param aListener * The AddonListener to remove */ - removeAddonListener: function AMI_removeAddonListener(aListener) { + removeAddonListener: function(aListener) { if (!aListener || typeof aListener != "object") throw Components.Exception("aListener must be an AddonListener object", Cr.NS_ERROR_INVALID_ARG); @@ -2341,7 +2336,7 @@ var AddonManagerInternal = { * @param aListener * The TypeListener to add */ - addTypeListener: function AMI_addTypeListener(aListener) { + addTypeListener: function(aListener) { if (!aListener || typeof aListener != "object") throw Components.Exception("aListener must be a TypeListener object", Cr.NS_ERROR_INVALID_ARG); @@ -2357,7 +2352,7 @@ var AddonManagerInternal = { * @param aListener * The TypeListener to remove */ - removeTypeListener: function AMI_removeTypeListener(aListener) { + removeTypeListener: function(aListener) { if (!aListener || typeof aListener != "object") throw Components.Exception("aListener must be a TypeListener object", Cr.NS_ERROR_INVALID_ARG); @@ -2496,23 +2491,23 @@ var AddonManagerInternal = { * subject to change at any time. */ this.AddonManagerPrivate = { - startup: function AMP_startup() { + startup: function() { AddonManagerInternal.startup(); }, - registerProvider: function AMP_registerProvider(aProvider, aTypes) { + registerProvider: function(aProvider, aTypes) { AddonManagerInternal.registerProvider(aProvider, aTypes); }, - unregisterProvider: function AMP_unregisterProvider(aProvider) { + unregisterProvider: function(aProvider) { AddonManagerInternal.unregisterProvider(aProvider); }, - markProviderSafe: function AMP_markProviderSafe(aProvider) { + markProviderSafe: function(aProvider) { AddonManagerInternal.markProviderSafe(aProvider); }, - backgroundUpdateCheck: function AMP_backgroundUpdateCheck() { + backgroundUpdateCheck: function() { return AddonManagerInternal.backgroundUpdateCheck(); }, @@ -2526,32 +2521,32 @@ this.AddonManagerPrivate = { AddonManagerInternal.backgroundUpdateCheck(); }, - addStartupChange: function AMP_addStartupChange(aType, aID) { + addStartupChange: function(aType, aID) { AddonManagerInternal.addStartupChange(aType, aID); }, - removeStartupChange: function AMP_removeStartupChange(aType, aID) { + removeStartupChange: function(aType, aID) { AddonManagerInternal.removeStartupChange(aType, aID); }, - notifyAddonChanged: function AMP_notifyAddonChanged(aID, aType, aPendingRestart) { + notifyAddonChanged: function(aID, aType, aPendingRestart) { AddonManagerInternal.notifyAddonChanged(aID, aType, aPendingRestart); }, - updateAddonAppDisabledStates: function AMP_updateAddonAppDisabledStates() { + updateAddonAppDisabledStates: function() { AddonManagerInternal.updateAddonAppDisabledStates(); }, - updateAddonRepositoryData: function AMP_updateAddonRepositoryData(aCallback) { + updateAddonRepositoryData: function(aCallback) { AddonManagerInternal.updateAddonRepositoryData(aCallback); }, - callInstallListeners: function AMP_callInstallListeners(...aArgs) { + callInstallListeners: function(...aArgs) { return AddonManagerInternal.callInstallListeners.apply(AddonManagerInternal, aArgs); }, - callAddonListeners: function AMP_callAddonListeners(...aArgs) { + callAddonListeners: function(...aArgs) { AddonManagerInternal.callAddonListeners.apply(AddonManagerInternal, aArgs); }, @@ -2563,16 +2558,16 @@ this.AddonManagerPrivate = { AddonType: AddonType, - recordTimestamp: function AMP_recordTimestamp(name, value) { + recordTimestamp: function(name, value) { AddonManagerInternal.recordTimestamp(name, value); }, _simpleMeasures: {}, - recordSimpleMeasure: function AMP_recordSimpleMeasure(name, value) { + recordSimpleMeasure: function(name, value) { this._simpleMeasures[name] = value; }, - recordException: function AMP_recordException(aModule, aContext, aException) { + recordException: function(aModule, aContext, aException) { let report = { module: aModule, context: aContext @@ -2592,15 +2587,15 @@ this.AddonManagerPrivate = { this._simpleMeasures.exception = report; }, - getSimpleMeasures: function AMP_getSimpleMeasures() { + getSimpleMeasures: function() { return this._simpleMeasures; }, - getTelemetryDetails: function AMP_getTelemetryDetails() { + getTelemetryDetails: function() { return AddonManagerInternal.telemetryDetails; }, - setTelemetryDetails: function AMP_setTelemetryDetails(aProvider, aDetails) { + setTelemetryDetails: function(aProvider, aDetails) { AddonManagerInternal.telemetryDetails[aProvider] = aDetails; }, @@ -2619,7 +2614,7 @@ this.AddonManagerPrivate = { * This can be used as an implementation for Addon.findUpdates() when * no update mechanism is available. */ - callNoUpdateListeners: function (addon, listener, reason, appVersion, platformVersion) { + callNoUpdateListeners: function(addon, listener, reason, appVersion, platformVersion) { if ("onNoCompatibilityUpdateAvailable" in listener) { safeCall(listener.onNoCompatibilityUpdateAvailable.bind(listener), addon); } @@ -2830,14 +2825,13 @@ this.AddonManager = { return gStartupComplete && !gShutdownInProgress; }, - getInstallForURL: function AM_getInstallForURL(aUrl, aCallback, aMimetype, - aHash, aName, aIcons, - aVersion, aBrowser) { + getInstallForURL: function(aUrl, aCallback, aMimetype, aHash, aName, aIcons, + aVersion, aBrowser) { AddonManagerInternal.getInstallForURL(aUrl, aCallback, aMimetype, aHash, aName, aIcons, aVersion, aBrowser); }, - getInstallForFile: function AM_getInstallForFile(aFile, aCallback, aMimetype) { + getInstallForFile: function(aFile, aCallback, aMimetype) { AddonManagerInternal.getInstallForFile(aFile, aCallback, aMimetype); }, @@ -2848,94 +2842,91 @@ this.AddonManager = { * The type of startup change to get * @return An array of add-on IDs */ - getStartupChanges: function AM_getStartupChanges(aType) { + getStartupChanges: function(aType) { if (!(aType in AddonManagerInternal.startupChanges)) return []; return AddonManagerInternal.startupChanges[aType].slice(0); }, - getAddonByID: function AM_getAddonByID(aID, aCallback) { + getAddonByID: function(aID, aCallback) { AddonManagerInternal.getAddonByID(aID, aCallback); }, - getAddonBySyncGUID: function AM_getAddonBySyncGUID(aGUID, aCallback) { + getAddonBySyncGUID: function(aGUID, aCallback) { AddonManagerInternal.getAddonBySyncGUID(aGUID, aCallback); }, - getAddonsByIDs: function AM_getAddonsByIDs(aIDs, aCallback) { + getAddonsByIDs: function(aIDs, aCallback) { AddonManagerInternal.getAddonsByIDs(aIDs, aCallback); }, - getAddonsWithOperationsByTypes: - function AM_getAddonsWithOperationsByTypes(aTypes, aCallback) { + getAddonsWithOperationsByTypes: function(aTypes, aCallback) { AddonManagerInternal.getAddonsWithOperationsByTypes(aTypes, aCallback); }, - getAddonsByTypes: function AM_getAddonsByTypes(aTypes, aCallback) { + getAddonsByTypes: function(aTypes, aCallback) { AddonManagerInternal.getAddonsByTypes(aTypes, aCallback); }, - getAllAddons: function AM_getAllAddons(aCallback) { + getAllAddons: function(aCallback) { AddonManagerInternal.getAllAddons(aCallback); }, - getInstallsByTypes: function AM_getInstallsByTypes(aTypes, aCallback) { + getInstallsByTypes: function(aTypes, aCallback) { AddonManagerInternal.getInstallsByTypes(aTypes, aCallback); }, - getAllInstalls: function AM_getAllInstalls(aCallback) { + getAllInstalls: function(aCallback) { AddonManagerInternal.getAllInstalls(aCallback); }, - mapURIToAddonID: function AM_mapURIToAddonID(aURI) { + mapURIToAddonID: function(aURI) { return AddonManagerInternal.mapURIToAddonID(aURI); }, - isInstallEnabled: function AM_isInstallEnabled(aType) { + isInstallEnabled: function(aType) { return AddonManagerInternal.isInstallEnabled(aType); }, - isInstallAllowed: function AM_isInstallAllowed(aType, aInstallingPrincipal) { + isInstallAllowed: function(aType, aInstallingPrincipal) { return AddonManagerInternal.isInstallAllowed(aType, ensurePrincipal(aInstallingPrincipal)); }, - installAddonsFromWebpage: function AM_installAddonsFromWebpage(aType, aBrowser, - aInstallingPrincipal, - aInstalls) { + installAddonsFromWebpage: function(aType, aBrowser, aInstallingPrincipal, aInstalls) { AddonManagerInternal.installAddonsFromWebpage(aType, aBrowser, ensurePrincipal(aInstallingPrincipal), aInstalls); }, - addManagerListener: function AM_addManagerListener(aListener) { + addManagerListener: function(aListener) { AddonManagerInternal.addManagerListener(aListener); }, - removeManagerListener: function AM_removeManagerListener(aListener) { + removeManagerListener: function(aListener) { AddonManagerInternal.removeManagerListener(aListener); }, - addInstallListener: function AM_addInstallListener(aListener) { + addInstallListener: function(aListener) { AddonManagerInternal.addInstallListener(aListener); }, - removeInstallListener: function AM_removeInstallListener(aListener) { + removeInstallListener: function(aListener) { AddonManagerInternal.removeInstallListener(aListener); }, - addAddonListener: function AM_addAddonListener(aListener) { + addAddonListener: function(aListener) { AddonManagerInternal.addAddonListener(aListener); }, - removeAddonListener: function AM_removeAddonListener(aListener) { + removeAddonListener: function(aListener) { AddonManagerInternal.removeAddonListener(aListener); }, - addTypeListener: function AM_addTypeListener(aListener) { + addTypeListener: function(aListener) { AddonManagerInternal.addTypeListener(aListener); }, - removeTypeListener: function AM_removeTypeListener(aListener) { + removeTypeListener: function(aListener) { AddonManagerInternal.removeTypeListener(aListener); }, @@ -2950,7 +2941,7 @@ this.AddonManager = { * The Addon representing the add-on * @return true if the addon should auto-update, false otherwise. */ - shouldAutoUpdate: function AM_shouldAutoUpdate(aAddon) { + shouldAutoUpdate: function(aAddon) { if (!aAddon || typeof aAddon != "object") throw Components.Exception("aAddon must be specified", Cr.NS_ERROR_INVALID_ARG); @@ -3008,7 +2999,7 @@ this.AddonManager = { AddonManagerInternal.autoUpdateDefault = aValue; }, - escapeAddonURI: function AM_escapeAddonURI(aAddon, aUri, aAppVersion) { + escapeAddonURI: function(aAddon, aUri, aAppVersion) { return AddonManagerInternal.escapeAddonURI(aAddon, aUri, aAppVersion); }, diff --git a/toolkit/mozapps/extensions/LightweightThemeManager.jsm b/toolkit/mozapps/extensions/LightweightThemeManager.jsm index 5856bfa91..372a9f3b8 100644 --- a/toolkit/mozapps/extensions/LightweightThemeManager.jsm +++ b/toolkit/mozapps/extensions/LightweightThemeManager.jsm @@ -110,11 +110,11 @@ this.LightweightThemeManager = { return _setCurrentTheme(aData, false); }, - setLocalTheme: function LightweightThemeManager_setLocalTheme(aData) { + setLocalTheme: function(aData) { _setCurrentTheme(aData, true); }, - getUsedTheme: function LightweightThemeManager_getUsedTheme(aId) { + getUsedTheme: function(aId) { var usedThemes = this.usedThemes; for (let usedTheme of usedThemes) { if (usedTheme.id == aId) @@ -123,7 +123,7 @@ this.LightweightThemeManager = { return null; }, - forgetUsedTheme: function LightweightThemeManager_forgetUsedTheme(aId) { + forgetUsedTheme: function(aId) { let theme = this.getUsedTheme(aId); if (!theme) return; @@ -141,7 +141,7 @@ this.LightweightThemeManager = { AddonManagerPrivate.callAddonListeners("onUninstalled", wrapper); }, - previewTheme: function LightweightThemeManager_previewTheme(aData) { + previewTheme: function(aData) { let cancel = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool); cancel.data = false; Services.obs.notifyObservers(cancel, "lightweight-theme-preview-requested", @@ -160,7 +160,7 @@ this.LightweightThemeManager = { _notifyWindows(aData); }, - resetPreview: function LightweightThemeManager_resetPreview() { + resetPreview: function() { if (_previewTimer) { _previewTimer.cancel(); _previewTimer = null; @@ -168,7 +168,7 @@ this.LightweightThemeManager = { } }, - parseTheme: function LightweightThemeManager_parseTheme(aString, aBaseURI) { + parseTheme: function(aString, aBaseURI) { try { return _sanitizeTheme(JSON.parse(aString), aBaseURI, false); } catch (e) { @@ -176,7 +176,7 @@ this.LightweightThemeManager = { } }, - updateCurrentTheme: function LightweightThemeManager_updateCurrentTheme() { + updateCurrentTheme: function() { try { if (!_prefs.getBoolPref("update.enabled")) return; @@ -224,7 +224,7 @@ this.LightweightThemeManager = { * @param aData * The lightweight theme to switch to */ - themeChanged: function LightweightThemeManager_themeChanged(aData) { + themeChanged: function(aData) { if (_previewTimer) { _previewTimer.cancel(); _previewTimer = null; @@ -251,7 +251,7 @@ this.LightweightThemeManager = { * Starts the Addons provider and enables the new lightweight theme if * necessary. */ - startup: function LightweightThemeManager_startup() { + startup: function() { if (Services.prefs.prefHasUserValue(PREF_LWTHEME_TO_SELECT)) { let id = Services.prefs.getCharPref(PREF_LWTHEME_TO_SELECT); if (id) @@ -267,7 +267,7 @@ this.LightweightThemeManager = { /** * Shuts down the provider. */ - shutdown: function LightweightThemeManager_shutdown() { + shutdown: function() { _prefs.removeObserver("", _prefObserver); }, @@ -283,7 +283,7 @@ this.LightweightThemeManager = { * true if the newly enabled add-on will only become enabled after a * restart */ - addonChanged: function LightweightThemeManager_addonChanged(aId, aType, aPendingRestart) { + addonChanged: function(aId, aType, aPendingRestart) { if (aType != ADDON_TYPE) return; @@ -356,7 +356,7 @@ this.LightweightThemeManager = { * @param aCallback * A callback to pass the Addon to */ - getAddonByID: function LightweightThemeManager_getAddonByID(aId, aCallback) { + getAddonByID: function(aId, aCallback) { let id = _getInternalID(aId); if (!id) { aCallback(null); @@ -380,7 +380,7 @@ this.LightweightThemeManager = { * @param aCallback * A callback to pass an array of Addons to */ - getAddonsByTypes: function LightweightThemeManager_getAddonsByTypes(aTypes, aCallback) { + getAddonsByTypes: function(aTypes, aCallback) { if (aTypes && aTypes.indexOf(ADDON_TYPE) == -1) { aCallback([]); return; @@ -541,7 +541,7 @@ AddonWrapper.prototype = { }, // Lightweight themes are always compatible - isCompatibleWith: function AddonWrapper_isCompatibleWith(appVersion, platformVersion) { + isCompatibleWith: function(appVersion, platformVersion) { return true; }, @@ -708,7 +708,7 @@ function _notifyWindows(aThemeData) { var _previewTimer; var _previewTimerCallback = { - notify: function _previewTimerCallback_notify() { + notify: function() { LightweightThemeManager.resetPreview(); } }; diff --git a/toolkit/mozapps/extensions/addonManager.js b/toolkit/mozapps/extensions/addonManager.js index 731e70c6c..2628ea87b 100644 --- a/toolkit/mozapps/extensions/addonManager.js +++ b/toolkit/mozapps/extensions/addonManager.js @@ -53,7 +53,7 @@ function amManager() { } amManager.prototype = { - observe: function AMC_observe(aSubject, aTopic, aData) { + observe: function(aSubject, aTopic, aData) { if (aTopic == "addons-startup") AddonManagerPrivate.startup(); }, @@ -61,7 +61,7 @@ amManager.prototype = { /** * @see amIAddonManager.idl */ - mapURIToAddonID: function AMC_mapURIToAddonID(uri, id) { + mapURIToAddonID: function(uri, id) { id.value = AddonManager.mapURIToAddonID(uri); return !!id.value; }, @@ -69,19 +69,15 @@ amManager.prototype = { /** * @see amIWebInstaller.idl */ - isInstallEnabled: function AMC_isInstallEnabled(aMimetype, aReferer) { + isInstallEnabled: function(aMimetype, aReferer) { return AddonManager.isInstallEnabled(aMimetype); }, /** * @see amIWebInstaller.idl */ - installAddonsFromWebpage: function AMC_installAddonsFromWebpage(aMimetype, - aBrowser, - aInstallingPrincipal, - aUris, aHashes, - aNames, aIcons, - aCallback) { + installAddonsFromWebpage: function(aMimetype, aBrowser, aInstallingPrincipal, + aUris, aHashes, aNames, aIcons, aCallback) { if (aUris.length == 0) return false; @@ -112,22 +108,22 @@ amManager.prototype = { installs.push(aInstall); if (aCallback) { aInstall.addListener({ - onDownloadCancelled: function buildNextInstall_onDownloadCancelled(aInstall) { + onDownloadCancelled: function(aInstall) { callCallback(uri, USER_CANCELLED); }, - onDownloadFailed: function buildNextInstall_onDownloadFailed(aInstall) { + onDownloadFailed: function(aInstall) { if (aInstall.error == AddonManager.ERROR_CORRUPT_FILE) callCallback(uri, CANT_READ_ARCHIVE); else callCallback(uri, DOWNLOAD_ERROR); }, - onInstallFailed: function buildNextInstall_onInstallFailed(aInstall) { + onInstallFailed: function(aInstall) { callCallback(uri, EXECUTION_ERROR); }, - onInstallEnded: function buildNextInstall_onInstallEnded(aInstall, aStatus) { + onInstallEnded: function(aInstall, aStatus) { callCallback(uri, SUCCESS); } }); @@ -144,7 +140,7 @@ amManager.prototype = { return retval; }, - notify: function AMC_notify(aTimer) { + notify: function(aTimer) { AddonManagerPrivate.backgroundUpdateTimerHandler(); }, @@ -154,7 +150,7 @@ amManager.prototype = { * Listens to requests from child processes for InstallTrigger * activity, and sends back callbacks. */ - receiveMessage: function AMC_receiveMessage(aMessage) { + receiveMessage: function(aMessage) { let payload = aMessage.data; switch (aMessage.name) { @@ -165,7 +161,7 @@ amManager.prototype = { let callback = null; if (payload.callbackID != -1) { callback = { - onInstallEnded: function ITP_callback(url, status) { + onInstallEnded: function(url, status) { gParentMM.broadcastAsyncMessage(MSG_INSTALL_CALLBACK, { callbackID: payload.callbackID, url: url, @@ -184,7 +180,7 @@ amManager.prototype = { classID: Components.ID("{4399533d-08d1-458c-a87a-235f74451cfa}"), _xpcom_factory: { - createInstance: function AMC_createInstance(aOuter, aIid) { + createInstance: function(aOuter, aIid) { if (aOuter != null) throw Components.Exception("Component does not support aggregation", Cr.NS_ERROR_NO_AGGREGATION); diff --git a/toolkit/mozapps/extensions/amInstallTrigger.js b/toolkit/mozapps/extensions/amInstallTrigger.js index a18fe84c4..5fc0e1717 100644 --- a/toolkit/mozapps/extensions/amInstallTrigger.js +++ b/toolkit/mozapps/extensions/amInstallTrigger.js @@ -203,7 +203,7 @@ InstallTrigger.prototype = { return this.startSoftwareUpdate(url); }, - _resolveURL: function (url) { + _resolveURL: function(url) { return Services.io.newURI(url, null, this._url); }, diff --git a/toolkit/mozapps/extensions/amWebInstallListener.js b/toolkit/mozapps/extensions/amWebInstallListener.js index ac6e2495d..088f56640 100644 --- a/toolkit/mozapps/extensions/amWebInstallListener.js +++ b/toolkit/mozapps/extensions/amWebInstallListener.js @@ -89,7 +89,7 @@ Installer.prototype = { /** * Checks if all downloads are now complete and if so prompts to install. */ - checkAllDownloaded: function Installer_checkAllDownloaded() { + checkAllDownloaded: function() { // Prevent re-entrancy caused by the confirmation dialog cancelling unwanted // installs. if (!this.isDownloading) @@ -199,7 +199,7 @@ Installer.prototype = { /** * Checks if all installs are now complete and if so notifies observers. */ - checkAllInstalled: function Installer_checkAllInstalled() { + checkAllInstalled: function() { var failed = []; for (let install of this.downloads) { @@ -225,32 +225,32 @@ Installer.prototype = { this.installed = null; }, - onDownloadCancelled: function Installer_onDownloadCancelled(aInstall) { + onDownloadCancelled: function(aInstall) { aInstall.removeListener(this); this.checkAllDownloaded(); }, - onDownloadFailed: function Installer_onDownloadFailed(aInstall) { + onDownloadFailed: function(aInstall) { aInstall.removeListener(this); this.checkAllDownloaded(); }, - onDownloadEnded: function Installer_onDownloadEnded(aInstall) { + onDownloadEnded: function(aInstall) { this.checkAllDownloaded(); return false; }, - onInstallCancelled: function Installer_onInstallCancelled(aInstall) { + onInstallCancelled: function(aInstall) { aInstall.removeListener(this); this.checkAllInstalled(); }, - onInstallFailed: function Installer_onInstallFailed(aInstall) { + onInstallFailed: function(aInstall) { aInstall.removeListener(this); this.checkAllInstalled(); }, - onInstallEnded: function Installer_onInstallEnded(aInstall) { + onInstallEnded: function(aInstall) { aInstall.removeListener(this); this.installed.push(aInstall); @@ -272,7 +272,7 @@ extWebInstallListener.prototype = { /** * @see amIWebInstallListener.idl */ - onWebInstallDisabled: function extWebInstallListener_onWebInstallDisabled(aBrowser, aUri, aInstalls) { + onWebInstallDisabled: function(aBrowser, aUri, aInstalls) { let info = { browser: aBrowser, originatingURI: aUri, @@ -286,13 +286,13 @@ extWebInstallListener.prototype = { /** * @see amIWebInstallListener.idl */ - onWebInstallOriginBlocked: function extWebInstallListener_onWebInstallOriginBlocked(aBrowser, aUri, aInstalls) { + onWebInstallOriginBlocked: function(aBrowser, aUri, aInstalls) { let info = { browser: aBrowser, originatingURI: aUri, installs: aInstalls, - install: function onWebInstallBlocked_install() { + install: function() { }, QueryInterface: XPCOMUtils.generateQI([Ci.amIWebInstallInfo]) @@ -305,13 +305,13 @@ extWebInstallListener.prototype = { /** * @see amIWebInstallListener.idl */ - onWebInstallBlocked: function extWebInstallListener_onWebInstallBlocked(aBrowser, aUri, aInstalls) { + onWebInstallBlocked: function(aBrowser, aUri, aInstalls) { let info = { browser: aBrowser, originatingURI: aUri, installs: aInstalls, - install: function onWebInstallBlocked_install() { + install: function() { new Installer(this.browser, this.originatingURI, this.installs); }, @@ -325,7 +325,7 @@ extWebInstallListener.prototype = { /** * @see amIWebInstallListener.idl */ - onWebInstallRequested: function extWebInstallListener_onWebInstallRequested(aBrowser, aUri, aInstalls) { + onWebInstallRequested: function(aBrowser, aUri, aInstalls) { new Installer(aBrowser, aUri, aInstalls); // We start the installs ourself diff --git a/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm b/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm index f927bc745..c06dca1d5 100644 --- a/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm +++ b/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm @@ -976,12 +976,13 @@ this.AddonUpdateChecker = { * down in-progress update requests */ checkForUpdates: function(aId, aUpdateKey, aUrl, aObserver) { - // Define an array of internally used IDs to NOT send to AUS such as the - // Default Theme. Please keep this list in sync with: - // toolkit/mozapps/extensions/AddonUpdateChecker.jsm + // Define an array of internally used IDs to NOT send to AUS. let internalIDS = [ - '{972ce4c6-7e08-4474-a285-3208198ce6fd}', - 'modern@themes.mozilla.org' + '{972ce4c6-7e08-4474-a285-3208198ce6fd}', // Global Default Theme + 'modern@themes.mozilla.org', // Modern Theme for Borealis/Suite-based Applications + 'xplatform@interlink.projects.binaryoutcast.com', // Pref-set default theme for Interlink + '{e2fda1a4-762b-4020-b5ad-a41df1933103}', // Lightning/Calendar Extension + '{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}' // Provider for Google Calendar (gdata) Extension ]; // If the ID is not in the array then go ahead and query AUS diff --git a/toolkit/themes/linux/global/jar.mn b/toolkit/themes/linux/global/jar.mn index b161f8cae..ba665adff 100644 --- a/toolkit/themes/linux/global/jar.mn +++ b/toolkit/themes/linux/global/jar.mn @@ -32,7 +32,7 @@ toolkit.jar: skin/classic/global/splitter.css skin/classic/global/tabbox.css skin/classic/global/textbox.css - skin/classic/global/toolbar.css +* skin/classic/global/toolbar.css skin/classic/global/toolbarbutton.css skin/classic/global/tree.css skin/classic/global/alerts/alert.css (alerts/alert.css) diff --git a/toolkit/themes/linux/global/toolbar.css b/toolkit/themes/linux/global/toolbar.css index f17fea12f..1d52aeb8f 100644 --- a/toolkit/themes/linux/global/toolbar.css +++ b/toolkit/themes/linux/global/toolbar.css @@ -31,11 +31,21 @@ menubar, toolbar[type="menubar"] { padding: 1px 0px; } + +%ifdef MOZ_AUSTRALIS +menubar:-moz-lwtheme, +toolbar:-moz-lwtheme { + -moz-appearance: none; + color: inherit; +} +%else menubar:-moz-lwtheme, toolbar:-moz-lwtheme { -moz-appearance: none; color: inherit; + border-style: none; } +%endif /* in browser.xul, the menubar is inside a toolbar... */ toolbaritem > menubar { diff --git a/toolkit/themes/osx/global/jar.mn b/toolkit/themes/osx/global/jar.mn index 2b7d19641..9ca73cc6b 100644 --- a/toolkit/themes/osx/global/jar.mn +++ b/toolkit/themes/osx/global/jar.mn @@ -44,7 +44,7 @@ toolkit.jar: skin/classic/global/tabbox.css skin/classic/global/textbox.css skin/classic/global/datetimepicker.css - skin/classic/global/toolbar.css +* skin/classic/global/toolbar.css skin/classic/global/toolbarbutton.css * skin/classic/global/tree.css * skin/classic/global/viewbuttons.css diff --git a/toolkit/themes/osx/global/notification.css b/toolkit/themes/osx/global/notification.css index 24b3d3920..6d22cf9c8 100644 --- a/toolkit/themes/osx/global/notification.css +++ b/toolkit/themes/osx/global/notification.css @@ -81,12 +81,12 @@ notificationbox[notificationside="bottom"] > notification { Invert the close icon for @type=info since both are normally dark. It's unclear why !important is necessary here so remove it if it's no longer needed. */ -notification[type="info"]:not([value="translation"]) .close-icon:not(:hover) { +notification[type="info"] .close-icon:not(:hover) { -moz-image-region: rect(0, 64px, 16px, 48px) !important; } @media (min-resolution: 2dppx) { - notification[type="info"]:not([value="translation"]) .close-icon:not(:hover) { + notification[type="info"] .close-icon:not(:hover) { -moz-image-region: rect(0, 128px, 32px, 96px) !important; } } diff --git a/toolkit/themes/osx/global/toolbar.css b/toolkit/themes/osx/global/toolbar.css index 820436f14..f07332d2f 100644 --- a/toolkit/themes/osx/global/toolbar.css +++ b/toolkit/themes/osx/global/toolbar.css @@ -16,12 +16,21 @@ toolbar { -moz-appearance: toolbar; } +%ifdef MOZ_AUSTRALIS menubar:-moz-lwtheme, toolbar:-moz-lwtheme { -moz-appearance: none; background: none; border-color: transparent; } +%else +menubar:-moz-lwtheme, +toolbar:-moz-lwtheme { + -moz-appearance: none; + background: none; + border-style: none; +} +%endif menubar { -moz-appearance: dialog; /* For content menubars, "toolbar" is too dark, so we use "dialog". */ diff --git a/toolkit/themes/windows/global/jar.mn b/toolkit/themes/windows/global/jar.mn index a2cc9e2ea..6f0cf4130 100644 --- a/toolkit/themes/windows/global/jar.mn +++ b/toolkit/themes/windows/global/jar.mn @@ -37,7 +37,7 @@ toolkit.jar: skin/classic/global/printPreview.css skin/classic/global/scrollbox.css skin/classic/global/splitter.css - skin/classic/global/toolbar.css +* skin/classic/global/toolbar.css skin/classic/global/toolbarbutton.css * skin/classic/global/tree.css skin/classic/global/alerts/alert.css (alerts/alert.css) diff --git a/toolkit/themes/windows/global/toolbar.css b/toolkit/themes/windows/global/toolbar.css index dcd8d361f..38c8a617a 100644 --- a/toolkit/themes/windows/global/toolbar.css +++ b/toolkit/themes/windows/global/toolbar.css @@ -37,7 +37,8 @@ toolbar:first-child, menubar { } /* ::::: lightweight theme ::::: */ - + +%ifdef MOZ_AUSTRALIS menubar:-moz-lwtheme, toolbox:-moz-lwtheme, toolbar:-moz-lwtheme { @@ -45,6 +46,15 @@ toolbar:-moz-lwtheme { background: none; border-color: transparent; } +%else +menubar:-moz-lwtheme, +toolbox:-moz-lwtheme, +toolbar:-moz-lwtheme { + -moz-appearance: none; + background: none; + border-style: none; +} +%endif /* ::::: toolbar decorations ::::: */ diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 40f9ead79..59a72c432 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -4338,11 +4338,6 @@ mozilla::BrowserTabsRemoteAutostart() gBrowserTabsRemoteStatus = status; - mozilla::Telemetry::Accumulate(mozilla::Telemetry::E10S_STATUS, status); - if (prefEnabled) { - mozilla::Telemetry::Accumulate(mozilla::Telemetry::E10S_BLOCKED_FROM_RUNNING, - !gBrowserTabsRemoteAutostart); - } return gBrowserTabsRemoteAutostart; } diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp index d904cb83a..265652477 100644 --- a/toolkit/xre/nsXREDirProvider.cpp +++ b/toolkit/xre/nsXREDirProvider.cpp @@ -953,27 +953,6 @@ nsXREDirProvider::DoStartup() else mode = 2; } - mozilla::Telemetry::Accumulate(mozilla::Telemetry::SAFE_MODE_USAGE, mode); - - // Telemetry about number of profiles. - nsCOMPtr<nsIToolkitProfileService> profileService = - do_GetService("@mozilla.org/toolkit/profile-service;1"); - if (profileService) { - nsCOMPtr<nsISimpleEnumerator> profiles; - rv = profileService->GetProfiles(getter_AddRefs(profiles)); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - uint32_t count = 0; - nsCOMPtr<nsISupports> profile; - while (NS_SUCCEEDED(profiles->GetNext(getter_AddRefs(profile)))) { - ++count; - } - - mozilla::Telemetry::Accumulate(mozilla::Telemetry::NUMBER_OF_PROFILES, - count); - } obsSvc->NotifyObservers(nullptr, "profile-initial-state", nullptr); } |