diff --git a/dom/workers/SharedWorker.cpp b/dom/workers/SharedWorker.cpp index 187d8da06dec..2d5879584401 100644 --- a/dom/workers/SharedWorker.cpp +++ b/dom/workers/SharedWorker.cpp @@ -12,6 +12,7 @@ #include "mozilla/Preferences.h" #include "mozilla/dom/MessagePort.h" #include "mozilla/dom/SharedWorkerBinding.h" +#include "mozilla/Telemetry.h" #include "nsContentUtils.h" #include "nsIClassInfoImpl.h" #include "nsIDOMEvent.h" @@ -72,6 +73,8 @@ SharedWorker::Constructor(const GlobalObject& aGlobal, JSContext* aCx, return nullptr; } + Telemetry::Accumulate(Telemetry::SHARED_WORKER_COUNT, 1); + return sharedWorker.forget(); } diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index f14e4600cc42..2b0f781397cd 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -9862,6 +9862,13 @@ "description": "When restoring tabs on startup, reading from sessionstore.js failed, even though the file exists and is not containing an explicitly empty window.", "cpp_guard": "ANDROID" }, + "SHARED_WORKER_COUNT": { + "alert_emails": ["amarchesini@mozilla.com"], + "expires_in_version": "58", + "kind": "count", + "bug_numbers": [1295980], + "description": "Number of the use of SharedWorkers." + }, "FENNEC_SESSIONSTORE_RESTORING_FROM_BACKUP": { "alert_emails": ["jh+bugzilla@buttercookie.de"], "expires_in_version": "56",