diff options
Diffstat (limited to 'toolkit/components')
-rw-r--r-- | toolkit/components/alerts/nsXULAlerts.cpp | 15 | ||||
-rw-r--r-- | toolkit/components/downloads/ApplicationReputation.cpp | 8 | ||||
-rw-r--r-- | toolkit/components/osfile/NativeOSFileInternals.cpp | 1 | ||||
-rw-r--r-- | toolkit/components/passwordmgr/LoginManagerParent.jsm | 9 | ||||
-rw-r--r-- | toolkit/components/perfmonitoring/nsPerformanceStats.cpp | 27 | ||||
-rw-r--r-- | toolkit/components/perfmonitoring/nsPerformanceStats.h | 17 | ||||
-rw-r--r-- | toolkit/components/places/Database.cpp | 2 | ||||
-rw-r--r-- | toolkit/components/places/Helpers.cpp | 7 | ||||
-rw-r--r-- | toolkit/components/places/Helpers.h | 21 | ||||
-rw-r--r-- | toolkit/components/places/nsNavHistory.cpp | 4 | ||||
-rw-r--r-- | toolkit/components/search/current/nsSearchService.js | 9 | ||||
-rw-r--r-- | toolkit/components/search/orginal/nsSearchService.js | 6 | ||||
-rw-r--r-- | toolkit/components/telemetry/TelemetryHistogram.cpp | 37 | ||||
-rw-r--r-- | toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp | 110 | ||||
-rw-r--r-- | toolkit/components/webextensions/ExtensionUtils.jsm | 3 |
15 files changed, 33 insertions, 243 deletions
diff --git a/toolkit/components/alerts/nsXULAlerts.cpp b/toolkit/components/alerts/nsXULAlerts.cpp index 882617637..d353d8714 100644 --- a/toolkit/components/alerts/nsXULAlerts.cpp +++ b/toolkit/components/alerts/nsXULAlerts.cpp @@ -18,7 +18,6 @@ #include "nsIWindowWatcher.h" using namespace mozilla; -using mozilla::dom::NotificationTelemetryService; #define ALERT_CHROME_URL "chrome://global/content/alerts/alert.xul" @@ -185,20 +184,6 @@ nsXULAlerts::ShowAlertWithIconURI(nsIAlertNotification* aAlert, NS_ENSURE_SUCCESS(rv, rv); if (mDoNotDisturb) { - if (!inPrivateBrowsing) { - RefPtr<NotificationTelemetryService> telemetry = - NotificationTelemetryService::GetInstance(); - if (telemetry) { - // Record the number of unique senders for XUL alerts. The OS X and - // libnotify backends will fire `alertshow` even if "do not disturb" - // is enabled. In that case, `NotificationObserver` will record the - // sender. - nsCOMPtr<nsIPrincipal> principal; - if (NS_SUCCEEDED(aAlert->GetPrincipal(getter_AddRefs(principal)))) { - Unused << NS_WARN_IF(NS_FAILED(telemetry->RecordSender(principal))); - } - } - } if (aAlertListener) aAlertListener->Observe(nullptr, "alertfinished", cookie.get()); return NS_OK; diff --git a/toolkit/components/downloads/ApplicationReputation.cpp b/toolkit/components/downloads/ApplicationReputation.cpp index a369ca884..9fdc8a103 100644 --- a/toolkit/components/downloads/ApplicationReputation.cpp +++ b/toolkit/components/downloads/ApplicationReputation.cpp @@ -117,14 +117,6 @@ private: friend class PendingDBLookup; - // Telemetry states. - // Status of the remote response (valid or not). - enum SERVER_RESPONSE_TYPES { - SERVER_RESPONSE_VALID = 0, - SERVER_RESPONSE_FAILED = 1, - SERVER_RESPONSE_INVALID = 2, - }; - // Number of blocklist and allowlist hits we have seen. uint32_t mBlocklistCount; uint32_t mAllowlistCount; diff --git a/toolkit/components/osfile/NativeOSFileInternals.cpp b/toolkit/components/osfile/NativeOSFileInternals.cpp index e4725d390..36517d9ec 100644 --- a/toolkit/components/osfile/NativeOSFileInternals.cpp +++ b/toolkit/components/osfile/NativeOSFileInternals.cpp @@ -232,7 +232,6 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(AbstractResult) NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(AbstractResult) - NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AbstractResult) diff --git a/toolkit/components/passwordmgr/LoginManagerParent.jsm b/toolkit/components/passwordmgr/LoginManagerParent.jsm index e472fb61c..2d75dac7a 100644 --- a/toolkit/components/passwordmgr/LoginManagerParent.jsm +++ b/toolkit/components/passwordmgr/LoginManagerParent.jsm @@ -102,8 +102,13 @@ var LoginManagerParent = { } case "RemoteLogins:findRecipes": { - let formHost = (new URL(data.formOrigin)).host; - return this._recipeManager.getRecipesForHost(formHost); + try { + let formHost = (new URL(data.formOrigin)).host; + return this._recipeManager.getRecipesForHost(formHost); + } catch(e) { + // Just return an empty set in case of error. + return new Set(); + } } case "RemoteLogins:onFormSubmit": { diff --git a/toolkit/components/perfmonitoring/nsPerformanceStats.cpp b/toolkit/components/perfmonitoring/nsPerformanceStats.cpp index 33aeaf7c2..59d84ced1 100644 --- a/toolkit/components/perfmonitoring/nsPerformanceStats.cpp +++ b/toolkit/components/perfmonitoring/nsPerformanceStats.cpp @@ -662,9 +662,6 @@ nsPerformanceStatsService::nsPerformanceStatsService() nsPerformanceGroup::GroupScope::RUNTIME // scope )) , mIsHandlingUserInput(false) - , mProcessStayed(0) - , mProcessMoved(0) - , mProcessUpdateCounter(0) , mIsMonitoringPerCompartment(false) , mJankAlertThreshold(mozilla::MaxValue<uint64_t>::value) // By default, no alerts , mJankAlertBufferingDelay(1000 /* ms */) @@ -953,13 +950,6 @@ nsPerformanceStatsService::SetJankAlertBufferingDelay(uint32_t value) { return NS_OK; } -nsresult -nsPerformanceStatsService::UpdateTelemetry() -{ - /* STUB */ - return NS_OK; -} - /* static */ nsIPerformanceStats* nsPerformanceStatsService::GetStatsForGroup(const js::PerformanceGroup* group) @@ -992,12 +982,6 @@ nsPerformanceStatsService::GetSnapshot(JSContext* cx, nsIPerformanceSnapshot * * } } - js::GetPerfMonitoringTestCpuRescheduling(cx, &mProcessStayed, &mProcessMoved); - - if (++mProcessUpdateCounter % 10 == 0) { - mozilla::Unused << UpdateTelemetry(); - } - snapshot.forget(aSnapshot); return NS_OK; @@ -1098,6 +1082,9 @@ nsPerformanceStatsService::GetPerformanceGroups(JSContext* cx, return false; } + // Returning a vector that is too large would cause allocations all over the + // place in the JS engine. We want to be sure that all data is stored inline. + MOZ_ASSERT(out.length() <= out.sMaxInlineStorage); return true; } @@ -1326,8 +1313,12 @@ nsPerformanceStatsService::GetResources(uint64_t* userTime, void nsPerformanceStatsService::NotifyJankObservers(const mozilla::Vector<uint64_t>& aPreviousJankLevels) { - GroupVector alerts; - mPendingAlerts.swap(alerts); + + // The move operation is generally constant time, unless + // `mPendingAlerts.length()` is very small, in which case it's fast anyway. + GroupVector alerts(Move(mPendingAlerts)); + mPendingAlerts = GroupVector(); // Reconstruct after `Move`. + if (!mPendingAlertsCollector) { // We are shutting down. return; diff --git a/toolkit/components/perfmonitoring/nsPerformanceStats.h b/toolkit/components/perfmonitoring/nsPerformanceStats.h index c82a3e92c..661a78a1a 100644 --- a/toolkit/components/perfmonitoring/nsPerformanceStats.h +++ b/toolkit/components/perfmonitoring/nsPerformanceStats.h @@ -19,7 +19,7 @@ class nsPerformanceGroup; class nsPerformanceGroupDetails; -typedef mozilla::Vector<RefPtr<nsPerformanceGroup>> GroupVector; +typedef mozilla::Vector<RefPtr<nsPerformanceGroup>, 8> GroupVector; /** * A data structure for registering observers interested in @@ -363,21 +363,6 @@ protected: nsPerformanceGroup* group); - - - /********************************************************** - * - * To check whether our algorithm makes sense, we keep count of the - * number of times the process has been rescheduled to another CPU - * while we were monitoring the performance of a group and we upload - * this data through Telemetry. - */ - nsresult UpdateTelemetry(); - - uint64_t mProcessStayed; - uint64_t mProcessMoved; - uint32_t mProcessUpdateCounter; - /********************************************************** * * Options controlling measurements. diff --git a/toolkit/components/places/Database.cpp b/toolkit/components/places/Database.cpp index a87c14b37..08c382377 100644 --- a/toolkit/components/places/Database.cpp +++ b/toolkit/components/places/Database.cpp @@ -597,7 +597,7 @@ Database::BackupAndReplaceDatabaseFile(nsCOMPtr<mozIStorageService>& aStorage) // If anything fails from this point on, we have a stale connection or // database file, and there's not much more we can do. // The only thing we can try to do is to replace the database on the next - // startup, and report the problem through telemetry. + // startup. { enum eCorruptDBReplaceStage : int8_t { stage_closing = 0, diff --git a/toolkit/components/places/Helpers.cpp b/toolkit/components/places/Helpers.cpp index dda162197..13e040bfd 100644 --- a/toolkit/components/places/Helpers.cpp +++ b/toolkit/components/places/Helpers.cpp @@ -382,12 +382,5 @@ AsyncStatementCallbackNotifier::HandleCompletion(uint16_t aReason) //////////////////////////////////////////////////////////////////////////////// //// AsyncStatementCallbackNotifier -NS_IMETHODIMP -AsyncStatementTelemetryTimer::HandleCompletion(uint16_t aReason) -{ - /* STUB */ - return NS_OK; -} - } // namespace places } // namespace mozilla diff --git a/toolkit/components/places/Helpers.h b/toolkit/components/places/Helpers.h index 654e42539..4e79abc75 100644 --- a/toolkit/components/places/Helpers.h +++ b/toolkit/components/places/Helpers.h @@ -15,7 +15,6 @@ #include "nsThreadUtils.h" #include "nsProxyRelease.h" #include "prtime.h" -#include "mozilla/Telemetry.h" namespace mozilla { namespace places { @@ -270,26 +269,6 @@ private: const char* mTopic; }; -/** - * Used to notify a topic to system observers on async execute completion. - */ -class AsyncStatementTelemetryTimer : public AsyncStatementCallback -{ -public: - explicit AsyncStatementTelemetryTimer(Telemetry::ID aHistogramId, - TimeStamp aStart = TimeStamp::Now()) - : mHistogramId(aHistogramId) - , mStart(aStart) - { - } - - NS_IMETHOD HandleCompletion(uint16_t aReason); - -private: - const Telemetry::ID mHistogramId; - const TimeStamp mStart; -}; - } // namespace places } // namespace mozilla diff --git a/toolkit/components/places/nsNavHistory.cpp b/toolkit/components/places/nsNavHistory.cpp index 49d911d65..e72526022 100644 --- a/toolkit/components/places/nsNavHistory.cpp +++ b/toolkit/components/places/nsNavHistory.cpp @@ -3063,17 +3063,15 @@ nsNavHistory::Observe(nsISupports *aSubject, const char *aTopic, namespace { -class DecayFrecencyCallback : public AsyncStatementTelemetryTimer +class DecayFrecencyCallback : public AsyncStatementCallback { public: DecayFrecencyCallback() - : AsyncStatementTelemetryTimer(Telemetry::PLACES_IDLE_FRECENCY_DECAY_TIME_MS) { } NS_IMETHOD HandleCompletion(uint16_t aReason) { - (void)AsyncStatementTelemetryTimer::HandleCompletion(aReason); if (aReason == REASON_FINISHED) { nsNavHistory *navHistory = nsNavHistory::GetHistoryService(); NS_ENSURE_STATE(navHistory); diff --git a/toolkit/components/search/current/nsSearchService.js b/toolkit/components/search/current/nsSearchService.js index 99e73b50b..6e8f6da43 100644 --- a/toolkit/components/search/current/nsSearchService.js +++ b/toolkit/components/search/current/nsSearchService.js @@ -21,6 +21,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Deprecated", + "resource://gre/modules/Deprecated.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "SearchStaticData", "resource://gre/modules/SearchStaticData.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "setTimeout", @@ -2691,6 +2693,13 @@ SearchService.prototype = { return; } + let performanceWarning = + "Search service falling back to synchronous initialization. " + + "This is generally the consequence of an add-on using a deprecated " + + "search service API."; + Deprecated.perfWarning(performanceWarning, "https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIBrowserSearchService#async_warning"); + LOG(performanceWarning); + this._syncInit(); if (!Components.isSuccessCode(this._initRV)) { throw this._initRV; diff --git a/toolkit/components/search/orginal/nsSearchService.js b/toolkit/components/search/orginal/nsSearchService.js index 8d81e1a27..6b23724a7 100644 --- a/toolkit/components/search/orginal/nsSearchService.js +++ b/toolkit/components/search/orginal/nsSearchService.js @@ -2917,12 +2917,12 @@ SearchService.prototype = { return; } - let warning = + let performanceWarning = "Search service falling back to synchronous initialization. " + "This is generally the consequence of an add-on using a deprecated " + "search service API."; - Deprecated.warning(warning, "https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIBrowserSearchService#async_warning"); - LOG(warning); + Deprecated.perfWarning(performanceWarning, "https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIBrowserSearchService#async_warning"); + LOG(performanceWarning); engineMetadataService.syncInit(); this._syncInit(); diff --git a/toolkit/components/telemetry/TelemetryHistogram.cpp b/toolkit/components/telemetry/TelemetryHistogram.cpp index ba0288979..30fcc05ee 100644 --- a/toolkit/components/telemetry/TelemetryHistogram.cpp +++ b/toolkit/components/telemetry/TelemetryHistogram.cpp @@ -2090,11 +2090,6 @@ void TelemetryHistogram::InitializeGlobalState(bool canRecordBase, // don't go unnoticed. // TODO: Compare explicitly with gHistograms[<histogram id>].bucketCount here // once we can make gHistograms constexpr (requires VS2015). - static_assert((JS::gcreason::NUM_TELEMETRY_REASONS == 100), - "NUM_TELEMETRY_REASONS is assumed to be a fixed value in Histograms.json." - " If this was an intentional change, update this assert with its value " - "and update the n_values for the following in Histograms.json: " - "GC_MINOR_REASON, GC_MINOR_REASON_LONG, GC_REASON_2"); static_assert((mozilla::StartupTimeline::MAX_EVENT_ID == 16), "MAX_EVENT_ID is assumed to be a fixed value in Histograms.json. If this" " was an intentional change, update this assert with its value and update" @@ -2689,37 +2684,5 @@ TelemetryHistogram::IPCTimerFired(nsITimer* aTimer, void* aClosure) } } - switch (XRE_GetProcessType()) { - case GeckoProcessType_Content: { - mozilla::dom::ContentChild* contentChild = mozilla::dom::ContentChild::GetSingleton(); - mozilla::Unused << NS_WARN_IF(!contentChild); - if (contentChild) { - if (accumulationsToSend.Length()) { - mozilla::Unused << - NS_WARN_IF(!contentChild->SendAccumulateChildHistogram(accumulationsToSend)); - } - if (keyedAccumulationsToSend.Length()) { - mozilla::Unused << - NS_WARN_IF(!contentChild->SendAccumulateChildKeyedHistogram(keyedAccumulationsToSend)); - } - } - break; - } - case GeckoProcessType_GPU: { - if (mozilla::gfx::GPUParent* gpu = mozilla::gfx::GPUParent::GetSingleton()) { - if (accumulationsToSend.Length()) { - mozilla::Unused << gpu->SendAccumulateChildHistogram(accumulationsToSend); - } - if (keyedAccumulationsToSend.Length()) { - mozilla::Unused << gpu->SendAccumulateChildKeyedHistogram(keyedAccumulationsToSend); - } - } - break; - } - default: - MOZ_ASSERT_UNREACHABLE("Unsupported process type"); - break; - } - gIPCTimerArmed = false; } diff --git a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp index e230f6951..9319822d5 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp @@ -20,7 +20,6 @@ #include "mozilla/Logging.h" #include "nsIInterfaceRequestor.h" #include "mozilla/LoadContext.h" -#include "mozilla/Telemetry.h" #include "nsContentUtils.h" #include "nsIURLFormatter.h" @@ -503,115 +502,6 @@ nsUrlClassifierStreamUpdater::AddRequestBody(const nsACString &aRequestBody) return NS_OK; } -// Map the HTTP response code to a Telemetry bucket -static uint32_t HTTPStatusToBucket(uint32_t status) -{ - uint32_t statusBucket; - switch (status) { - case 100: - case 101: - // Unexpected 1xx return code - statusBucket = 0; - break; - case 200: - // OK - Data is available in the HTTP response body. - statusBucket = 1; - break; - case 201: - case 202: - case 203: - case 205: - case 206: - // Unexpected 2xx return code - statusBucket = 2; - break; - case 204: - // No Content - statusBucket = 3; - break; - case 300: - case 301: - case 302: - case 303: - case 304: - case 305: - case 307: - case 308: - // Unexpected 3xx return code - statusBucket = 4; - break; - case 400: - // Bad Request - The HTTP request was not correctly formed. - // The client did not provide all required CGI parameters. - statusBucket = 5; - break; - case 401: - case 402: - case 405: - case 406: - case 407: - case 409: - case 410: - case 411: - case 412: - case 414: - case 415: - case 416: - case 417: - case 421: - case 426: - case 428: - case 429: - case 431: - case 451: - // Unexpected 4xx return code - statusBucket = 6; - break; - case 403: - // Forbidden - The client id is invalid. - statusBucket = 7; - break; - case 404: - // Not Found - statusBucket = 8; - break; - case 408: - // Request Timeout - statusBucket = 9; - break; - case 413: - // Request Entity Too Large - Bug 1150334 - statusBucket = 10; - break; - case 500: - case 501: - case 510: - // Unexpected 5xx return code - statusBucket = 11; - break; - case 502: - case 504: - case 511: - // Local network errors, we'll ignore these. - statusBucket = 12; - break; - case 503: - // Service Unavailable - The server cannot handle the request. - // Clients MUST follow the backoff behavior specified in the - // Request Frequency section. - statusBucket = 13; - break; - case 505: - // HTTP Version Not Supported - The server CANNOT handle the requested - // protocol major version. - statusBucket = 14; - break; - default: - statusBucket = 15; - }; - return statusBucket; -} - /////////////////////////////////////////////////////////////////////////////// // nsIStreamListenerObserver implementation diff --git a/toolkit/components/webextensions/ExtensionUtils.jsm b/toolkit/components/webextensions/ExtensionUtils.jsm index e7f768c07..04e767cb5 100644 --- a/toolkit/components/webextensions/ExtensionUtils.jsm +++ b/toolkit/components/webextensions/ExtensionUtils.jsm @@ -990,7 +990,8 @@ function findPathInObject(obj, path, printErrors = true) { for (let elt of path.split(".")) { if (!obj || !(elt in obj)) { if (printErrors) { - Cu.reportError(`WebExtension API ${path} not found (it may be unimplemented by Firefox).`); + let appname = Services.appinfo.name; + Cu.reportError(`WebExtension API ${path} not found (it may be unimplemented by ${appname}).`); } return null; } |