summaryrefslogtreecommitdiffstats
path: root/toolkit/components
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components')
-rw-r--r--toolkit/components/alerts/nsXULAlerts.cpp15
-rw-r--r--toolkit/components/downloads/ApplicationReputation.cpp8
-rw-r--r--toolkit/components/passwordmgr/LoginManagerParent.jsm9
-rw-r--r--toolkit/components/perfmonitoring/nsPerformanceStats.cpp16
-rw-r--r--toolkit/components/perfmonitoring/nsPerformanceStats.h15
-rw-r--r--toolkit/components/places/Database.cpp2
-rw-r--r--toolkit/components/places/Helpers.cpp7
-rw-r--r--toolkit/components/places/Helpers.h21
-rw-r--r--toolkit/components/places/nsNavHistory.cpp4
-rw-r--r--toolkit/components/search/current/nsSearchService.js9
-rw-r--r--toolkit/components/search/orginal/nsSearchService.js6
-rw-r--r--toolkit/components/telemetry/TelemetryHistogram.cpp32
-rw-r--r--toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp110
-rw-r--r--toolkit/components/webextensions/ExtensionUtils.jsm3
14 files changed, 23 insertions, 234 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/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..6c470356a 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;
diff --git a/toolkit/components/perfmonitoring/nsPerformanceStats.h b/toolkit/components/perfmonitoring/nsPerformanceStats.h
index c82a3e92c..6902c840d 100644
--- a/toolkit/components/perfmonitoring/nsPerformanceStats.h
+++ b/toolkit/components/perfmonitoring/nsPerformanceStats.h
@@ -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..c97367a36 100644
--- a/toolkit/components/telemetry/TelemetryHistogram.cpp
+++ b/toolkit/components/telemetry/TelemetryHistogram.cpp
@@ -2689,37 +2689,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;
}