Remove all C++ Telemetry Accumulation calls.

This creates a number of stubs and leaves some surrounding code that may be irrelevant (eg. recorded time stamps, status variables).
Stub resolution/removal should be a follow-up to this.
This commit is contained in:
wolfbeast 2018-09-03 10:11:38 +02:00 • committed by Roy Tam
commit 8c8145e620
186 changed files with 48 additions and 2957 deletions

View file

@ -14,22 +14,22 @@ namespace a11y {
namespace statistics { namespace statistics {
inline void A11yInitialized() inline void A11yInitialized()
{ Telemetry::Accumulate(Telemetry::A11Y_INSTANTIATED_FLAG, true); } { /* STUB */ }
inline void A11yConsumers(uint32_t aConsumer) inline void A11yConsumers(uint32_t aConsumer)
{ Telemetry::Accumulate(Telemetry::A11Y_CONSUMERS, aConsumer); } { /* STUB */ }
/** /**
* Report that ISimpleDOM* has been used. * Report that ISimpleDOM* has been used.
*/ */
inline void ISimpleDOMUsed() inline void ISimpleDOMUsed()
{ Telemetry::Accumulate(Telemetry::A11Y_ISIMPLEDOM_USAGE_FLAG, true); } { /* STUB */ }
/** /**
* Report that IAccessibleTable has been used. * Report that IAccessibleTable has been used.
*/ */
inline void IAccessibleTableUsed() inline void IAccessibleTableUsed()
{ Telemetry::Accumulate(Telemetry::A11Y_IATABLE_USAGE_FLAG, true); } { /* STUB */ }
} // namespace statistics } // namespace statistics
} // namespace a11y } // namespace a11y

View file

@ -28,7 +28,6 @@
#include "mozilla/dom/ContentChild.h" #include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/HeapSnapshotBinding.h" #include "mozilla/dom/HeapSnapshotBinding.h"
#include "mozilla/RangedPtr.h" #include "mozilla/RangedPtr.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Unused.h" #include "mozilla/Unused.h"
#include "jsapi.h" #include "jsapi.h"
@ -1610,13 +1609,6 @@ ThreadSafeChromeUtils::SaveHeapSnapshot(GlobalObject& global,
return; return;
} }
} }
Telemetry::AccumulateTimeDelta(Telemetry::DEVTOOLS_SAVE_HEAP_SNAPSHOT_MS,
start);
Telemetry::Accumulate(Telemetry::DEVTOOLS_HEAP_SNAPSHOT_NODE_COUNT,
nodeCount);
Telemetry::Accumulate(Telemetry::DEVTOOLS_HEAP_SNAPSHOT_EDGE_COUNT,
edgeCount);
} }
/* static */ already_AddRefed<HeapSnapshot> /* static */ already_AddRefed<HeapSnapshot>
@ -1641,10 +1633,6 @@ ThreadSafeChromeUtils::ReadHeapSnapshot(GlobalObject& global,
global.Context(), global, reinterpret_cast<const uint8_t*>(mm.address()), global.Context(), global, reinterpret_cast<const uint8_t*>(mm.address()),
mm.size(), rv); mm.size(), rv);
if (!rv.Failed())
Telemetry::AccumulateTimeDelta(Telemetry::DEVTOOLS_READ_HEAP_SNAPSHOT_MS,
start);
return snapshot.forget(); return snapshot.forget();
} }

View file

@ -1972,71 +1972,7 @@ nsDocShell::GetCharset(nsACString& aCharset)
NS_IMETHODIMP NS_IMETHODIMP
nsDocShell::GatherCharsetMenuTelemetry() nsDocShell::GatherCharsetMenuTelemetry()
{ {
nsCOMPtr<nsIContentViewer> viewer; /* STUB */
GetContentViewer(getter_AddRefs(viewer));
if (!viewer) {
return NS_OK;
}
nsIDocument* doc = viewer->GetDocument();
if (!doc || doc->WillIgnoreCharsetOverride()) {
return NS_OK;
}
Telemetry::Accumulate(Telemetry::CHARSET_OVERRIDE_USED, true);
bool isFileURL = false;
nsIURI* url = doc->GetOriginalURI();
if (url) {
url->SchemeIs("file", &isFileURL);
}
int32_t charsetSource = doc->GetDocumentCharacterSetSource();
switch (charsetSource) {
case kCharsetFromTopLevelDomain:
// Unlabeled doc on a domain that we map to a fallback encoding
Telemetry::Accumulate(Telemetry::CHARSET_OVERRIDE_SITUATION, 7);
break;
case kCharsetFromFallback:
case kCharsetFromDocTypeDefault:
case kCharsetFromCache:
case kCharsetFromParentFrame:
case kCharsetFromHintPrevDoc:
// Changing charset on an unlabeled doc.
if (isFileURL) {
Telemetry::Accumulate(Telemetry::CHARSET_OVERRIDE_SITUATION, 0);
} else {
Telemetry::Accumulate(Telemetry::CHARSET_OVERRIDE_SITUATION, 1);
}
break;
case kCharsetFromAutoDetection:
// Changing charset on unlabeled doc where chardet fired
if (isFileURL) {
Telemetry::Accumulate(Telemetry::CHARSET_OVERRIDE_SITUATION, 2);
} else {
Telemetry::Accumulate(Telemetry::CHARSET_OVERRIDE_SITUATION, 3);
}
break;
case kCharsetFromMetaPrescan:
case kCharsetFromMetaTag:
case kCharsetFromChannel:
// Changing charset on a doc that had a charset label.
Telemetry::Accumulate(Telemetry::CHARSET_OVERRIDE_SITUATION, 4);
break;
case kCharsetFromParentForced:
case kCharsetFromUserForced:
// Changing charset on a document that already had an override.
Telemetry::Accumulate(Telemetry::CHARSET_OVERRIDE_SITUATION, 5);
break;
case kCharsetFromIrreversibleAutoDetection:
case kCharsetFromOtherComponent:
case kCharsetFromByteOrderMark:
case kCharsetUninitialized:
default:
// Bug. This isn't supposed to happen.
Telemetry::Accumulate(Telemetry::CHARSET_OVERRIDE_SITUATION, 6);
break;
}
return NS_OK; return NS_OK;
} }
@ -5062,10 +4998,6 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
errorPage.Assign(alternateErrorPage); errorPage.Assign(alternateErrorPage);
} }
if (!IsFrame() && errorPage.EqualsIgnoreCase("certerror")) {
Telemetry::Accumulate(mozilla::Telemetry::SECURITY_UI, bucketId);
}
} else { } else {
error.AssignLiteral("nssFailure2"); error.AssignLiteral("nssFailure2");
} }
@ -5105,10 +5037,6 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
: nsISecurityUITelemetry::WARNING_UNWANTED_PAGE_TOP; : nsISecurityUITelemetry::WARNING_UNWANTED_PAGE_TOP;
} }
if (sendTelemetry && errorPage.EqualsIgnoreCase("blocked")) {
Telemetry::Accumulate(Telemetry::SECURITY_UI, bucketId);
}
cssClass.AssignLiteral("blacklist"); cssClass.AssignLiteral("blacklist");
} else if (NS_ERROR_CONTENT_CRASHED == aError) { } else if (NS_ERROR_CONTENT_CRASHED == aError) {
errorPage.AssignLiteral("tabcrashed"); errorPage.AssignLiteral("tabcrashed");
@ -7622,8 +7550,6 @@ nsDocShell::EndPageLoad(nsIWebProgress* aProgress,
TimeStamp channelCreationTime; TimeStamp channelCreationTime;
rv = timingChannel->GetChannelCreation(&channelCreationTime); rv = timingChannel->GetChannelCreation(&channelCreationTime);
if (NS_SUCCEEDED(rv) && !channelCreationTime.IsNull()) { if (NS_SUCCEEDED(rv) && !channelCreationTime.IsNull()) {
Telemetry::AccumulateTimeDelta(Telemetry::TOTAL_CONTENT_PAGE_LOAD_TIME,
channelCreationTime);
nsCOMPtr<nsPILoadGroupInternal> internalLoadGroup = nsCOMPtr<nsPILoadGroupInternal> internalLoadGroup =
do_QueryInterface(mLoadGroup); do_QueryInterface(mLoadGroup);
if (internalLoadGroup) { if (internalLoadGroup) {

View file

@ -49,7 +49,6 @@
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsIDOMGlobalPropertyInitializer.h" #include "nsIDOMGlobalPropertyInitializer.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "mozilla/Telemetry.h"
// Window scriptable helper includes // Window scriptable helper includes
#include "nsScriptNameSpaceManager.h" #include "nsScriptNameSpaceManager.h"
@ -1903,9 +1902,6 @@ LookupComponentsShim(JSContext *cx, JS::Handle<JSObject*> global,
nsPIDOMWindowInner *win, nsPIDOMWindowInner *win,
JS::MutableHandle<JS::PropertyDescriptor> desc) JS::MutableHandle<JS::PropertyDescriptor> desc)
{ {
// Keep track of how often this happens.
Telemetry::Accumulate(Telemetry::COMPONENTS_SHIM_ACCESSED_BY_CONTENT, true);
// Warn once. // Warn once.
nsCOMPtr<nsIDocument> doc = win->GetExtantDoc(); nsCOMPtr<nsIDocument> doc = win->GetExtantDoc();
if (doc) { if (doc) {

View file

@ -15,7 +15,6 @@
#include "nsPrintfCString.h" #include "nsPrintfCString.h"
#include "mozilla/dom/PerformanceNavigation.h" #include "mozilla/dom/PerformanceNavigation.h"
#include "mozilla/TimeStamp.h" #include "mozilla/TimeStamp.h"
#include "mozilla/Telemetry.h"
using namespace mozilla; using namespace mozilla;
@ -203,12 +202,6 @@ nsDOMNavigationTiming::NotifyNonBlankPaintForRootContentDocument()
mDocShellHasBeenActiveSinceNavigationStart ? "foreground tab" : "this tab was inactive some of the time between navigation start and first non-blank paint"); mDocShellHasBeenActiveSinceNavigationStart ? "foreground tab" : "this tab was inactive some of the time between navigation start and first non-blank paint");
PROFILER_MARKER(marker.get()); PROFILER_MARKER(marker.get());
} }
if (mDocShellHasBeenActiveSinceNavigationStart) {
Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_NON_BLANK_PAINT_MS,
mNavigationStart,
mNonBlankPaint);
}
} }
void void

View file

@ -25,7 +25,6 @@
#include "plstr.h" #include "plstr.h"
#include "mozilla/Sprintf.h" #include "mozilla/Sprintf.h"
#include "mozilla/Telemetry.h"
#include "nsIInterfaceRequestor.h" #include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h" #include "nsIInterfaceRequestorUtils.h"
#include "nsILoadContext.h" #include "nsILoadContext.h"
@ -12370,101 +12369,7 @@ MightBeAboutOrChromeScheme(nsIURI* aURI)
void void
nsDocument::ReportUseCounters() nsDocument::ReportUseCounters()
{ {
static const bool sDebugUseCounters = false; /* STUB */
if (mReportedUseCounters) {
return;
}
mReportedUseCounters = true;
if (Telemetry::HistogramUseCounterCount > 0 &&
(IsContentDocument() || IsResourceDoc())) {
nsCOMPtr<nsIURI> uri;
NodePrincipal()->GetURI(getter_AddRefs(uri));
if (!uri || MightBeAboutOrChromeScheme(uri)) {
return;
}
if (sDebugUseCounters) {
nsCString spec = uri->GetSpecOrDefault();
// URIs can be rather long for data documents, so truncate them to
// some reasonable length.
spec.Truncate(std::min(128U, spec.Length()));
printf("-- Use counters for %s --\n", spec.get());
}
// We keep separate counts for individual documents and top-level
// pages to more accurately track how many web pages might break if
// certain features were removed. Consider the case of a single
// HTML document with several SVG images and/or iframes with
// sub-documents of their own. If we maintained a single set of use
// counters and all the sub-documents use a particular feature, then
// telemetry would indicate that we would be breaking N documents if
// that feature were removed. Whereas with a document/top-level
// page split, we can see that N documents would be affected, but
// only a single web page would be affected.
// The difference between the values of these two histograms and the
// related use counters below tell us how many pages did *not* use
// the feature in question. For instance, if we see that a given
// session has destroyed 30 content documents, but a particular use
// counter shows only a count of 5, we can infer that the use
// counter was *not* used in 25 of those 30 documents.
//
// We do things this way, rather than accumulating a boolean flag
// for each use counter, to avoid sending histograms for features
// that don't get widely used. Doing things in this fashion means
// smaller telemetry payloads and faster processing on the server
// side.
Telemetry::Accumulate(Telemetry::CONTENT_DOCUMENTS_DESTROYED, 1);
if (IsTopLevelContentDocument()) {
Telemetry::Accumulate(Telemetry::TOP_LEVEL_CONTENT_DOCUMENTS_DESTROYED, 1);
}
for (int32_t c = 0;
c < eUseCounter_Count; ++c) {
UseCounter uc = static_cast<UseCounter>(c);
Telemetry::ID id =
static_cast<Telemetry::ID>(Telemetry::HistogramFirstUseCounter + uc * 2);
bool value = GetUseCounter(uc);
if (value) {
if (sDebugUseCounters) {
const char* name = Telemetry::GetHistogramName(id);
if (name) {
printf(" %s", name);
} else {
printf(" #%d", id);
}
printf(": %d\n", value);
}
Telemetry::Accumulate(id, 1);
}
if (IsTopLevelContentDocument()) {
id = static_cast<Telemetry::ID>(Telemetry::HistogramFirstUseCounter +
uc * 2 + 1);
value = GetUseCounter(uc) || GetChildDocumentUseCounter(uc);
if (value) {
if (sDebugUseCounters) {
const char* name = Telemetry::GetHistogramName(id);
if (name) {
printf(" %s", name);
} else {
printf(" #%d", id);
}
printf(": %d\n", value);
}
Telemetry::Accumulate(id, 1);
}
}
}
}
} }
void void

View file

@ -32,7 +32,6 @@
#include "mozilla/CycleCollectedJSContext.h" #include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/IntentionalCrash.h" #include "mozilla/IntentionalCrash.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "mozilla/dom/File.h" #include "mozilla/dom/File.h"
#include "mozilla/dom/MessagePort.h" #include "mozilla/dom/MessagePort.h"
#include "mozilla/dom/nsIContentParent.h" #include "mozilla/dom/nsIContentParent.h"
@ -716,9 +715,6 @@ AllowMessage(size_t aDataLength, const nsAString& aMessageName)
NS_ConvertUTF16toUTF8 messageName(aMessageName); NS_ConvertUTF16toUTF8 messageName(aMessageName);
messageName.StripChars("0123456789"); messageName.StripChars("0123456789");
Telemetry::Accumulate(Telemetry::MESSAGE_MANAGER_MESSAGE_SIZE2, messageName,
aDataLength);
// A message includes more than structured clone data, so subtract // A message includes more than structured clone data, so subtract
// 20KB to make it more likely that a message within this bound won't // 20KB to make it more likely that a message within this bound won't
// result in an overly large IPC message. // result in an overly large IPC message.
@ -727,9 +723,6 @@ AllowMessage(size_t aDataLength, const nsAString& aMessageName)
return true; return true;
} }
Telemetry::Accumulate(Telemetry::REJECTED_MESSAGE_MANAGER_MESSAGE,
messageName);
return false; return false;
} }
@ -2248,7 +2241,6 @@ nsSameProcessAsyncMessageBase::Init(const nsAString& aMessage,
nsIPrincipal* aPrincipal) nsIPrincipal* aPrincipal)
{ {
if (!mData.Copy(aData)) { if (!mData.Copy(aData)) {
Telemetry::Accumulate(Telemetry::IPC_SAME_PROCESS_MESSAGE_COPY_OOM_KB, aData.DataLength());
return NS_ERROR_OUT_OF_MEMORY; return NS_ERROR_OUT_OF_MEMORY;
} }

View file

@ -211,7 +211,6 @@
#include "mozilla/AddonPathService.h" #include "mozilla/AddonPathService.h"
#include "mozilla/BasePrincipal.h" #include "mozilla/BasePrincipal.h"
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include "mozilla/Telemetry.h"
#include "mozilla/dom/Location.h" #include "mozilla/dom/Location.h"
#include "nsHTMLDocument.h" #include "nsHTMLDocument.h"
#include "nsWrapperCacheInlines.h" #include "nsWrapperCacheInlines.h"
@ -1759,9 +1758,6 @@ nsGlobalWindow::~nsGlobalWindow()
DropOuterWindowDocs(); DropOuterWindowDocs();
} else { } else {
Telemetry::Accumulate(Telemetry::INNERWINDOWS_WITH_MUTATION_LISTENERS,
mMutationBits ? 1 : 0);
if (mListenerManager) { if (mListenerManager) {
mListenerManager->Disconnect(); mListenerManager->Disconnect();
mListenerManager = nullptr; mListenerManager = nullptr;
@ -2695,7 +2691,6 @@ TreatAsRemoteXUL(nsIPrincipal* aPrincipal)
static bool static bool
EnablePrivilege(JSContext* cx, unsigned argc, JS::Value* vp) EnablePrivilege(JSContext* cx, unsigned argc, JS::Value* vp)
{ {
Telemetry::Accumulate(Telemetry::ENABLE_PRIVILEGE_EVER_CALLED, true);
return xpc::EnableUniversalXPConnect(cx); return xpc::EnableUniversalXPConnect(cx);
} }
@ -3389,9 +3384,6 @@ nsGlobalWindow::InnerSetNewDocument(JSContext* aCx, nsIDocument* aDocument)
mLastOpenedURI = aDocument->GetDocumentURI(); mLastOpenedURI = aDocument->GetDocumentURI();
#endif #endif
Telemetry::Accumulate(Telemetry::INNERWINDOWS_WITH_MUTATION_LISTENERS,
mMutationBits ? 1 : 0);
// Clear our mutation bitfield. // Clear our mutation bitfield.
mMutationBits = 0; mMutationBits = 0;
} }
@ -6848,8 +6840,6 @@ FullscreenTransitionTask::Run()
Preferences::GetUint("full-screen-api.transition.timeout", 1000); Preferences::GetUint("full-screen-api.transition.timeout", 1000);
mTimer->Init(observer, timeout, nsITimer::TYPE_ONE_SHOT); mTimer->Init(observer, timeout, nsITimer::TYPE_ONE_SHOT);
} else if (stage == eAfterToggle) { } else if (stage == eAfterToggle) {
Telemetry::AccumulateTimeDelta(Telemetry::FULLSCREEN_TRANSITION_BLACK_MS,
mFullscreenChangeStartTime);
mWidget->PerformFullscreenTransition(nsIWidget::eAfterFullscreenToggle, mWidget->PerformFullscreenTransition(nsIWidget::eAfterFullscreenToggle,
mDuration.mFadeOut, mTransitionData, mDuration.mFadeOut, mTransitionData,
this); this);
@ -11577,11 +11567,6 @@ nsGlobalWindow::ShowSlowScriptDialog()
unsigned lineno; unsigned lineno;
bool hasFrame = JS::DescribeScriptedCaller(cx, &filename, &lineno); bool hasFrame = JS::DescribeScriptedCaller(cx, &filename, &lineno);
// Record the slow script event if we haven't done so already for this inner window
// (which represents a particular page to the user).
if (!mHasHadSlowScript) {
Telemetry::Accumulate(Telemetry::SLOW_SCRIPT_PAGE_COUNT, 1);
}
mHasHadSlowScript = true; mHasHadSlowScript = true;
if (XRE_IsContentProcess() && if (XRE_IsContentProcess() &&
@ -11613,10 +11598,6 @@ nsGlobalWindow::ShowSlowScriptDialog()
return ContinueSlowScriptAndKeepNotifying; return ContinueSlowScriptAndKeepNotifying;
} }
// Reached only on non-e10s - once per slow script dialog.
// On e10s - we probe once at ProcessHangsMonitor.jsm
Telemetry::Accumulate(Telemetry::SLOW_SCRIPT_NOTICE_COUNT, 1);
// Get the nsIPrompt interface from the docshell // Get the nsIPrompt interface from the docshell
nsCOMPtr<nsIDocShell> ds = GetDocShell(); nsCOMPtr<nsIDocShell> ds = GetDocShell();
NS_ENSURE_TRUE(ds, KillSlowScript); NS_ENSURE_TRUE(ds, KillSlowScript);

View file

@ -70,7 +70,6 @@
#include "prthread.h" #include "prthread.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/BindingUtils.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "mozilla/dom/asmjscache/AsmJSCache.h" #include "mozilla/dom/asmjscache/AsmJSCache.h"
@ -1477,22 +1476,8 @@ nsJSContext::EndCycleCollectionCallback(CycleCollectorResults &aResults)
NS_GC_DELAY - std::min(ccNowDuration, kMaxICCDuration)); NS_GC_DELAY - std::min(ccNowDuration, kMaxICCDuration));
} }
// Log information about the CC via telemetry, JSON and the console.
Telemetry::Accumulate(Telemetry::CYCLE_COLLECTOR_FINISH_IGC, gCCStats.mAnyLockedOut);
Telemetry::Accumulate(Telemetry::CYCLE_COLLECTOR_SYNC_SKIPPABLE, gCCStats.mRanSyncForgetSkippable);
Telemetry::Accumulate(Telemetry::CYCLE_COLLECTOR_FULL, ccNowDuration);
Telemetry::Accumulate(Telemetry::CYCLE_COLLECTOR_MAX_PAUSE, gCCStats.mMaxSliceTime);
if (!sLastCCEndTime.IsNull()) {
// TimeBetween returns milliseconds, but we want to report seconds.
uint32_t timeBetween = TimeBetween(sLastCCEndTime, gCCStats.mBeginTime) / 1000;
Telemetry::Accumulate(Telemetry::CYCLE_COLLECTOR_TIME_BETWEEN, timeBetween);
}
sLastCCEndTime = endCCTimeStamp; sLastCCEndTime = endCCTimeStamp;
Telemetry::Accumulate(Telemetry::FORGET_SKIPPABLE_MAX,
sMaxForgetSkippableTime / PR_USEC_PER_MSEC);
PRTime delta = GetCollectionTimeDelta(); PRTime delta = GetCollectionTimeDelta();
uint32_t cleanups = sForgetSkippableBeforeCC ? sForgetSkippableBeforeCC : 1; uint32_t cleanups = sForgetSkippableBeforeCC ? sForgetSkippableBeforeCC : 1;

View file

@ -392,9 +392,6 @@ nsNodeInfoManager::SetDocumentPrincipal(nsIPrincipal *aPrincipal)
NS_ASSERTION(aPrincipal, "Must have principal by this point!"); NS_ASSERTION(aPrincipal, "Must have principal by this point!");
MOZ_DIAGNOSTIC_ASSERT(!nsContentUtils::IsExpandedPrincipal(aPrincipal), MOZ_DIAGNOSTIC_ASSERT(!nsContentUtils::IsExpandedPrincipal(aPrincipal),
"Documents shouldn't have an expanded principal"); "Documents shouldn't have an expanded principal");
if (nsContentUtils::IsExpandedPrincipal(aPrincipal)) {
Telemetry::Accumulate(Telemetry::DOCUMENT_WITH_EXPANDED_PRINCIPAL, 1);
}
mPrincipal = aPrincipal; mPrincipal = aPrincipal;
} }

View file

@ -85,7 +85,6 @@
#include "mozilla/AsyncEventDispatcher.h" #include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/EventDispatcher.h" #include "mozilla/EventDispatcher.h"
#include "mozilla/EventStates.h" #include "mozilla/EventStates.h"
#include "mozilla/Telemetry.h"
#include "mozilla/dom/HTMLObjectElementBinding.h" #include "mozilla/dom/HTMLObjectElementBinding.h"
#include "mozilla/dom/HTMLSharedObjectElement.h" #include "mozilla/dom/HTMLSharedObjectElement.h"
#include "nsChannelClassifier.h" #include "nsChannelClassifier.h"
@ -1149,7 +1148,6 @@ nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest,
NS_LITERAL_STRING(" since it was found on an internal Firefox blocklist."); NS_LITERAL_STRING(" since it was found on an internal Firefox blocklist.");
console->LogStringMessage(message.get()); console->LogStringMessage(message.get());
} }
Telemetry::Accumulate(Telemetry::PLUGIN_BLOCKED_FOR_STABILITY, 1);
mContentBlockingEnabled = true; mContentBlockingEnabled = true;
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} else if (status == NS_ERROR_TRACKING_URI) { } else if (status == NS_ERROR_TRACKING_URI) {
@ -1565,7 +1563,6 @@ nsObjectLoadingContent::MaybeRewriteYoutubeEmbed(nsIURI* aURI, nsIURI* aBaseURI,
} }
if (uri.Find("enablejsapi=1", true, 0, -1) != kNotFound) { if (uri.Find("enablejsapi=1", true, 0, -1) != kNotFound) {
Telemetry::Accumulate(Telemetry::YOUTUBE_NONREWRITABLE_EMBED_SEEN, 1);
return; return;
} }
@ -1585,10 +1582,6 @@ nsObjectLoadingContent::MaybeRewriteYoutubeEmbed(nsIURI* aURI, nsIURI* aBaseURI,
} }
} }
// If we've made it this far, we've got a rewritable embed. Log it in
// telemetry.
Telemetry::Accumulate(Telemetry::YOUTUBE_REWRITABLE_EMBED_SEEN, 1);
// If we're pref'd off, return after telemetry has been logged. // If we're pref'd off, return after telemetry has been logged.
if (!Preferences::GetBool(kPrefYoutubeRewrite)) { if (!Preferences::GetBool(kPrefYoutubeRewrite)) {
return; return;
@ -3800,8 +3793,6 @@ nsObjectLoadingContent::LegacyCall(JSContext* aCx,
aRv.Throw(NS_ERROR_FAILURE); aRv.Throw(NS_ERROR_FAILURE);
return; return;
} }
Telemetry::Accumulate(Telemetry::PLUGIN_CALLED_DIRECTLY, true);
} }
void void

View file

@ -7,7 +7,6 @@
#include "ImageBitmapRenderingContext.h" #include "ImageBitmapRenderingContext.h"
#include "ImageEncoder.h" #include "ImageEncoder.h"
#include "mozilla/dom/CanvasRenderingContext2D.h" #include "mozilla/dom/CanvasRenderingContext2D.h"
#include "mozilla/Telemetry.h"
#include "mozilla/UniquePtr.h" #include "mozilla/UniquePtr.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsDOMJSUtils.h" #include "nsDOMJSUtils.h"
@ -138,13 +137,10 @@ CanvasRenderingContextHelper::CreateContextHelper(CanvasContextType aContextType
break; break;
case CanvasContextType::Canvas2D: case CanvasContextType::Canvas2D:
Telemetry::Accumulate(Telemetry::CANVAS_2D_USED, 1);
ret = new CanvasRenderingContext2D(aCompositorBackend); ret = new CanvasRenderingContext2D(aCompositorBackend);
break; break;
case CanvasContextType::WebGL1: case CanvasContextType::WebGL1:
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_USED, 1);
ret = WebGL1Context::Create(); ret = WebGL1Context::Create();
if (!ret) if (!ret)
return nullptr; return nullptr;
@ -152,8 +148,6 @@ CanvasRenderingContextHelper::CreateContextHelper(CanvasContextType aContextType
break; break;
case CanvasContextType::WebGL2: case CanvasContextType::WebGL2:
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_USED, 1);
ret = WebGL2Context::Create(); ret = WebGL2Context::Create();
if (!ret) if (!ret)
return nullptr; return nullptr;
@ -205,16 +199,8 @@ CanvasRenderingContextHelper::GetContext(JSContext* aCx,
// See bug 645792 and bug 1215072. // See bug 645792 and bug 1215072.
// We want to throw only if dictionary initialization fails, // We want to throw only if dictionary initialization fails,
// so only in case aRv has been set to some error value. // so only in case aRv has been set to some error value.
if (contextType == CanvasContextType::WebGL1)
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_SUCCESS, 0);
else if (contextType == CanvasContextType::WebGL2)
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL2_SUCCESS, 0);
return nullptr; return nullptr;
} }
if (contextType == CanvasContextType::WebGL1)
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_SUCCESS, 1);
else if (contextType == CanvasContextType::WebGL2)
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL2_SUCCESS, 1);
} else { } else {
// We already have a context of some type. // We already have a context of some type.
if (contextType != mCurrentContextType) if (contextType != mCurrentContextType)

View file

@ -6,7 +6,6 @@
#include "WebGL1Context.h" #include "WebGL1Context.h"
#include "mozilla/dom/WebGLRenderingContextBinding.h" #include "mozilla/dom/WebGLRenderingContextBinding.h"
#include "mozilla/Telemetry.h"
#include "WebGLFormats.h" #include "WebGLFormats.h"
namespace mozilla { namespace mozilla {
@ -43,8 +42,6 @@ WebGL1Context::WrapObject(JSContext* cx, JS::Handle<JSObject*> givenProto)
nsresult nsresult
NS_NewCanvasRenderingContextWebGL(nsIDOMWebGLRenderingContext** out_result) NS_NewCanvasRenderingContextWebGL(nsIDOMWebGLRenderingContext** out_result)
{ {
mozilla::Telemetry::Accumulate(mozilla::Telemetry::CANVAS_WEBGL_USED, 1);
nsIDOMWebGLRenderingContext* ctx = mozilla::WebGL1Context::Create(); nsIDOMWebGLRenderingContext* ctx = mozilla::WebGL1Context::Create();
NS_ADDREF(*out_result = ctx); NS_ADDREF(*out_result = ctx);

View file

@ -825,10 +825,6 @@ NS_IMETHODIMP
WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight) WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight)
{ {
if (signedWidth < 0 || signedHeight < 0) { if (signedWidth < 0 || signedHeight < 0) {
if (!gl) {
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_FAILURE_ID,
NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_SIZE"));
}
GenerateWarning("Canvas size is too large (seems like a negative value wrapped)"); GenerateWarning("Canvas size is too large (seems like a negative value wrapped)");
return NS_ERROR_OUT_OF_MEMORY; return NS_ERROR_OUT_OF_MEMORY;
} }
@ -884,12 +880,6 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight)
return NS_OK; return NS_OK;
} }
nsCString failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_UNKOWN");
auto autoTelemetry = mozilla::MakeScopeExit([&] {
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_FAILURE_ID,
failureId);
});
// End of early return cases. // End of early return cases.
// At this point we know that we're not just resizing an existing context, // At this point we know that we're not just resizing an existing context,
// we are initializing a new context. // we are initializing a new context.
@ -911,7 +901,6 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight)
// resource handles created from older context generations. // resource handles created from older context generations.
if (!(mGeneration + 1).isValid()) { if (!(mGeneration + 1).isValid()) {
// exit without changing the value of mGeneration // exit without changing the value of mGeneration
failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_TOO_MANY");
const nsLiteralCString text("Too many WebGL contexts created this run."); const nsLiteralCString text("Too many WebGL contexts created this run.");
ThrowEvent_WebGLContextCreationError(text); ThrowEvent_WebGLContextCreationError(text);
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
@ -928,11 +917,6 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight)
disabled |= gfxPlatform::InSafeMode(); disabled |= gfxPlatform::InSafeMode();
if (disabled) { if (disabled) {
if (gfxPlatform::InSafeMode()) {
failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_SAFEMODE");
} else {
failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_DISABLED");
}
const nsLiteralCString text("WebGL is currently disabled."); const nsLiteralCString text("WebGL is currently disabled.");
ThrowEvent_WebGLContextCreationError(text); ThrowEvent_WebGLContextCreationError(text);
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
@ -945,7 +929,6 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight)
if (mOptions.failIfMajorPerformanceCaveat) { if (mOptions.failIfMajorPerformanceCaveat) {
nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo(); nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo();
if (!HasAcceleratedLayers(gfxInfo)) { if (!HasAcceleratedLayers(gfxInfo)) {
failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_PERF_CAVEAT");
const nsLiteralCString text("failIfMajorPerformanceCaveat: Compositor is not" const nsLiteralCString text("failIfMajorPerformanceCaveat: Compositor is not"
" hardware-accelerated."); " hardware-accelerated.");
ThrowEvent_WebGLContextCreationError(text); ThrowEvent_WebGLContextCreationError(text);
@ -961,12 +944,9 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight)
if (!CreateAndInitGL(forceEnabled, &failReasons)) { if (!CreateAndInitGL(forceEnabled, &failReasons)) {
nsCString text("WebGL creation failed: "); nsCString text("WebGL creation failed: ");
for (const auto& cur : failReasons) { for (const auto& cur : failReasons) {
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_FAILURE_ID, cur.key);
text.AppendASCII("\n* "); text.AppendASCII("\n* ");
text.Append(cur.info); text.Append(cur.info);
} }
failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_REASON");
ThrowEvent_WebGLContextCreationError(text); ThrowEvent_WebGLContextCreationError(text);
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
@ -978,7 +958,6 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight)
DestroyResourcesAndContext(); DestroyResourcesAndContext();
MOZ_ASSERT(!gl); MOZ_ASSERT(!gl);
failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_PERF_WARP");
const nsLiteralCString text("failIfMajorPerformanceCaveat: Driver is not" const nsLiteralCString text("failIfMajorPerformanceCaveat: Driver is not"
" hardware-accelerated."); " hardware-accelerated.");
ThrowEvent_WebGLContextCreationError(text); ThrowEvent_WebGLContextCreationError(text);
@ -992,7 +971,6 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight)
DestroyResourcesAndContext(); DestroyResourcesAndContext();
MOZ_ASSERT(!gl); MOZ_ASSERT(!gl);
failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_DXGL_INTEROP2");
const nsLiteralCString text("Caveat: WGL without DXGLInterop2."); const nsLiteralCString text("Caveat: WGL without DXGLInterop2.");
ThrowEvent_WebGLContextCreationError(text); ThrowEvent_WebGLContextCreationError(text);
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
@ -1001,7 +979,6 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight)
} }
if (!ResizeBackbuffer(width, height)) { if (!ResizeBackbuffer(width, height)) {
failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_BACKBUFFER");
const nsLiteralCString text("Initializing WebGL backbuffer failed."); const nsLiteralCString text("Initializing WebGL backbuffer failed.");
ThrowEvent_WebGLContextCreationError(text); ThrowEvent_WebGLContextCreationError(text);
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
@ -1085,7 +1062,6 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight)
////// //////
failureId = NS_LITERAL_CSTRING("SUCCESS");
return NS_OK; return NS_OK;
} }

View file

@ -452,7 +452,6 @@ void
WebCryptoTask::FailWithError(nsresult aRv) WebCryptoTask::FailWithError(nsresult aRv)
{ {
MOZ_ASSERT(IsOnOriginalThread()); MOZ_ASSERT(IsOnOriginalThread());
Telemetry::Accumulate(Telemetry::WEBCRYPTO_RESOLVED, false);
// Blindly convert nsresult to DOMException // Blindly convert nsresult to DOMException
// Individual tasks must ensure they pass the right values // Individual tasks must ensure they pass the right values
@ -491,7 +490,6 @@ WebCryptoTask::CallCallback(nsresult rv)
} }
Resolve(); Resolve();
Telemetry::Accumulate(Telemetry::WEBCRYPTO_RESOLVED, true);
// Manually release mResultPromise while we're on the main thread // Manually release mResultPromise while we're on the main thread
mResultPromise = nullptr; mResultPromise = nullptr;
@ -650,7 +648,6 @@ public:
mEarlyRv = NS_ERROR_DOM_NOT_SUPPORTED_ERR; mEarlyRv = NS_ERROR_DOM_NOT_SUPPORTED_ERR;
return; return;
} }
Telemetry::Accumulate(Telemetry::WEBCRYPTO_ALG, telemetryAlg);
} }
private: private:
@ -794,7 +791,6 @@ public:
return; return;
} }
Telemetry::Accumulate(Telemetry::WEBCRYPTO_ALG, TA_AES_KW);
} }
private: private:
@ -908,8 +904,6 @@ public:
void Init(JSContext* aCx, const ObjectOrString& aAlgorithm, void Init(JSContext* aCx, const ObjectOrString& aAlgorithm,
CryptoKey& aKey, bool aEncrypt) CryptoKey& aKey, bool aEncrypt)
{ {
Telemetry::Accumulate(Telemetry::WEBCRYPTO_ALG, TA_RSA_OAEP);
CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_RSA_OAEP); CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_RSA_OAEP);
if (mEncrypt) { if (mEncrypt) {
@ -1049,7 +1043,6 @@ public:
case CKM_SHA512_HMAC: telemetryAlg = TA_HMAC_SHA_512; break; case CKM_SHA512_HMAC: telemetryAlg = TA_HMAC_SHA_512; break;
default: telemetryAlg = TA_UNKNOWN; default: telemetryAlg = TA_UNKNOWN;
} }
Telemetry::Accumulate(Telemetry::WEBCRYPTO_ALG, telemetryAlg);
} }
private: private:
@ -1158,12 +1151,10 @@ public:
if (algName.EqualsLiteral(WEBCRYPTO_ALG_RSASSA_PKCS1)) { if (algName.EqualsLiteral(WEBCRYPTO_ALG_RSASSA_PKCS1)) {
mAlgorithm = Algorithm::RSA_PKCS1; mAlgorithm = Algorithm::RSA_PKCS1;
Telemetry::Accumulate(Telemetry::WEBCRYPTO_ALG, TA_RSASSA_PKCS1);
CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_RSASSA_PKCS1); CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_RSASSA_PKCS1);
hashAlgName = aKey.Algorithm().mRsa.mHash.mName; hashAlgName = aKey.Algorithm().mRsa.mHash.mName;
} else if (algName.EqualsLiteral(WEBCRYPTO_ALG_RSA_PSS)) { } else if (algName.EqualsLiteral(WEBCRYPTO_ALG_RSA_PSS)) {
mAlgorithm = Algorithm::RSA_PSS; mAlgorithm = Algorithm::RSA_PSS;
Telemetry::Accumulate(Telemetry::WEBCRYPTO_ALG, TA_RSA_PSS);
CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_RSA_PSS); CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_RSA_PSS);
KeyAlgorithm& hashAlg = aKey.Algorithm().mRsa.mHash; KeyAlgorithm& hashAlg = aKey.Algorithm().mRsa.mHash;
@ -1188,7 +1179,6 @@ public:
mSaltLength = params.mSaltLength; mSaltLength = params.mSaltLength;
} else if (algName.EqualsLiteral(WEBCRYPTO_ALG_ECDSA)) { } else if (algName.EqualsLiteral(WEBCRYPTO_ALG_ECDSA)) {
mAlgorithm = Algorithm::ECDSA; mAlgorithm = Algorithm::ECDSA;
Telemetry::Accumulate(Telemetry::WEBCRYPTO_ALG, TA_ECDSA);
CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_ECDSA); CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_ECDSA);
// For ECDSA, the hash name comes from the algorithm parameter // For ECDSA, the hash name comes from the algorithm parameter
@ -1356,7 +1346,6 @@ public:
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR; mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
return; return;
} }
Telemetry::Accumulate(Telemetry::WEBCRYPTO_ALG, telemetryAlg);
mOidTag = MapHashAlgorithmNameToOID(algName); mOidTag = MapHashAlgorithmNameToOID(algName);
} }
@ -2656,7 +2645,6 @@ public:
void Init(JSContext* aCx, const ObjectOrString& aAlgorithm, CryptoKey& aKey, void Init(JSContext* aCx, const ObjectOrString& aAlgorithm, CryptoKey& aKey,
uint32_t aLength) uint32_t aLength)
{ {
Telemetry::Accumulate(Telemetry::WEBCRYPTO_ALG, TA_HKDF);
CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_HKDF); CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_HKDF);
// Check that we have a key. // Check that we have a key.
@ -2806,7 +2794,6 @@ public:
void Init(JSContext* aCx, const ObjectOrString& aAlgorithm, CryptoKey& aKey, void Init(JSContext* aCx, const ObjectOrString& aAlgorithm, CryptoKey& aKey,
uint32_t aLength) uint32_t aLength)
{ {
Telemetry::Accumulate(Telemetry::WEBCRYPTO_ALG, TA_PBKDF2);
CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_PBKDF2); CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_PBKDF2);
// Check that we got a symmetric key // Check that we got a symmetric key
@ -2981,7 +2968,6 @@ public:
void Init(JSContext* aCx, const ObjectOrString& aAlgorithm, CryptoKey& aKey) void Init(JSContext* aCx, const ObjectOrString& aAlgorithm, CryptoKey& aKey)
{ {
Telemetry::Accumulate(Telemetry::WEBCRYPTO_ALG, TA_ECDH);
CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_ECDH); CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_ECDH);
// Check that we have a private key. // Check that we have a private key.
@ -3277,10 +3263,6 @@ WebCryptoTask::CreateEncryptDecryptTask(JSContext* aCx,
const CryptoOperationData& aData, const CryptoOperationData& aData,
bool aEncrypt) bool aEncrypt)
{ {
TelemetryMethod method = (aEncrypt)? TM_ENCRYPT : TM_DECRYPT;
Telemetry::Accumulate(Telemetry::WEBCRYPTO_METHOD, method);
Telemetry::Accumulate(Telemetry::WEBCRYPTO_EXTRACTABLE_ENC, aKey.Extractable());
// Ensure key is usable for this operation // Ensure key is usable for this operation
if ((aEncrypt && !aKey.HasUsage(CryptoKey::ENCRYPT)) || if ((aEncrypt && !aKey.HasUsage(CryptoKey::ENCRYPT)) ||
(!aEncrypt && !aKey.HasUsage(CryptoKey::DECRYPT))) { (!aEncrypt && !aKey.HasUsage(CryptoKey::DECRYPT))) {
@ -3312,10 +3294,6 @@ WebCryptoTask::CreateSignVerifyTask(JSContext* aCx,
const CryptoOperationData& aData, const CryptoOperationData& aData,
bool aSign) bool aSign)
{ {
TelemetryMethod method = (aSign)? TM_SIGN : TM_VERIFY;
Telemetry::Accumulate(Telemetry::WEBCRYPTO_METHOD, method);
Telemetry::Accumulate(Telemetry::WEBCRYPTO_EXTRACTABLE_SIG, aKey.Extractable());
// Ensure key is usable for this operation // Ensure key is usable for this operation
if ((aSign && !aKey.HasUsage(CryptoKey::SIGN)) || if ((aSign && !aKey.HasUsage(CryptoKey::SIGN)) ||
(!aSign && !aKey.HasUsage(CryptoKey::VERIFY))) { (!aSign && !aKey.HasUsage(CryptoKey::VERIFY))) {
@ -3345,8 +3323,6 @@ WebCryptoTask::CreateDigestTask(JSContext* aCx,
const ObjectOrString& aAlgorithm, const ObjectOrString& aAlgorithm,
const CryptoOperationData& aData) const CryptoOperationData& aData)
{ {
Telemetry::Accumulate(Telemetry::WEBCRYPTO_METHOD, TM_DIGEST);
nsString algName; nsString algName;
nsresult rv = GetAlgorithmName(aCx, aAlgorithm, algName); nsresult rv = GetAlgorithmName(aCx, aAlgorithm, algName);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
@ -3372,9 +3348,6 @@ WebCryptoTask::CreateImportKeyTask(nsIGlobalObject* aGlobal,
bool aExtractable, bool aExtractable,
const Sequence<nsString>& aKeyUsages) const Sequence<nsString>& aKeyUsages)
{ {
Telemetry::Accumulate(Telemetry::WEBCRYPTO_METHOD, TM_IMPORTKEY);
Telemetry::Accumulate(Telemetry::WEBCRYPTO_EXTRACTABLE_IMPORT, aExtractable);
// Verify that the format is recognized // Verify that the format is recognized
if (!aFormat.EqualsLiteral(WEBCRYPTO_KEY_FORMAT_RAW) && if (!aFormat.EqualsLiteral(WEBCRYPTO_KEY_FORMAT_RAW) &&
!aFormat.EqualsLiteral(WEBCRYPTO_KEY_FORMAT_SPKI) && !aFormat.EqualsLiteral(WEBCRYPTO_KEY_FORMAT_SPKI) &&
@ -3426,8 +3399,6 @@ WebCryptoTask*
WebCryptoTask::CreateExportKeyTask(const nsAString& aFormat, WebCryptoTask::CreateExportKeyTask(const nsAString& aFormat,
CryptoKey& aKey) CryptoKey& aKey)
{ {
Telemetry::Accumulate(Telemetry::WEBCRYPTO_METHOD, TM_EXPORTKEY);
// Verify that the format is recognized // Verify that the format is recognized
if (!aFormat.EqualsLiteral(WEBCRYPTO_KEY_FORMAT_RAW) && if (!aFormat.EqualsLiteral(WEBCRYPTO_KEY_FORMAT_RAW) &&
!aFormat.EqualsLiteral(WEBCRYPTO_KEY_FORMAT_SPKI) && !aFormat.EqualsLiteral(WEBCRYPTO_KEY_FORMAT_SPKI) &&
@ -3470,9 +3441,6 @@ WebCryptoTask::CreateGenerateKeyTask(nsIGlobalObject* aGlobal,
bool aExtractable, bool aExtractable,
const Sequence<nsString>& aKeyUsages) const Sequence<nsString>& aKeyUsages)
{ {
Telemetry::Accumulate(Telemetry::WEBCRYPTO_METHOD, TM_GENERATEKEY);
Telemetry::Accumulate(Telemetry::WEBCRYPTO_EXTRACTABLE_GENERATE, aExtractable);
// Verify that aKeyUsages does not contain an unrecognized value // Verify that aKeyUsages does not contain an unrecognized value
// SPEC-BUG: Spec says that this should be InvalidAccessError, but that // SPEC-BUG: Spec says that this should be InvalidAccessError, but that
// is inconsistent with other analogous points in the spec // is inconsistent with other analogous points in the spec
@ -3515,8 +3483,6 @@ WebCryptoTask::CreateDeriveKeyTask(nsIGlobalObject* aGlobal,
bool aExtractable, bool aExtractable,
const Sequence<nsString>& aKeyUsages) const Sequence<nsString>& aKeyUsages)
{ {
Telemetry::Accumulate(Telemetry::WEBCRYPTO_METHOD, TM_DERIVEKEY);
// Ensure baseKey is usable for this operation // Ensure baseKey is usable for this operation
if (!aBaseKey.HasUsage(CryptoKey::DERIVEKEY)) { if (!aBaseKey.HasUsage(CryptoKey::DERIVEKEY)) {
return new FailureTask(NS_ERROR_DOM_INVALID_ACCESS_ERR); return new FailureTask(NS_ERROR_DOM_INVALID_ACCESS_ERR);
@ -3560,8 +3526,6 @@ WebCryptoTask::CreateDeriveBitsTask(JSContext* aCx,
CryptoKey& aKey, CryptoKey& aKey,
uint32_t aLength) uint32_t aLength)
{ {
Telemetry::Accumulate(Telemetry::WEBCRYPTO_METHOD, TM_DERIVEBITS);
// Ensure baseKey is usable for this operation // Ensure baseKey is usable for this operation
if (!aKey.HasUsage(CryptoKey::DERIVEBITS)) { if (!aKey.HasUsage(CryptoKey::DERIVEBITS)) {
return new FailureTask(NS_ERROR_DOM_INVALID_ACCESS_ERR); return new FailureTask(NS_ERROR_DOM_INVALID_ACCESS_ERR);
@ -3599,8 +3563,6 @@ WebCryptoTask::CreateWrapKeyTask(JSContext* aCx,
CryptoKey& aWrappingKey, CryptoKey& aWrappingKey,
const ObjectOrString& aWrapAlgorithm) const ObjectOrString& aWrapAlgorithm)
{ {
Telemetry::Accumulate(Telemetry::WEBCRYPTO_METHOD, TM_WRAPKEY);
// Verify that the format is recognized // Verify that the format is recognized
if (!aFormat.EqualsLiteral(WEBCRYPTO_KEY_FORMAT_RAW) && if (!aFormat.EqualsLiteral(WEBCRYPTO_KEY_FORMAT_RAW) &&
!aFormat.EqualsLiteral(WEBCRYPTO_KEY_FORMAT_SPKI) && !aFormat.EqualsLiteral(WEBCRYPTO_KEY_FORMAT_SPKI) &&
@ -3652,8 +3614,6 @@ WebCryptoTask::CreateUnwrapKeyTask(nsIGlobalObject* aGlobal,
bool aExtractable, bool aExtractable,
const Sequence<nsString>& aKeyUsages) const Sequence<nsString>& aKeyUsages)
{ {
Telemetry::Accumulate(Telemetry::WEBCRYPTO_METHOD, TM_UNWRAPKEY);
// Ensure key is usable for this operation // Ensure key is usable for this operation
if (!aUnwrappingKey.HasUsage(CryptoKey::UNWRAPKEY)) { if (!aUnwrappingKey.HasUsage(CryptoKey::UNWRAPKEY)) {
return new FailureTask(NS_ERROR_DOM_INVALID_ACCESS_ERR); return new FailureTask(NS_ERROR_DOM_INVALID_ACCESS_ERR);

View file

@ -858,63 +858,46 @@ EventDispatcher::CreateEvent(EventTarget* aOwner,
// And if we didn't get an event, check the type argument. // And if we didn't get an event, check the type argument.
#define LOG_EVENT_CREATION(name) mozilla::Telemetry::Accumulate( \
mozilla::Telemetry::CREATE_EVENT_##name, true);
if (aEventType.LowerCaseEqualsLiteral("mouseevent")) { if (aEventType.LowerCaseEqualsLiteral("mouseevent")) {
LOG_EVENT_CREATION(MOUSEEVENT);
return NS_NewDOMMouseEvent(aOwner, aPresContext, nullptr); return NS_NewDOMMouseEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("mouseevents")) { if (aEventType.LowerCaseEqualsLiteral("mouseevents")) {
LOG_EVENT_CREATION(MOUSEEVENTS);
return NS_NewDOMMouseEvent(aOwner, aPresContext, nullptr); return NS_NewDOMMouseEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("popupevents")) { if (aEventType.LowerCaseEqualsLiteral("popupevents")) {
LOG_EVENT_CREATION(POPUPEVENTS);
return NS_NewDOMMouseEvent(aOwner, aPresContext, nullptr); return NS_NewDOMMouseEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("mousescrollevents")) { if (aEventType.LowerCaseEqualsLiteral("mousescrollevents")) {
LOG_EVENT_CREATION(MOUSESCROLLEVENTS);
return NS_NewDOMMouseScrollEvent(aOwner, aPresContext, nullptr); return NS_NewDOMMouseScrollEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("dragevent")) { if (aEventType.LowerCaseEqualsLiteral("dragevent")) {
LOG_EVENT_CREATION(DRAGEVENT);
return NS_NewDOMDragEvent(aOwner, aPresContext, nullptr); return NS_NewDOMDragEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("dragevents")) { if (aEventType.LowerCaseEqualsLiteral("dragevents")) {
LOG_EVENT_CREATION(DRAGEVENTS);
return NS_NewDOMDragEvent(aOwner, aPresContext, nullptr); return NS_NewDOMDragEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("keyboardevent")) { if (aEventType.LowerCaseEqualsLiteral("keyboardevent")) {
LOG_EVENT_CREATION(KEYBOARDEVENT);
return NS_NewDOMKeyboardEvent(aOwner, aPresContext, nullptr); return NS_NewDOMKeyboardEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("keyevents")) { if (aEventType.LowerCaseEqualsLiteral("keyevents")) {
LOG_EVENT_CREATION(KEYEVENTS);
return NS_NewDOMKeyboardEvent(aOwner, aPresContext, nullptr); return NS_NewDOMKeyboardEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("compositionevent")) { if (aEventType.LowerCaseEqualsLiteral("compositionevent")) {
LOG_EVENT_CREATION(COMPOSITIONEVENT);
return NS_NewDOMCompositionEvent(aOwner, aPresContext, nullptr); return NS_NewDOMCompositionEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("textevent")) { if (aEventType.LowerCaseEqualsLiteral("textevent")) {
LOG_EVENT_CREATION(TEXTEVENT);
return NS_NewDOMCompositionEvent(aOwner, aPresContext, nullptr); return NS_NewDOMCompositionEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("textevents")) { if (aEventType.LowerCaseEqualsLiteral("textevents")) {
LOG_EVENT_CREATION(TEXTEVENTS);
return NS_NewDOMCompositionEvent(aOwner, aPresContext, nullptr); return NS_NewDOMCompositionEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("mutationevent")) { if (aEventType.LowerCaseEqualsLiteral("mutationevent")) {
LOG_EVENT_CREATION(MUTATIONEVENT);
return NS_NewDOMMutationEvent(aOwner, aPresContext, nullptr); return NS_NewDOMMutationEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("mutationevents")) { if (aEventType.LowerCaseEqualsLiteral("mutationevents")) {
LOG_EVENT_CREATION(MUTATIONEVENTS);
return NS_NewDOMMutationEvent(aOwner, aPresContext, nullptr); return NS_NewDOMMutationEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("deviceorientationevent")) { if (aEventType.LowerCaseEqualsLiteral("deviceorientationevent")) {
LOG_EVENT_CREATION(DEVICEORIENTATIONEVENT);
DeviceOrientationEventInit init; DeviceOrientationEventInit init;
RefPtr<Event> event = RefPtr<Event> event =
DeviceOrientationEvent::Constructor(aOwner, EmptyString(), init); DeviceOrientationEvent::Constructor(aOwner, EmptyString(), init);
@ -922,97 +905,74 @@ EventDispatcher::CreateEvent(EventTarget* aOwner,
return event.forget(); return event.forget();
} }
if (aEventType.LowerCaseEqualsLiteral("devicemotionevent")) { if (aEventType.LowerCaseEqualsLiteral("devicemotionevent")) {
LOG_EVENT_CREATION(DEVICEMOTIONEVENT);
return NS_NewDOMDeviceMotionEvent(aOwner, aPresContext, nullptr); return NS_NewDOMDeviceMotionEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("uievent")) { if (aEventType.LowerCaseEqualsLiteral("uievent")) {
LOG_EVENT_CREATION(UIEVENT);
return NS_NewDOMUIEvent(aOwner, aPresContext, nullptr); return NS_NewDOMUIEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("uievents")) { if (aEventType.LowerCaseEqualsLiteral("uievents")) {
LOG_EVENT_CREATION(UIEVENTS);
return NS_NewDOMUIEvent(aOwner, aPresContext, nullptr); return NS_NewDOMUIEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("event")) { if (aEventType.LowerCaseEqualsLiteral("event")) {
LOG_EVENT_CREATION(EVENT);
return NS_NewDOMEvent(aOwner, aPresContext, nullptr); return NS_NewDOMEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("events")) { if (aEventType.LowerCaseEqualsLiteral("events")) {
LOG_EVENT_CREATION(EVENTS);
return NS_NewDOMEvent(aOwner, aPresContext, nullptr); return NS_NewDOMEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("htmlevents")) { if (aEventType.LowerCaseEqualsLiteral("htmlevents")) {
LOG_EVENT_CREATION(HTMLEVENTS);
return NS_NewDOMEvent(aOwner, aPresContext, nullptr); return NS_NewDOMEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("svgevent")) { if (aEventType.LowerCaseEqualsLiteral("svgevent")) {
LOG_EVENT_CREATION(SVGEVENT);
return NS_NewDOMEvent(aOwner, aPresContext, nullptr); return NS_NewDOMEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("svgevents")) { if (aEventType.LowerCaseEqualsLiteral("svgevents")) {
LOG_EVENT_CREATION(SVGEVENTS);
return NS_NewDOMEvent(aOwner, aPresContext, nullptr); return NS_NewDOMEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("svgzoomevent")) { if (aEventType.LowerCaseEqualsLiteral("svgzoomevent")) {
LOG_EVENT_CREATION(SVGZOOMEVENT);
return NS_NewDOMSVGZoomEvent(aOwner, aPresContext, nullptr); return NS_NewDOMSVGZoomEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("svgzoomevents")) { if (aEventType.LowerCaseEqualsLiteral("svgzoomevents")) {
LOG_EVENT_CREATION(SVGZOOMEVENTS);
return NS_NewDOMSVGZoomEvent(aOwner, aPresContext, nullptr); return NS_NewDOMSVGZoomEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("timeevent")) { if (aEventType.LowerCaseEqualsLiteral("timeevent")) {
LOG_EVENT_CREATION(TIMEEVENT);
return NS_NewDOMTimeEvent(aOwner, aPresContext, nullptr); return NS_NewDOMTimeEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("timeevents")) { if (aEventType.LowerCaseEqualsLiteral("timeevents")) {
LOG_EVENT_CREATION(TIMEEVENTS);
return NS_NewDOMTimeEvent(aOwner, aPresContext, nullptr); return NS_NewDOMTimeEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("xulcommandevent")) { if (aEventType.LowerCaseEqualsLiteral("xulcommandevent")) {
LOG_EVENT_CREATION(XULCOMMANDEVENT);
return NS_NewDOMXULCommandEvent(aOwner, aPresContext, nullptr); return NS_NewDOMXULCommandEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("xulcommandevents")) { if (aEventType.LowerCaseEqualsLiteral("xulcommandevents")) {
LOG_EVENT_CREATION(XULCOMMANDEVENTS);
return NS_NewDOMXULCommandEvent(aOwner, aPresContext, nullptr); return NS_NewDOMXULCommandEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("commandevent")) { if (aEventType.LowerCaseEqualsLiteral("commandevent")) {
LOG_EVENT_CREATION(COMMANDEVENT);
return NS_NewDOMCommandEvent(aOwner, aPresContext, nullptr); return NS_NewDOMCommandEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("commandevents")) { if (aEventType.LowerCaseEqualsLiteral("commandevents")) {
LOG_EVENT_CREATION(COMMANDEVENTS);
return NS_NewDOMCommandEvent(aOwner, aPresContext, nullptr); return NS_NewDOMCommandEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("datacontainerevent")) { if (aEventType.LowerCaseEqualsLiteral("datacontainerevent")) {
LOG_EVENT_CREATION(DATACONTAINEREVENT);
return NS_NewDOMDataContainerEvent(aOwner, aPresContext, nullptr); return NS_NewDOMDataContainerEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("datacontainerevents")) { if (aEventType.LowerCaseEqualsLiteral("datacontainerevents")) {
LOG_EVENT_CREATION(DATACONTAINEREVENTS);
return NS_NewDOMDataContainerEvent(aOwner, aPresContext, nullptr); return NS_NewDOMDataContainerEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("messageevent")) { if (aEventType.LowerCaseEqualsLiteral("messageevent")) {
LOG_EVENT_CREATION(MESSAGEEVENT);
RefPtr<Event> event = new MessageEvent(aOwner, aPresContext, nullptr); RefPtr<Event> event = new MessageEvent(aOwner, aPresContext, nullptr);
return event.forget(); return event.forget();
} }
if (aEventType.LowerCaseEqualsLiteral("notifypaintevent")) { if (aEventType.LowerCaseEqualsLiteral("notifypaintevent")) {
LOG_EVENT_CREATION(NOTIFYPAINTEVENT);
return NS_NewDOMNotifyPaintEvent(aOwner, aPresContext, nullptr); return NS_NewDOMNotifyPaintEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("simplegestureevent")) { if (aEventType.LowerCaseEqualsLiteral("simplegestureevent")) {
LOG_EVENT_CREATION(SIMPLEGESTUREEVENT);
return NS_NewDOMSimpleGestureEvent(aOwner, aPresContext, nullptr); return NS_NewDOMSimpleGestureEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("beforeunloadevent")) { if (aEventType.LowerCaseEqualsLiteral("beforeunloadevent")) {
LOG_EVENT_CREATION(BEFOREUNLOADEVENT);
return NS_NewDOMBeforeUnloadEvent(aOwner, aPresContext, nullptr); return NS_NewDOMBeforeUnloadEvent(aOwner, aPresContext, nullptr);
} }
// XXXkhuey this is broken // XXXkhuey this is broken
if (aEventType.LowerCaseEqualsLiteral("pagetransition")) { if (aEventType.LowerCaseEqualsLiteral("pagetransition")) {
LOG_EVENT_CREATION(PAGETRANSITION);
PageTransitionEventInit init; PageTransitionEventInit init;
RefPtr<Event> event = RefPtr<Event> event =
PageTransitionEvent::Constructor(aOwner, EmptyString(), init); PageTransitionEvent::Constructor(aOwner, EmptyString(), init);
@ -1020,14 +980,12 @@ EventDispatcher::CreateEvent(EventTarget* aOwner,
return event.forget(); return event.forget();
} }
if (aEventType.LowerCaseEqualsLiteral("scrollareaevent")) { if (aEventType.LowerCaseEqualsLiteral("scrollareaevent")) {
LOG_EVENT_CREATION(SCROLLAREAEVENT);
return NS_NewDOMScrollAreaEvent(aOwner, aPresContext, nullptr); return NS_NewDOMScrollAreaEvent(aOwner, aPresContext, nullptr);
} }
// XXXkhuey Chrome supports popstateevent here, even though it provides no // XXXkhuey Chrome supports popstateevent here, even though it provides no
// initPopStateEvent method. This is nuts ... but copying it is unlikely to // initPopStateEvent method. This is nuts ... but copying it is unlikely to
// break the web. // break the web.
if (aEventType.LowerCaseEqualsLiteral("popstateevent")) { if (aEventType.LowerCaseEqualsLiteral("popstateevent")) {
LOG_EVENT_CREATION(POPSTATEEVENT);
AutoJSContext cx; AutoJSContext cx;
RootedDictionary<PopStateEventInit> init(cx); RootedDictionary<PopStateEventInit> init(cx);
RefPtr<Event> event = RefPtr<Event> event =
@ -1037,11 +995,9 @@ EventDispatcher::CreateEvent(EventTarget* aOwner,
} }
if (aEventType.LowerCaseEqualsLiteral("touchevent") && if (aEventType.LowerCaseEqualsLiteral("touchevent") &&
TouchEvent::PrefEnabled(nsContentUtils::GetDocShellForEventTarget(aOwner))) { TouchEvent::PrefEnabled(nsContentUtils::GetDocShellForEventTarget(aOwner))) {
LOG_EVENT_CREATION(TOUCHEVENT);
return NS_NewDOMTouchEvent(aOwner, aPresContext, nullptr); return NS_NewDOMTouchEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("hashchangeevent")) { if (aEventType.LowerCaseEqualsLiteral("hashchangeevent")) {
LOG_EVENT_CREATION(HASHCHANGEEVENT);
HashChangeEventInit init; HashChangeEventInit init;
RefPtr<Event> event = RefPtr<Event> event =
HashChangeEvent::Constructor(aOwner, EmptyString(), init); HashChangeEvent::Constructor(aOwner, EmptyString(), init);
@ -1049,11 +1005,9 @@ EventDispatcher::CreateEvent(EventTarget* aOwner,
return event.forget(); return event.forget();
} }
if (aEventType.LowerCaseEqualsLiteral("customevent")) { if (aEventType.LowerCaseEqualsLiteral("customevent")) {
LOG_EVENT_CREATION(CUSTOMEVENT);
return NS_NewDOMCustomEvent(aOwner, aPresContext, nullptr); return NS_NewDOMCustomEvent(aOwner, aPresContext, nullptr);
} }
if (aEventType.LowerCaseEqualsLiteral("storageevent")) { if (aEventType.LowerCaseEqualsLiteral("storageevent")) {
LOG_EVENT_CREATION(STORAGEEVENT);
return NS_NewDOMStorageEvent(aOwner); return NS_NewDOMStorageEvent(aOwner);
} }
if (aEventType.LowerCaseEqualsLiteral("focusevent")) { if (aEventType.LowerCaseEqualsLiteral("focusevent")) {
@ -1062,8 +1016,6 @@ EventDispatcher::CreateEvent(EventTarget* aOwner,
return event.forget(); return event.forget();
} }
#undef LOG_EVENT_CREATION
// NEW EVENT TYPES SHOULD NOT BE ADDED HERE; THEY SHOULD USE ONLY EVENT // NEW EVENT TYPES SHOULD NOT BE ADDED HERE; THEY SHOULD USE ONLY EVENT
// CONSTRUCTORS // CONSTRUCTORS

View file

@ -38,7 +38,6 @@
#include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/ScriptSettings.h"
#include "mozilla/dom/URLSearchParams.h" #include "mozilla/dom/URLSearchParams.h"
#include "mozilla/dom/workers/ServiceWorkerManager.h" #include "mozilla/dom/workers/ServiceWorkerManager.h"
#include "mozilla/Telemetry.h"
#include "InternalRequest.h" #include "InternalRequest.h"
#include "InternalResponse.h" #include "InternalResponse.h"
@ -237,8 +236,6 @@ FetchRequest(nsIGlobalObject* aGlobal, const RequestOrUSVString& aInput,
} }
} }
Telemetry::Accumulate(Telemetry::FETCH_IS_MAINTHREAD, 1);
RefPtr<MainThreadFetchResolver> resolver = new MainThreadFetchResolver(p); RefPtr<MainThreadFetchResolver> resolver = new MainThreadFetchResolver(p);
RefPtr<FetchDriver> fetch = new FetchDriver(r, principal, loadGroup); RefPtr<FetchDriver> fetch = new FetchDriver(r, principal, loadGroup);
fetch->SetDocument(doc); fetch->SetDocument(doc);
@ -251,8 +248,6 @@ FetchRequest(nsIGlobalObject* aGlobal, const RequestOrUSVString& aInput,
WorkerPrivate* worker = GetCurrentThreadWorkerPrivate(); WorkerPrivate* worker = GetCurrentThreadWorkerPrivate();
MOZ_ASSERT(worker); MOZ_ASSERT(worker);
Telemetry::Accumulate(Telemetry::FETCH_IS_MAINTHREAD, 0);
if (worker->IsServiceWorker()) { if (worker->IsServiceWorker()) {
r->SetSkipServiceWorker(); r->SetSkipServiceWorker();
} }

View file

@ -77,9 +77,6 @@ FetchDriver::Fetch(FetchDriverObserver* aObserver)
mObserver = aObserver; mObserver = aObserver;
Telemetry::Accumulate(Telemetry::SERVICE_WORKER_REQUEST_PASSTHROUGH,
mRequest->WasCreatedByFetchEvent());
// FIXME(nsm): Deal with HSTS. // FIXME(nsm): Deal with HSTS.
MOZ_RELEASE_ASSERT(!mRequest->IsSynchronous(), MOZ_RELEASE_ASSERT(!mRequest->IsSynchronous(),

View file

@ -382,13 +382,6 @@ nsGeolocationRequest::GetElement(nsIDOMElement * *aRequestingElement)
NS_IMETHODIMP NS_IMETHODIMP
nsGeolocationRequest::Cancel() nsGeolocationRequest::Cancel()
{ {
if (mRequester) {
// Record the number of denied requests for regular web content.
// This method is only called when the user explicitly denies the request,
// and is not called when the page is simply unloaded, or similar.
Telemetry::Accumulate(Telemetry::GEOLOCATION_REQUEST_GRANTED, mProtocolType);
}
if (mLocator->ClearPendingRequest(this)) { if (mLocator->ClearPendingRequest(this)) {
return NS_OK; return NS_OK;
} }
@ -403,9 +396,6 @@ nsGeolocationRequest::Allow(JS::HandleValue aChoices)
MOZ_ASSERT(aChoices.isUndefined()); MOZ_ASSERT(aChoices.isUndefined());
if (mRequester) { if (mRequester) {
// Record the number of granted requests for regular web content.
Telemetry::Accumulate(Telemetry::GEOLOCATION_REQUEST_GRANTED, mProtocolType + 10);
// Record whether a location callback is fulfilled while the owner window // Record whether a location callback is fulfilled while the owner window
// is not visible. // is not visible.
bool isVisible = false; bool isVisible = false;
@ -415,12 +405,6 @@ nsGeolocationRequest::Allow(JS::HandleValue aChoices)
nsCOMPtr<nsIDocument> doc = window->GetDoc(); nsCOMPtr<nsIDocument> doc = window->GetDoc();
isVisible = doc && !doc->Hidden(); isVisible = doc && !doc->Hidden();
} }
if (IsWatch()) {
mozilla::Telemetry::Accumulate(mozilla::Telemetry::GEOLOCATION_WATCHPOSITION_VISIBLE, isVisible);
} else {
mozilla::Telemetry::Accumulate(mozilla::Telemetry::GEOLOCATION_GETCURRENTPOSITION_VISIBLE, isVisible);
}
} }
if (mLocator->ClearPendingRequest(this)) { if (mLocator->ClearPendingRequest(this)) {
@ -1110,7 +1094,6 @@ Geolocation::Update(nsIDOMGeoPosition *aSomewhere)
if (coords) { if (coords) {
double accuracy = -1; double accuracy = -1;
coords->GetAccuracy(&accuracy); coords->GetAccuracy(&accuracy);
mozilla::Telemetry::Accumulate(mozilla::Telemetry::GEOLOCATION_ACCURACY_EXPONENTIAL, accuracy);
} }
} }
@ -1135,8 +1118,6 @@ Geolocation::NotifyError(uint16_t aErrorCode)
return NS_OK; return NS_OK;
} }
mozilla::Telemetry::Accumulate(mozilla::Telemetry::GEOLOCATION_ERROR, true);
for (uint32_t i = mPendingCallbacks.Length(); i > 0; i--) { for (uint32_t i = mPendingCallbacks.Length(); i > 0; i--) {
mPendingCallbacks[i-1]->NotifyErrorAndShutdown(aErrorCode); mPendingCallbacks[i-1]->NotifyErrorAndShutdown(aErrorCode);
//NotifyErrorAndShutdown() removes the request from the array //NotifyErrorAndShutdown() removes the request from the array
@ -1214,10 +1195,6 @@ Geolocation::GetCurrentPosition(GeoPositionCallback callback,
// After this we hand over ownership of options to our nsGeolocationRequest. // After this we hand over ownership of options to our nsGeolocationRequest.
// Count the number of requests per protocol/scheme.
Telemetry::Accumulate(Telemetry::GEOLOCATION_GETCURRENTPOSITION_SECURE_ORIGIN,
static_cast<uint8_t>(mProtocolType));
RefPtr<nsGeolocationRequest> request = RefPtr<nsGeolocationRequest> request =
new nsGeolocationRequest(this, Move(callback), Move(errorCallback), new nsGeolocationRequest(this, Move(callback), Move(errorCallback),
Move(options), static_cast<uint8_t>(mProtocolType), Move(options), static_cast<uint8_t>(mProtocolType),
@ -1292,10 +1269,6 @@ Geolocation::WatchPosition(GeoPositionCallback aCallback,
return NS_ERROR_NOT_AVAILABLE; return NS_ERROR_NOT_AVAILABLE;
} }
// Count the number of requests per protocol/scheme.
Telemetry::Accumulate(Telemetry::GEOLOCATION_WATCHPOSITION_SECURE_ORIGIN,
static_cast<uint8_t>(mProtocolType));
// The watch ID: // The watch ID:
*aRv = mLastWatchId++; *aRv = mLastWatchId++;

View file

@ -38,7 +38,6 @@
// form submission // form submission
#include "HTMLFormSubmissionConstants.h" #include "HTMLFormSubmissionConstants.h"
#include "mozilla/dom/FormData.h" #include "mozilla/dom/FormData.h"
#include "mozilla/Telemetry.h"
#include "nsIFormSubmitObserver.h" #include "nsIFormSubmitObserver.h"
#include "nsIObserverService.h" #include "nsIObserverService.h"
#include "nsICategoryManager.h" #include "nsICategoryManager.h"
@ -957,13 +956,6 @@ HTMLFormElement::DoSecureToInsecureSubmitCheck(nsIURI* aActionURL,
*aCancelSubmit = (buttonPressed == 1); *aCancelSubmit = (buttonPressed == 1);
uint32_t telemetryBucket = uint32_t telemetryBucket =
nsISecurityUITelemetry::WARNING_CONFIRM_POST_TO_INSECURE_FROM_SECURE; nsISecurityUITelemetry::WARNING_CONFIRM_POST_TO_INSECURE_FROM_SECURE;
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SECURITY_UI,
telemetryBucket);
if (!*aCancelSubmit) {
// The user opted to continue, so note that in the next telemetry bucket.
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SECURITY_UI,
telemetryBucket + 1);
}
return NS_OK; return NS_OK;
} }

View file

@ -24,7 +24,6 @@
#include "nsIPhonetic.h" #include "nsIPhonetic.h"
#include "HTMLFormSubmissionConstants.h" #include "HTMLFormSubmissionConstants.h"
#include "mozilla/Telemetry.h"
#include "nsIControllers.h" #include "nsIControllers.h"
#include "nsIStringBundle.h" #include "nsIStringBundle.h"
#include "nsFocusManager.h" #include "nsFocusManager.h"
@ -1275,10 +1274,6 @@ HTMLInputElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
container->RadioRequiredWillChange(name, !!aValue); container->RadioRequiredWillChange(name, !!aValue);
} }
} }
if (aName == nsGkAtoms::webkitdirectory) {
Telemetry::Accumulate(Telemetry::WEBKIT_DIRECTORY_USED, true);
}
} }
return nsGenericHTMLFormElementWithState::BeforeSetAttr(aNameSpaceID, aName, return nsGenericHTMLFormElementWithState::BeforeSetAttr(aNameSpaceID, aName,
@ -4989,10 +4984,6 @@ HTMLInputElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
true); true);
dispatcher->PostDOMEvent(); dispatcher->PostDOMEvent();
} }
#ifdef EARLY_BETA_OR_EARLIER
Telemetry::Accumulate(Telemetry::PWMGR_PASSWORD_INPUT_IN_FORM, !!mForm);
#endif
} }
return rv; return rv;
@ -8863,7 +8854,6 @@ HTMLInputElement::UpdateEntries(const nsTArray<OwningFileOrDirectory>& aFilesOrD
void void
HTMLInputElement::GetWebkitEntries(nsTArray<RefPtr<FileSystemEntry>>& aSequence) HTMLInputElement::GetWebkitEntries(nsTArray<RefPtr<FileSystemEntry>>& aSequence)
{ {
Telemetry::Accumulate(Telemetry::BLINK_FILESYSTEM_USED, true);
aSequence.AppendElements(mEntries); aSequence.AppendElements(mEntries);
} }

View file

@ -92,7 +92,6 @@
#include "mozilla/dom/VideoTrackList.h" #include "mozilla/dom/VideoTrackList.h"
#include "mozilla/dom/TextTrack.h" #include "mozilla/dom/TextTrack.h"
#include "nsIContentPolicy.h" #include "nsIContentPolicy.h"
#include "mozilla/Telemetry.h"
#include "DecoderDoctorDiagnostics.h" #include "DecoderDoctorDiagnostics.h"
#include "DecoderTraits.h" #include "DecoderTraits.h"
#include "MediaContentType.h" #include "MediaContentType.h"
@ -1902,7 +1901,6 @@ void
HTMLMediaElement::FastSeek(double aTime, ErrorResult& aRv) HTMLMediaElement::FastSeek(double aTime, ErrorResult& aRv)
{ {
LOG(LogLevel::Debug, ("Reporting telemetry VIDEO_FASTSEEK_USED")); LOG(LogLevel::Debug, ("Reporting telemetry VIDEO_FASTSEEK_USED"));
Telemetry::Accumulate(Telemetry::VIDEO_FASTSEEK_USED, 1);
RefPtr<Promise> tobeDropped = Seek(aTime, SeekTarget::PrevSyncPoint, aRv); RefPtr<Promise> tobeDropped = Seek(aTime, SeekTarget::PrevSyncPoint, aRv);
} }
@ -3693,7 +3691,6 @@ HTMLMediaElement::ReportEMETelemetry()
// Report telemetry for EME videos when a page is unloaded. // Report telemetry for EME videos when a page is unloaded.
NS_ASSERTION(NS_IsMainThread(), "Should be on main thread."); NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
if (mIsEncrypted && Preferences::GetBool("media.eme.enabled")) { if (mIsEncrypted && Preferences::GetBool("media.eme.enabled")) {
Telemetry::Accumulate(Telemetry::VIDEO_EME_PLAY_SUCCESS, mLoadedDataFired);
LOG(LogLevel::Debug, ("%p VIDEO_EME_PLAY_SUCCESS = %s", LOG(LogLevel::Debug, ("%p VIDEO_EME_PLAY_SUCCESS = %s",
this, mLoadedDataFired ? "true" : "false")); this, mLoadedDataFired ? "true" : "false"));
} }
@ -3745,7 +3742,6 @@ HTMLMediaElement::ReportTelemetry()
} }
} }
Telemetry::Accumulate(Telemetry::VIDEO_UNLOAD_STATE, state);
LOG(LogLevel::Debug, ("%p VIDEO_UNLOAD_STATE = %d", this, state)); LOG(LogLevel::Debug, ("%p VIDEO_UNLOAD_STATE = %d", this, state));
FrameStatisticsData data; FrameStatisticsData data;
@ -3761,8 +3757,6 @@ HTMLMediaElement::ReportTelemetry()
uint32_t percentage = 100 * data.mDroppedFrames / data.mParsedFrames; uint32_t percentage = 100 * data.mDroppedFrames / data.mParsedFrames;
LOG(LogLevel::Debug, LOG(LogLevel::Debug,
("Reporting telemetry DROPPED_FRAMES_IN_VIDEO_PLAYBACK")); ("Reporting telemetry DROPPED_FRAMES_IN_VIDEO_PLAYBACK"));
Telemetry::Accumulate(Telemetry::VIDEO_DROPPED_FRAMES_PROPORTION,
percentage);
} }
} }
} }
@ -3774,10 +3768,8 @@ HTMLMediaElement::ReportTelemetry()
double hiddenPlayTime = mHiddenPlayTime.Total(); double hiddenPlayTime = mHiddenPlayTime.Total();
double videoDecodeSuspendTime = mVideoDecodeSuspendTime.Total(); double videoDecodeSuspendTime = mVideoDecodeSuspendTime.Total();
Telemetry::Accumulate(Telemetry::VIDEO_PLAY_TIME_MS, SECONDS_TO_MS(playTime));
LOG(LogLevel::Debug, ("%p VIDEO_PLAY_TIME_MS = %f", this, playTime)); LOG(LogLevel::Debug, ("%p VIDEO_PLAY_TIME_MS = %f", this, playTime));
Telemetry::Accumulate(Telemetry::VIDEO_HIDDEN_PLAY_TIME_MS, SECONDS_TO_MS(hiddenPlayTime));
LOG(LogLevel::Debug, ("%p VIDEO_HIDDEN_PLAY_TIME_MS = %f", this, hiddenPlayTime)); LOG(LogLevel::Debug, ("%p VIDEO_HIDDEN_PLAY_TIME_MS = %f", this, hiddenPlayTime));
if (playTime > 0.0) { if (playTime > 0.0) {
@ -3804,24 +3796,11 @@ HTMLMediaElement::ReportTelemetry()
key.AppendASCII(resolution); key.AppendASCII(resolution);
uint32_t hiddenPercentage = uint32_t(hiddenPlayTime / playTime * 100.0 + 0.5); uint32_t hiddenPercentage = uint32_t(hiddenPlayTime / playTime * 100.0 + 0.5);
Telemetry::Accumulate(Telemetry::VIDEO_HIDDEN_PLAY_TIME_PERCENTAGE,
key,
hiddenPercentage);
// Also accumulate all percentages in an "All" key.
Telemetry::Accumulate(Telemetry::VIDEO_HIDDEN_PLAY_TIME_PERCENTAGE,
NS_LITERAL_CSTRING("All"),
hiddenPercentage);
LOG(LogLevel::Debug, ("%p VIDEO_HIDDEN_PLAY_TIME_PERCENTAGE = %u, keys: '%s' and 'All'", LOG(LogLevel::Debug, ("%p VIDEO_HIDDEN_PLAY_TIME_PERCENTAGE = %u, keys: '%s' and 'All'",
this, hiddenPercentage, key.get())); this, hiddenPercentage, key.get()));
uint32_t videoDecodeSuspendPercentage = uint32_t videoDecodeSuspendPercentage =
uint32_t(videoDecodeSuspendTime / playTime * 100.0 + 0.5); uint32_t(videoDecodeSuspendTime / playTime * 100.0 + 0.5);
Telemetry::Accumulate(Telemetry::VIDEO_INFERRED_DECODE_SUSPEND_PERCENTAGE,
key,
videoDecodeSuspendPercentage);
Telemetry::Accumulate(Telemetry::VIDEO_INFERRED_DECODE_SUSPEND_PERCENTAGE,
NS_LITERAL_CSTRING("All"),
videoDecodeSuspendPercentage);
LOG(LogLevel::Debug, ("%p VIDEO_INFERRED_DECODE_SUSPEND_PERCENTAGE = %u, keys: '%s' and 'All'", LOG(LogLevel::Debug, ("%p VIDEO_INFERRED_DECODE_SUSPEND_PERCENTAGE = %u, keys: '%s' and 'All'",
this, videoDecodeSuspendPercentage, key.get())); this, videoDecodeSuspendPercentage, key.get()));
@ -3832,24 +3811,12 @@ HTMLMediaElement::ReportTelemetry()
/ 1000.0 / 1000.0
+ 0.5, + 0.5,
UINT32_MAX)); UINT32_MAX));
Telemetry::Accumulate(Telemetry::VIDEO_INTER_KEYFRAME_AVERAGE_MS,
key,
average_ms);
Telemetry::Accumulate(Telemetry::VIDEO_INTER_KEYFRAME_AVERAGE_MS,
NS_LITERAL_CSTRING("All"),
average_ms);
LOG(LogLevel::Debug, ("%p VIDEO_INTER_KEYFRAME_AVERAGE_MS = %u, keys: '%s' and 'All'", LOG(LogLevel::Debug, ("%p VIDEO_INTER_KEYFRAME_AVERAGE_MS = %u, keys: '%s' and 'All'",
this, average_ms, key.get())); this, average_ms, key.get()));
uint32_t max_ms = uint32_t max_ms =
uint32_t(std::min<uint64_t>((data.mInterKeyFrameMax_us + 500) / 1000, uint32_t(std::min<uint64_t>((data.mInterKeyFrameMax_us + 500) / 1000,
UINT32_MAX)); UINT32_MAX));
Telemetry::Accumulate(Telemetry::VIDEO_INTER_KEYFRAME_MAX_MS,
key,
max_ms);
Telemetry::Accumulate(Telemetry::VIDEO_INTER_KEYFRAME_MAX_MS,
NS_LITERAL_CSTRING("All"),
max_ms);
LOG(LogLevel::Debug, ("%p VIDEO_INTER_KEYFRAME_MAX_MS = %u, keys: '%s' and 'All'", LOG(LogLevel::Debug, ("%p VIDEO_INTER_KEYFRAME_MAX_MS = %u, keys: '%s' and 'All'",
this, max_ms, key.get())); this, max_ms, key.get()));
} else { } else {
@ -3858,12 +3825,6 @@ HTMLMediaElement::ReportTelemetry()
// decode-suspend delay (showing recovery would be difficult). // decode-suspend delay (showing recovery would be difficult).
uint32_t suspendDelay_ms = MediaPrefs::MDSMSuspendBackgroundVideoDelay(); uint32_t suspendDelay_ms = MediaPrefs::MDSMSuspendBackgroundVideoDelay();
if (uint32_t(playTime * 1000.0) > suspendDelay_ms) { if (uint32_t(playTime * 1000.0) > suspendDelay_ms) {
Telemetry::Accumulate(Telemetry::VIDEO_INTER_KEYFRAME_MAX_MS,
key,
0);
Telemetry::Accumulate(Telemetry::VIDEO_INTER_KEYFRAME_MAX_MS,
NS_LITERAL_CSTRING("All"),
0);
LOG(LogLevel::Debug, ("%p VIDEO_INTER_KEYFRAME_MAX_MS = 0 (only 1 keyframe), keys: '%s' and 'All'", LOG(LogLevel::Debug, ("%p VIDEO_INTER_KEYFRAME_MAX_MS = 0 (only 1 keyframe), keys: '%s' and 'All'",
this, key.get())); this, key.get()));
} }
@ -6860,97 +6821,6 @@ HTMLMediaElement::MarkAsContentSource(CallerAPI aAPI)
{ {
const bool isVisible = mVisibilityState != Visibility::APPROXIMATELY_NONVISIBLE; const bool isVisible = mVisibilityState != Visibility::APPROXIMATELY_NONVISIBLE;
if (isVisible) {
// 0 = ALL_VISIBLE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE, 0);
} else {
// 1 = ALL_INVISIBLE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE, 1);
if (IsInUncomposedDoc()) {
// 0 = ALL_IN_TREE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE_IN_TREE_OR_NOT, 0);
} else {
// 1 = ALL_NOT_IN_TREE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE_IN_TREE_OR_NOT, 1);
}
}
switch (aAPI) {
case CallerAPI::DRAW_IMAGE: {
if (isVisible) {
// 2 = drawImage_VISIBLE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE, 2);
} else {
// 3 = drawImage_INVISIBLE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE, 3);
if (IsInUncomposedDoc()) {
// 2 = drawImage_IN_TREE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE_IN_TREE_OR_NOT, 2);
} else {
// 3 = drawImage_NOT_IN_TREE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE_IN_TREE_OR_NOT, 3);
}
}
break;
}
case CallerAPI::CREATE_PATTERN: {
if (isVisible) {
// 4 = createPattern_VISIBLE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE, 4);
} else {
// 5 = createPattern_INVISIBLE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE, 5);
if (IsInUncomposedDoc()) {
// 4 = createPattern_IN_TREE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE_IN_TREE_OR_NOT, 4);
} else {
// 5 = createPattern_NOT_IN_TREE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE_IN_TREE_OR_NOT, 5);
}
}
break;
}
case CallerAPI::CREATE_IMAGEBITMAP: {
if (isVisible) {
// 6 = createImageBitmap_VISIBLE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE, 6);
} else {
// 7 = createImageBitmap_INVISIBLE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE, 7);
if (IsInUncomposedDoc()) {
// 6 = createImageBitmap_IN_TREE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE_IN_TREE_OR_NOT, 6);
} else {
// 7 = createImageBitmap_NOT_IN_TREE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE_IN_TREE_OR_NOT, 7);
}
}
break;
}
case CallerAPI::CAPTURE_STREAM: {
if (isVisible) {
// 8 = captureStream_VISIBLE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE, 8);
} else {
// 9 = captureStream_INVISIBLE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE, 9);
if (IsInUncomposedDoc()) {
// 8 = captureStream_IN_TREE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE_IN_TREE_OR_NOT, 8);
} else {
// 9 = captureStream_NOT_IN_TREE
Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE_IN_TREE_OR_NOT, 9);
}
}
break;
}
}
LOG(LogLevel::Debug, LOG(LogLevel::Debug,
("%p Log VIDEO_AS_CONTENT_SOURCE: visibility = %u, API: '%d' and 'All'", ("%p Log VIDEO_AS_CONTENT_SOURCE: visibility = %u, API: '%d' and 'All'",
this, isVisible, aAPI)); this, isVisible, aAPI));

View file

@ -12,7 +12,6 @@
#include "mozilla/dom/TextTrackCue.h" #include "mozilla/dom/TextTrackCue.h"
#include "mozilla/dom/Event.h" #include "mozilla/dom/Event.h"
#include "mozilla/ClearOnShutdown.h" #include "mozilla/ClearOnShutdown.h"
#include "mozilla/Telemetry.h"
#include "nsComponentManagerUtils.h" #include "nsComponentManagerUtils.h"
#include "nsVariant.h" #include "nsVariant.h"
#include "nsVideoFrame.h" #include "nsVideoFrame.h"
@ -824,24 +823,13 @@ TextTrackManager::NotifyReset()
void void
TextTrackManager::ReportTelemetryForTrack(TextTrack* aTextTrack) const TextTrackManager::ReportTelemetryForTrack(TextTrack* aTextTrack) const
{ {
MOZ_ASSERT(NS_IsMainThread()); /* STUB */
MOZ_ASSERT(aTextTrack);
MOZ_ASSERT(mTextTracks->Length() > 0);
TextTrackKind kind = aTextTrack->Kind();
Telemetry::Accumulate(Telemetry::WEBVTT_TRACK_KINDS, uint32_t(kind));
} }
void void
TextTrackManager::ReportTelemetryForCue() TextTrackManager::ReportTelemetryForCue()
{ {
MOZ_ASSERT(NS_IsMainThread()); /* STUB */
MOZ_ASSERT(!mNewCues->IsEmpty() || !mLastActiveCues->IsEmpty());
if (!mCueTelemetryReported) {
Telemetry::Accumulate(Telemetry::WEBVTT_USED_VTT_CUES, 1);
mCueTelemetryReported = true;
}
} }
} // namespace dom } // namespace dom

View file

@ -47,7 +47,6 @@
#include "mozilla/dom/HTMLInputElement.h" #include "mozilla/dom/HTMLInputElement.h"
#include "nsNumberControlFrame.h" #include "nsNumberControlFrame.h"
#include "nsFrameSelection.h" #include "nsFrameSelection.h"
#include "mozilla/Telemetry.h"
#include "mozilla/layers/ScrollInputMethods.h" #include "mozilla/layers/ScrollInputMethods.h"
using namespace mozilla; using namespace mozilla;
@ -585,9 +584,6 @@ nsTextInputSelectionImpl::CompleteScroll(bool aForward)
if (!mScrollFrame) if (!mScrollFrame)
return NS_ERROR_NOT_INITIALIZED; return NS_ERROR_NOT_INITIALIZED;
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadCompleteScroll);
mScrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1), mScrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1),
nsIScrollableFrame::WHOLE, nsIScrollableFrame::WHOLE,
nsIScrollableFrame::INSTANT); nsIScrollableFrame::INSTANT);
@ -640,9 +636,6 @@ nsTextInputSelectionImpl::ScrollPage(bool aForward)
if (!mScrollFrame) if (!mScrollFrame)
return NS_ERROR_NOT_INITIALIZED; return NS_ERROR_NOT_INITIALIZED;
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollPage);
mScrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1), mScrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1),
nsIScrollableFrame::PAGES, nsIScrollableFrame::PAGES,
nsIScrollableFrame::SMOOTH); nsIScrollableFrame::SMOOTH);
@ -655,9 +648,6 @@ nsTextInputSelectionImpl::ScrollLine(bool aForward)
if (!mScrollFrame) if (!mScrollFrame)
return NS_ERROR_NOT_INITIALIZED; return NS_ERROR_NOT_INITIALIZED;
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollLine);
mScrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1), mScrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1),
nsIScrollableFrame::LINES, nsIScrollableFrame::LINES,
nsIScrollableFrame::SMOOTH); nsIScrollableFrame::SMOOTH);
@ -670,9 +660,6 @@ nsTextInputSelectionImpl::ScrollCharacter(bool aRight)
if (!mScrollFrame) if (!mScrollFrame)
return NS_ERROR_NOT_INITIALIZED; return NS_ERROR_NOT_INITIALIZED;
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollCharacter);
mScrollFrame->ScrollBy(nsIntPoint(aRight ? 1 : -1, 0), mScrollFrame->ScrollBy(nsIntPoint(aRight ? 1 : -1, 0),
nsIScrollableFrame::LINES, nsIScrollableFrame::LINES,
nsIScrollableFrame::SMOOTH); nsIScrollableFrame::SMOOTH);

View file

@ -1718,9 +1718,6 @@ ContentParent::ActorDestroy(ActorDestroyReason why)
props->SetPropertyAsUint64(NS_LITERAL_STRING("childID"), mChildID); props->SetPropertyAsUint64(NS_LITERAL_STRING("childID"), mChildID);
if (AbnormalShutdown == why) { if (AbnormalShutdown == why) {
Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT,
NS_LITERAL_CSTRING("content"), 1);
props->SetPropertyAsBool(NS_LITERAL_STRING("abnormal"), true); props->SetPropertyAsBool(NS_LITERAL_STRING("abnormal"), true);
} }
nsAutoString cpId; nsAutoString cpId;
@ -4778,7 +4775,7 @@ bool
ContentParent::RecvAccumulateChildHistogram( ContentParent::RecvAccumulateChildHistogram(
InfallibleTArray<Accumulation>&& aAccumulations) InfallibleTArray<Accumulation>&& aAccumulations)
{ {
Telemetry::AccumulateChild(GeckoProcessType_Content, aAccumulations); /* STUB */
return true; return true;
} }
@ -4786,6 +4783,6 @@ bool
ContentParent::RecvAccumulateChildKeyedHistogram( ContentParent::RecvAccumulateChildKeyedHistogram(
InfallibleTArray<KeyedAccumulation>&& aAccumulations) InfallibleTArray<KeyedAccumulation>&& aAccumulations)
{ {
Telemetry::AccumulateChildKeyed(GeckoProcessType_Content, aAccumulations); /* STUB */
return true; return true;
} }

View file

@ -14,7 +14,6 @@
#include "mozilla/Mutex.h" #include "mozilla/Mutex.h"
#include "mozilla/Sprintf.h" #include "mozilla/Sprintf.h"
#include <algorithm> #include <algorithm>
#include "mozilla/Telemetry.h"
#include "CubebUtils.h" #include "CubebUtils.h"
#include "nsPrintfCString.h" #include "nsPrintfCString.h"
#include "gfxPrefs.h" #include "gfxPrefs.h"
@ -378,8 +377,6 @@ AudioStream::OpenCubeb(cubeb* aContext, cubeb_stream_params& aParams,
TimeDuration timeDelta = TimeStamp::Now() - aStartTime; TimeDuration timeDelta = TimeStamp::Now() - aStartTime;
LOG("creation time %sfirst: %u ms", aIsFirst ? "" : "not ", LOG("creation time %sfirst: %u ms", aIsFirst ? "" : "not ",
(uint32_t) timeDelta.ToMilliseconds()); (uint32_t) timeDelta.ToMilliseconds());
Telemetry::Accumulate(aIsFirst ? Telemetry::AUDIOSTREAM_FIRST_OPEN_MS :
Telemetry::AUDIOSTREAM_LATER_OPEN_MS, timeDelta.ToMilliseconds());
return NS_OK; return NS_OK;
} }

View file

@ -11,7 +11,6 @@
#include "PDMFactory.h" #include "PDMFactory.h"
#include "WebMDemuxer.h" #include "WebMDemuxer.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "mozilla/dom/ContentChild.h" #include "mozilla/dom/ContentChild.h"
#ifndef MOZ_WIDGET_ANDROID #ifndef MOZ_WIDGET_ANDROID
@ -68,7 +67,6 @@ VP9Benchmark::IsVP9DecodeFast()
Preferences::SetUint(sBenchmarkFpsPref, aDecodeFps); Preferences::SetUint(sBenchmarkFpsPref, aDecodeFps);
Preferences::SetUint(sBenchmarkFpsVersionCheck, sBenchmarkVersionID); Preferences::SetUint(sBenchmarkFpsVersionCheck, sBenchmarkVersionID);
} }
Telemetry::Accumulate(Telemetry::ID::VIDEO_VP9_BENCHMARK_FPS, aDecodeFps);
}, },
[]() { }); []() { });
} }

View file

@ -248,14 +248,9 @@ void ReportCubebBackendUsed()
bool foundBackend = false; bool foundBackend = false;
for (uint32_t i = 0; i < ArrayLength(AUDIOSTREAM_BACKEND_ID_STR); i++) { for (uint32_t i = 0; i < ArrayLength(AUDIOSTREAM_BACKEND_ID_STR); i++) {
if (!strcmp(cubeb_get_backend_id(sCubebContext), AUDIOSTREAM_BACKEND_ID_STR[i])) { if (!strcmp(cubeb_get_backend_id(sCubebContext), AUDIOSTREAM_BACKEND_ID_STR[i])) {
Telemetry::Accumulate(Telemetry::AUDIOSTREAM_BACKEND_USED, i);
foundBackend = true; foundBackend = true;
} }
} }
if (!foundBackend) {
Telemetry::Accumulate(Telemetry::AUDIOSTREAM_BACKEND_USED,
CUBEB_BACKEND_UNKNOWN);
}
} }
void ReportCubebStreamInitFailure(bool aIsFirst) void ReportCubebStreamInitFailure(bool aIsFirst)
@ -267,9 +262,6 @@ void ReportCubebStreamInitFailure(bool aIsFirst)
// failures to open multiple streams in a process over time. // failures to open multiple streams in a process over time.
return; return;
} }
Telemetry::Accumulate(Telemetry::AUDIOSTREAM_BACKEND_USED,
aIsFirst ? CUBEB_BACKEND_INIT_FAILURE_FIRST
: CUBEB_BACKEND_INIT_FAILURE_OTHER);
} }
uint32_t GetCubebPlaybackLatencyInMilliseconds() uint32_t GetCubebPlaybackLatencyInMilliseconds()

View file

@ -288,7 +288,7 @@ CanHandleMediaType(const MediaContentType& aType,
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
if (IsHttpLiveStreamingType(aType.GetMIMEType())) { if (IsHttpLiveStreamingType(aType.GetMIMEType())) {
Telemetry::Accumulate(Telemetry::MEDIA_HLS_CANPLAY_REQUESTED, true); /* Telemetry STUB */
} }
if (aType.HaveCodecs()) { if (aType.HaveCodecs()) {
@ -433,11 +433,6 @@ InstantiateDecoder(const nsACString& aType,
} }
#endif #endif
if (IsHttpLiveStreamingType(aType)) {
// We don't have an HLS decoder.
Telemetry::Accumulate(Telemetry::MEDIA_HLS_DECODER_SUCCESS, false);
}
return nullptr; return nullptr;
} }

View file

@ -877,7 +877,6 @@ MediaDecoder::EnsureTelemetryReported()
} }
for (const nsCString& codec : codecs) { for (const nsCString& codec : codecs) {
DECODER_LOG("Telemetry MEDIA_CODEC_USED= '%s'", codec.get()); DECODER_LOG("Telemetry MEDIA_CODEC_USED= '%s'", codec.get());
Telemetry::Accumulate(Telemetry::ID::MEDIA_CODEC_USED, codec);
} }
mTelemetryReported = true; mTelemetryReported = true;

View file

@ -1178,40 +1178,7 @@ ReportRecoveryTelemetry(const TimeStamp& aRecoveryStart,
const MediaInfo& aMediaInfo, const MediaInfo& aMediaInfo,
bool aIsHardwareAccelerated) bool aIsHardwareAccelerated)
{ {
MOZ_ASSERT(NS_IsMainThread()); /* STUB */
if (!aMediaInfo.HasVideo()) {
return;
}
// Keyed by audio+video or video alone, hardware acceleration,
// and by a resolution range.
nsCString key(aMediaInfo.HasAudio() ? "AV" : "V");
key.AppendASCII(aIsHardwareAccelerated ? "(hw)," : ",");
static const struct { int32_t mH; const char* mRes; } sResolutions[] = {
{ 240, "0-240" },
{ 480, "241-480" },
{ 720, "481-720" },
{ 1080, "721-1080" },
{ 2160, "1081-2160" }
};
const char* resolution = "2161+";
int32_t height = aMediaInfo.mVideo.mImage.height;
for (const auto& res : sResolutions) {
if (height <= res.mH) {
resolution = res.mRes;
break;
}
}
key.AppendASCII(resolution);
TimeDuration duration = TimeStamp::Now() - aRecoveryStart;
double duration_ms = duration.ToMilliseconds();
Telemetry::Accumulate(Telemetry::VIDEO_SUSPEND_RECOVERY_TIME_MS,
key,
uint32_t(duration_ms + 0.5));
Telemetry::Accumulate(Telemetry::VIDEO_SUSPEND_RECOVERY_TIME_MS,
NS_LITERAL_CSTRING("All"),
uint32_t(duration_ms + 0.5));
} }
void void

View file

@ -32,7 +32,6 @@
#include "nsAppDirectoryServiceDefs.h" #include "nsAppDirectoryServiceDefs.h"
#include "nsIInputStream.h" #include "nsIInputStream.h"
#include "nsILineInputStream.h" #include "nsILineInputStream.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Types.h" #include "mozilla/Types.h"
#include "mozilla/PeerIdentity.h" #include "mozilla/PeerIdentity.h"
#include "mozilla/dom/ContentChild.h" #include "mozilla/dom/ContentChild.h"
@ -2060,28 +2059,6 @@ MediaManager::GetUserMedia(nsPIDOMWindowInner* aWindow,
host.LowerCaseEqualsLiteral("127.0.0.1") || host.LowerCaseEqualsLiteral("127.0.0.1") ||
host.LowerCaseEqualsLiteral("::1")); host.LowerCaseEqualsLiteral("::1"));
// Record telemetry about whether the source of the call was secure, i.e.,
// privileged or HTTPS. We may handle other cases
if (privileged) {
Telemetry::Accumulate(Telemetry::WEBRTC_GET_USER_MEDIA_SECURE_ORIGIN,
(uint32_t) GetUserMediaSecurityState::Privileged);
} else if (isHTTPS) {
Telemetry::Accumulate(Telemetry::WEBRTC_GET_USER_MEDIA_SECURE_ORIGIN,
(uint32_t) GetUserMediaSecurityState::HTTPS);
} else if (isFile) {
Telemetry::Accumulate(Telemetry::WEBRTC_GET_USER_MEDIA_SECURE_ORIGIN,
(uint32_t) GetUserMediaSecurityState::File);
} else if (isApp) {
Telemetry::Accumulate(Telemetry::WEBRTC_GET_USER_MEDIA_SECURE_ORIGIN,
(uint32_t) GetUserMediaSecurityState::App);
} else if (isLocalhost) {
Telemetry::Accumulate(Telemetry::WEBRTC_GET_USER_MEDIA_SECURE_ORIGIN,
(uint32_t) GetUserMediaSecurityState::Localhost);
} else {
Telemetry::Accumulate(Telemetry::WEBRTC_GET_USER_MEDIA_SECURE_ORIGIN,
(uint32_t) GetUserMediaSecurityState::Other);
}
nsCString origin; nsCString origin;
rv = nsPrincipal::GetOriginForURI(docURI, origin); rv = nsPrincipal::GetOriginForURI(docURI, origin);
if (NS_WARN_IF(NS_FAILED(rv))) { if (NS_WARN_IF(NS_FAILED(rv))) {
@ -2100,8 +2077,6 @@ if (privileged) {
videoType = StringToEnum(dom::MediaSourceEnumValues::strings, videoType = StringToEnum(dom::MediaSourceEnumValues::strings,
vc.mMediaSource, vc.mMediaSource,
MediaSourceEnum::Other); MediaSourceEnum::Other);
Telemetry::Accumulate(Telemetry::WEBRTC_GET_USER_MEDIA_TYPE,
(uint32_t) videoType);
switch (videoType) { switch (videoType) {
case MediaSourceEnum::Camera: case MediaSourceEnum::Camera:
break; break;
@ -2192,8 +2167,6 @@ if (privileged) {
ac.mMediaSource.AssignASCII(EnumToASCII(dom::MediaSourceEnumValues::strings, ac.mMediaSource.AssignASCII(EnumToASCII(dom::MediaSourceEnumValues::strings,
audioType)); audioType));
} }
Telemetry::Accumulate(Telemetry::WEBRTC_GET_USER_MEDIA_TYPE,
(uint32_t) audioType);
switch (audioType) { switch (audioType) {
case MediaSourceEnum::Microphone: case MediaSourceEnum::Microphone:

View file

@ -6,7 +6,6 @@
#include "mozilla/Base64.h" #include "mozilla/Base64.h"
#include "mozilla/TaskQueue.h" #include "mozilla/TaskQueue.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Function.h" #include "mozilla/Function.h"
#include "MediaContentType.h" #include "MediaContentType.h"
@ -248,24 +247,6 @@ ExtractH264CodecDetails(const nsAString& aCodec,
aLevel *= 10; aLevel *= 10;
} }
// Capture the constraint_set flag value for the purpose of Telemetry.
// We don't NS_ENSURE_SUCCESS here because ExtractH264CodecDetails doesn't
// care about this, but we make sure constraints is above 4 (constraint_set5_flag)
// otherwise collect 0 for unknown.
uint8_t constraints = PromiseFlatString(Substring(aCodec, 7, 2)).ToInteger(&rv, 16);
Telemetry::Accumulate(Telemetry::VIDEO_CANPLAYTYPE_H264_CONSTRAINT_SET_FLAG,
constraints >= 4 ? constraints : 0);
// 244 is the highest meaningful profile value (High 4:4:4 Intra Profile)
// that can be represented as single hex byte, otherwise collect 0 for unknown.
Telemetry::Accumulate(Telemetry::VIDEO_CANPLAYTYPE_H264_PROFILE,
aProfile <= 244 ? aProfile : 0);
// Make sure aLevel represents a value between levels 1 and 5.2,
// otherwise collect 0 for unknown.
Telemetry::Accumulate(Telemetry::VIDEO_CANPLAYTYPE_H264_LEVEL,
(aLevel >= 10 && aLevel <= 52) ? aLevel : 0);
return true; return true;
} }

View file

@ -96,9 +96,6 @@ DetailedPromise::MaybeReportTelemetry(Status aStatus)
uint32_t latency = (TimeStamp::Now() - mStartTime).ToMilliseconds(); uint32_t latency = (TimeStamp::Now() - mStartTime).ToMilliseconds();
EME_LOG("%s %s latency %ums reported via telemetry", mName.get(), EME_LOG("%s %s latency %ums reported via telemetry", mName.get(),
((aStatus == Succeeded) ? "succcess" : "failure"), latency); ((aStatus == Succeeded) ? "succcess" : "failure"), latency);
Telemetry::ID tid = (aStatus == Succeeded) ? mSuccessLatencyProbe.Value()
: mFailureLatencyProbe.Value();
Telemetry::Accumulate(tid, latency);
} }
} // namespace dom } // namespace dom

View file

@ -315,9 +315,6 @@ MediaKeySession::GenerateRequest(const nsAString& aInitDataType,
// Note: Remaining steps of generateRequest method continue in CDM. // Note: Remaining steps of generateRequest method continue in CDM.
Telemetry::Accumulate(Telemetry::VIDEO_CDM_GENERATE_REQUEST_CALLED,
ToCDMTypeTelemetryEnum(mKeySystem));
// Convert initData to base64 for easier logging. // Convert initData to base64 for easier logging.
// Note: CreateSession() Move()s the data out of the array, so we have // Note: CreateSession() Move()s the data out of the array, so we have
// to copy it here. // to copy it here.

View file

@ -13,7 +13,6 @@
#include "mozilla/dom/MediaKeySession.h" #include "mozilla/dom/MediaKeySession.h"
#include "mozilla/dom/DOMException.h" #include "mozilla/dom/DOMException.h"
#include "mozilla/dom/UnionTypes.h" #include "mozilla/dom/UnionTypes.h"
#include "mozilla/Telemetry.h"
#include "GMPCDMProxy.h" #include "GMPCDMProxy.h"
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
#include "mozilla/MediaDrmCDMProxy.h" #include "mozilla/MediaDrmCDMProxy.h"
@ -457,7 +456,6 @@ MediaKeys::OnCDMCreated(PromiseId aId, const nsACString& aNodeId, const uint32_t
mKeySystem, mKeySystem,
MediaKeySystemStatus::Cdm_created); MediaKeySystemStatus::Cdm_created);
Telemetry::Accumulate(Telemetry::VIDEO_CDM_CREATED, ToCDMTypeTelemetryEnum(mKeySystem));
} }
static bool static bool

View file

@ -81,35 +81,11 @@ private:
bool bool
AccumulateSPSTelemetry(const MediaByteBuffer* aExtradata) AccumulateSPSTelemetry(const MediaByteBuffer* aExtradata)
{ {
// XXX: Do we still need this without telemetry?
mp4_demuxer::SPSData spsdata; mp4_demuxer::SPSData spsdata;
if (mp4_demuxer::H264::DecodeSPSFromExtraData(aExtradata, spsdata)) { if (mp4_demuxer::H264::DecodeSPSFromExtraData(aExtradata, spsdata)) {
uint8_t constraints = (spsdata.constraint_set0_flag ? (1 << 0) : 0) |
(spsdata.constraint_set1_flag ? (1 << 1) : 0) |
(spsdata.constraint_set2_flag ? (1 << 2) : 0) |
(spsdata.constraint_set3_flag ? (1 << 3) : 0) |
(spsdata.constraint_set4_flag ? (1 << 4) : 0) |
(spsdata.constraint_set5_flag ? (1 << 5) : 0);
Telemetry::Accumulate(Telemetry::VIDEO_DECODED_H264_SPS_CONSTRAINT_SET_FLAG,
constraints);
// Collect profile_idc values up to 244, otherwise 0 for unknown.
Telemetry::Accumulate(Telemetry::VIDEO_DECODED_H264_SPS_PROFILE,
spsdata.profile_idc <= 244 ? spsdata.profile_idc : 0);
// Make sure level_idc represents a value between levels 1 and 5.2,
// otherwise collect 0 for unknown level.
Telemetry::Accumulate(Telemetry::VIDEO_DECODED_H264_SPS_LEVEL,
(spsdata.level_idc >= 10 && spsdata.level_idc <= 52) ?
spsdata.level_idc : 0);
// max_num_ref_frames should be between 0 and 16, anything larger will
// be treated as invalid.
Telemetry::Accumulate(Telemetry::VIDEO_H264_SPS_MAX_NUM_REF_FRAMES,
std::min(spsdata.max_num_ref_frames, 17u));
return false; return false;
} }
return true; return true;
} }

View file

@ -12,7 +12,6 @@
#include "mozilla/Atomics.h" #include "mozilla/Atomics.h"
#include "mozilla/PodOperations.h" #include "mozilla/PodOperations.h"
#include "mozilla/SharedThreadPool.h" #include "mozilla/SharedThreadPool.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h" #include "mozilla/TimeStamp.h"
#include "MediaDataDemuxer.h" #include "MediaDataDemuxer.h"
#include "nsAutoRef.h" #include "nsAutoRef.h"
@ -164,7 +163,6 @@ OggDemuxer::~OggDemuxer()
MOZ_LOG(gMediaDemuxerLog, mozilla::LogLevel::Debug, MOZ_LOG(gMediaDemuxerLog, mozilla::LogLevel::Debug,
("OggDemuxer(%p)::%s: Reporting telemetry MEDIA_OGG_LOADED_IS_CHAINED=%d", ("OggDemuxer(%p)::%s: Reporting telemetry MEDIA_OGG_LOADED_IS_CHAINED=%d",
ptr, __func__, isChained)); ptr, __func__, isChained));
Telemetry::Accumulate(Telemetry::ID::MEDIA_OGG_LOADED_IS_CHAINED, isChained);
}); });
AbstractThread::MainThread()->Dispatch(task.forget()); AbstractThread::MainThread()->Dispatch(task.forget());
} }

View file

@ -14,7 +14,6 @@
#include "mozilla/layers/D3D11ShareHandleImage.h" #include "mozilla/layers/D3D11ShareHandleImage.h"
#include "mozilla/layers/ImageBridgeChild.h" #include "mozilla/layers/ImageBridgeChild.h"
#include "mozilla/layers/TextureForwarder.h" #include "mozilla/layers/TextureForwarder.h"
#include "mozilla/Telemetry.h"
#include "MediaTelemetryConstants.h" #include "MediaTelemetryConstants.h"
#include "mfapi.h" #include "mfapi.h"
#include "gfxPrefs.h" #include "gfxPrefs.h"
@ -442,9 +441,6 @@ D3D9DXVA2Manager::Init(layers::KnowsCompositor* aKnowsCompositor,
} }
mTextureClientAllocator->SetMaxPoolSize(5); mTextureClientAllocator->SetMaxPoolSize(5);
Telemetry::Accumulate(Telemetry::MEDIA_DECODER_BACKEND_USED,
uint32_t(media::MediaDecoderBackend::WMFDXVA2D3D9));
return S_OK; return S_OK;
} }
@ -775,9 +771,6 @@ D3D11DXVA2Manager::Init(layers::KnowsCompositor* aKnowsCompositor,
} }
mTextureClientAllocator->SetMaxPoolSize(5); mTextureClientAllocator->SetMaxPoolSize(5);
Telemetry::Accumulate(Telemetry::MEDIA_DECODER_BACKEND_USED,
uint32_t(media::MediaDecoderBackend::WMFDXVA2D3D11));
return S_OK; return S_OK;
} }

View file

@ -252,7 +252,6 @@ WMFAudioMFTManager::Output(int64_t aStreamOffset,
LOG("Audio MFTDecoder returned success but null output."); LOG("Audio MFTDecoder returned success but null output.");
nsCOMPtr<nsIRunnable> task = NS_NewRunnableFunction([]() -> void { nsCOMPtr<nsIRunnable> task = NS_NewRunnableFunction([]() -> void {
LOG("Reporting telemetry AUDIO_MFT_OUTPUT_NULL_SAMPLES"); LOG("Reporting telemetry AUDIO_MFT_OUTPUT_NULL_SAMPLES");
Telemetry::Accumulate(Telemetry::ID::AUDIO_MFT_OUTPUT_NULL_SAMPLES, 1);
}); });
AbstractThread::MainThread()->Dispatch(task.forget()); AbstractThread::MainThread()->Dispatch(task.forget());
return E_FAIL; return E_FAIL;

View file

@ -8,7 +8,6 @@
#include "VideoUtils.h" #include "VideoUtils.h"
#include "WMFUtils.h" #include "WMFUtils.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Logging.h" #include "mozilla/Logging.h"
#include "mozilla/SyncRunnable.h" #include "mozilla/SyncRunnable.h"
@ -67,7 +66,7 @@ SendTelemetry(unsigned long hr)
nsCOMPtr<nsIRunnable> runnable = NS_NewRunnableFunction( nsCOMPtr<nsIRunnable> runnable = NS_NewRunnableFunction(
[sample] { [sample] {
Telemetry::Accumulate(Telemetry::MEDIA_WMF_DECODE_ERROR, sample); /* Telemetry STUB */
}); });
NS_DispatchToMainThread(runnable); NS_DispatchToMainThread(runnable);
} }

View file

@ -128,7 +128,6 @@ WMFVideoMFTManager::~WMFVideoMFTManager()
nsCOMPtr<nsIRunnable> task = NS_NewRunnableFunction([=]() -> void { nsCOMPtr<nsIRunnable> task = NS_NewRunnableFunction([=]() -> void {
LOG(nsPrintfCString("Reporting telemetry VIDEO_MFT_OUTPUT_NULL_SAMPLES=%d", telemetry).get()); LOG(nsPrintfCString("Reporting telemetry VIDEO_MFT_OUTPUT_NULL_SAMPLES=%d", telemetry).get());
Telemetry::Accumulate(Telemetry::ID::VIDEO_MFT_OUTPUT_NULL_SAMPLES, telemetry);
}); });
AbstractThread::MainThread()->Dispatch(task.forget()); AbstractThread::MainThread()->Dispatch(task.forget());
} }
@ -511,8 +510,6 @@ WMFVideoMFTManager::InitInternal(bool aForceD3D9)
if (mStreamType == VP9 || mStreamType == VP8) { if (mStreamType == VP9 || mStreamType == VP8) {
return false; return false;
} }
Telemetry::Accumulate(Telemetry::MEDIA_DECODER_BACKEND_USED,
uint32_t(media::MediaDecoderBackend::WMFSoftware));
} }
mDecoder = decoder; mDecoder = decoder;

View file

@ -15,7 +15,6 @@
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
#include "nsReadableUtils.h" #include "nsReadableUtils.h"
#include "nsIObserverService.h" #include "nsIObserverService.h"
#include "mozilla/Telemetry.h"
#include "mozilla/ArrayUtils.h" #include "mozilla/ArrayUtils.h"
// MOZ_LOG=LoadManager:5 // MOZ_LOG=LoadManager:5
@ -192,23 +191,6 @@ LoadManagerSingleton::RemoveObserver(webrtc::CPULoadStateObserver * aObserver)
for (size_t i = 0; i < MOZ_ARRAY_LENGTH(mTimeInState); i++) { for (size_t i = 0; i < MOZ_ARRAY_LENGTH(mTimeInState); i++) {
total += mTimeInState[i]; total += mTimeInState[i];
} }
// Don't include short calls; we don't have reasonable load data, and
// such short calls rarely reach a stable state. Keep relatively
// short calls separate from longer ones
bool log = total > 5*PR_MSEC_PER_SEC;
bool small = log && total < 30*PR_MSEC_PER_SEC;
if (log) {
// Note: We don't care about rounding here; thus total may be < 100
Telemetry::Accumulate(small ? Telemetry::WEBRTC_LOAD_STATE_RELAXED_SHORT :
Telemetry::WEBRTC_LOAD_STATE_RELAXED,
(uint32_t) (mTimeInState[webrtc::CPULoadState::kLoadRelaxed]/total * 100));
Telemetry::Accumulate(small ? Telemetry::WEBRTC_LOAD_STATE_NORMAL_SHORT :
Telemetry::WEBRTC_LOAD_STATE_NORMAL,
(uint32_t) (mTimeInState[webrtc::CPULoadState::kLoadNormal]/total * 100));
Telemetry::Accumulate(small ? Telemetry::WEBRTC_LOAD_STATE_STRESSED_SHORT :
Telemetry::WEBRTC_LOAD_STATE_STRESSED,
(uint32_t) (mTimeInState[webrtc::CPULoadState::kLoadStressed]/total * 100));
}
for (auto &in_state : mTimeInState) { for (auto &in_state : mTimeInState) {
in_state = 0; in_state = 0;
} }

View file

@ -23,7 +23,6 @@
#include "VideoUtils.h" #include "VideoUtils.h"
#include "WebAudioUtils.h" #include "WebAudioUtils.h"
#include "mozilla/dom/Promise.h" #include "mozilla/dom/Promise.h"
#include "mozilla/Telemetry.h"
#include "nsPrintfCString.h" #include "nsPrintfCString.h"
#include "GMPService.h" #include "GMPService.h"
@ -302,7 +301,6 @@ MediaDecodeTask::OnMetadataRead(MetadataHolder* aMetadata)
MOZ_LOG(gMediaDecoderLog, MOZ_LOG(gMediaDecoderLog,
LogLevel::Debug, LogLevel::Debug,
("Telemetry (WebAudio) MEDIA_CODEC_USED= '%s'", codec.get())); ("Telemetry (WebAudio) MEDIA_CODEC_USED= '%s'", codec.get()));
Telemetry::Accumulate(Telemetry::ID::MEDIA_CODEC_USED, codec);
}); });
AbstractThread::MainThread()->Dispatch(task.forget()); AbstractThread::MainThread()->Dispatch(task.forget());

View file

@ -642,8 +642,6 @@ NotificationPermissionRequest::ResolvePromise()
mCallback->Call(mPermission, error); mCallback->Call(mPermission, error);
rv = error.StealNSResult(); rv = error.StealNSResult();
} }
Telemetry::Accumulate(
Telemetry::WEB_NOTIFICATION_REQUEST_PERMISSION_CALLBACK, !!mCallback);
mPromise->MaybeResolve(mPermission); mPromise->MaybeResolve(mPermission);
return rv; return rv;
} }
@ -750,11 +748,6 @@ NotificationTelemetryService::RecordPermissions()
if (!GetNotificationPermission(supportsPermission, &capability)) { if (!GetNotificationPermission(supportsPermission, &capability)) {
continue; continue;
} }
if (capability == nsIPermissionManager::DENY_ACTION) {
Telemetry::Accumulate(Telemetry::WEB_NOTIFICATION_PERMISSIONS, 0);
} else if (capability == nsIPermissionManager::ALLOW_ACTION) {
Telemetry::Accumulate(Telemetry::WEB_NOTIFICATION_PERMISSIONS, 1);
}
} }
} }
@ -800,9 +793,6 @@ NotificationTelemetryService::RecordDNDSupported()
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
return; return;
} }
Telemetry::Accumulate(
Telemetry::ALERTS_SERVICE_DND_SUPPORTED_FLAG, true);
} }
nsresult nsresult
@ -819,7 +809,6 @@ NotificationTelemetryService::RecordSender(nsIPrincipal* aPrincipal)
} }
if (!mOrigins.Contains(origin)) { if (!mOrigins.Contains(origin)) {
mOrigins.PutEntry(origin); mOrigins.PutEntry(origin);
Telemetry::Accumulate(Telemetry::WEB_NOTIFICATION_SENDERS, 1);
} }
return NS_OK; return NS_OK;
} }
@ -829,21 +818,7 @@ NotificationTelemetryService::Observe(nsISupports* aSubject,
const char* aTopic, const char* aTopic,
const char16_t* aData) const char16_t* aData)
{ {
uint32_t capability; /* STUB */
if (strcmp("perm-changed", aTopic) ||
!NS_strcmp(u"cleared", aData) ||
!GetNotificationPermission(aSubject, &capability)) {
return NS_OK;
}
if (!NS_strcmp(u"deleted", aData)) {
if (capability == nsIPermissionManager::DENY_ACTION) {
Telemetry::Accumulate(
Telemetry::WEB_NOTIFICATION_PERMISSION_REMOVED, 0);
} else if (capability == nsIPermissionManager::ALLOW_ACTION) {
Telemetry::Accumulate(
Telemetry::WEB_NOTIFICATION_PERMISSION_REMOVED, 1);
}
}
return NS_OK; return NS_OK;
} }
@ -1407,7 +1382,6 @@ NotificationObserver::Observe(nsISupports* aSubject, const char* aTopic,
AssertIsOnMainThread(); AssertIsOnMainThread();
if (!strcmp("alertdisablecallback", aTopic)) { if (!strcmp("alertdisablecallback", aTopic)) {
Telemetry::Accumulate(Telemetry::WEB_NOTIFICATION_MENU, 1);
if (XRE_IsParentProcess()) { if (XRE_IsParentProcess()) {
return Notification::RemovePermission(mPrincipal); return Notification::RemovePermission(mPrincipal);
} }
@ -1417,10 +1391,7 @@ NotificationObserver::Observe(nsISupports* aSubject, const char* aTopic,
ContentChild::GetSingleton()->SendDisableNotifications( ContentChild::GetSingleton()->SendDisableNotifications(
IPC::Principal(mPrincipal)); IPC::Principal(mPrincipal));
return NS_OK; return NS_OK;
} else if (!strcmp("alertclickcallback", aTopic)) {
Telemetry::Accumulate(Telemetry::WEB_NOTIFICATION_CLICKED, 1);
} else if (!strcmp("alertsettingscallback", aTopic)) { } else if (!strcmp("alertsettingscallback", aTopic)) {
Telemetry::Accumulate(Telemetry::WEB_NOTIFICATION_MENU, 2);
if (XRE_IsParentProcess()) { if (XRE_IsParentProcess()) {
return Notification::OpenSettings(mPrincipal); return Notification::OpenSettings(mPrincipal);
} }
@ -1433,21 +1404,7 @@ NotificationObserver::Observe(nsISupports* aSubject, const char* aTopic,
!strcmp("alertfinished", aTopic)) { !strcmp("alertfinished", aTopic)) {
RefPtr<NotificationTelemetryService> telemetry = RefPtr<NotificationTelemetryService> telemetry =
NotificationTelemetryService::GetInstance(); NotificationTelemetryService::GetInstance();
if (telemetry) {
// Record whether "do not disturb" is supported after the first
// notification, to account for falling back to XUL alerts.
telemetry->RecordDNDSupported();
if (!mInPrivateBrowsing) {
// Ignore senders in private windows.
Unused << NS_WARN_IF(NS_FAILED(telemetry->RecordSender(mPrincipal)));
}
}
Unused << NS_WARN_IF(NS_FAILED(AdjustPushQuota(aTopic))); Unused << NS_WARN_IF(NS_FAILED(AdjustPushQuota(aTopic)));
if (!strcmp("alertshow", aTopic)) {
// Record notifications actually shown (e.g. don't count if DND is on).
Telemetry::Accumulate(Telemetry::WEB_NOTIFICATION_SHOWN, 1);
}
} }
return mObserver->Observe(aSubject, aTopic, aData); return mObserver->Observe(aSubject, aTopic, aData);

View file

@ -8,7 +8,6 @@
#include "PluginHangUIParent.h" #include "PluginHangUIParent.h"
#include "mozilla/Telemetry.h"
#include "mozilla/ipc/ProtocolUtils.h" #include "mozilla/ipc/ProtocolUtils.h"
#include "mozilla/plugins/PluginModuleParent.h" #include "mozilla/plugins/PluginModuleParent.h"
@ -48,14 +47,6 @@ public:
NS_IMETHOD NS_IMETHOD
Run() override Run() override
{ {
mozilla::Telemetry::Accumulate(
mozilla::Telemetry::PLUGIN_HANG_UI_USER_RESPONSE, mResponseCode);
mozilla::Telemetry::Accumulate(
mozilla::Telemetry::PLUGIN_HANG_UI_DONT_ASK, mDontAskCode);
mozilla::Telemetry::Accumulate(
mozilla::Telemetry::PLUGIN_HANG_UI_RESPONSE_TIME, mResponseTimeMs);
mozilla::Telemetry::Accumulate(
mozilla::Telemetry::PLUGIN_HANG_TIME, mTimeoutMs + mResponseTimeMs);
return NS_OK; return NS_OK;
} }

View file

@ -9,7 +9,6 @@
#include "mozilla/BasicEvents.h" #include "mozilla/BasicEvents.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "PluginInstanceParent.h" #include "PluginInstanceParent.h"
#include "BrowserStreamParent.h" #include "BrowserStreamParent.h"
#include "PluginAsyncSurrogate.h" #include "PluginAsyncSurrogate.h"
@ -2504,6 +2503,5 @@ PluginInstanceParent::RecordDrawingModel()
} }
MOZ_ASSERT(mode >= 0); MOZ_ASSERT(mode >= 0);
Telemetry::Accumulate(Telemetry::PLUGIN_DRAWING_MODEL, mode);
mLastRecordedDrawingModel = mode; mLastRecordedDrawingModel = mode;
} }

View file

@ -20,7 +20,6 @@
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/ProcessHangMonitor.h" #include "mozilla/ProcessHangMonitor.h"
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Unused.h" #include "mozilla/Unused.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
#include "nsCRT.h" #include "nsCRT.h"
@ -1172,11 +1171,6 @@ PluginModuleParent::GetRunID(uint32_t* aRunID)
void void
PluginModuleChromeParent::ActorDestroy(ActorDestroyReason why) PluginModuleChromeParent::ActorDestroy(ActorDestroyReason why)
{ {
if (why == AbnormalShutdown) {
Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT,
NS_LITERAL_CSTRING("plugin"), 1);
}
// We can't broadcast settings changes anymore. // We can't broadcast settings changes anymore.
UnregisterSettingsCallbacks(); UnregisterSettingsCallbacks();
@ -2203,12 +2197,8 @@ public:
void void
PluginModuleParent::AccumulateModuleInitBlockedTime() PluginModuleParent::AccumulateModuleInitBlockedTime()
{ {
if (mPluginName.IsEmpty()) { // XXX: mTimeBlocked can probably go if not used for anything besides
GetPluginDetails(); // telemetry.
}
Telemetry::Accumulate(Telemetry::BLOCKED_ON_PLUGIN_MODULE_INIT_MS,
GetHistogramKey(),
static_cast<uint32_t>(mTimeBlocked.ToMilliseconds()));
mTimeBlocked = TimeDuration(); mTimeBlocked = TimeDuration();
} }

View file

@ -983,44 +983,5 @@ enum MixedContentHSTSState {
void void
nsMixedContentBlocker::AccumulateMixedContentHSTS(nsIURI* aURI, bool aActive) nsMixedContentBlocker::AccumulateMixedContentHSTS(nsIURI* aURI, bool aActive)
{ {
// This method must only be called in the parent, because /* STUB */
// nsSiteSecurityService is only available in the parent
if (!XRE_IsParentProcess()) {
MOZ_ASSERT(false);
return;
}
bool hsts;
nsresult rv;
nsCOMPtr<nsISiteSecurityService> sss = do_GetService(NS_SSSERVICE_CONTRACTID, &rv);
if (NS_FAILED(rv)) {
return;
}
rv = sss->IsSecureURI(nsISiteSecurityService::HEADER_HSTS, aURI, 0, nullptr, &hsts);
if (NS_FAILED(rv)) {
return;
}
// states: would upgrade, hsts info cached
// active, passive
//
if (!aActive) {
if (!hsts) {
Telemetry::Accumulate(Telemetry::MIXED_CONTENT_HSTS,
MCB_HSTS_PASSIVE_NO_HSTS);
}
else {
Telemetry::Accumulate(Telemetry::MIXED_CONTENT_HSTS,
MCB_HSTS_PASSIVE_WITH_HSTS);
}
} else {
if (!hsts) {
Telemetry::Accumulate(Telemetry::MIXED_CONTENT_HSTS,
MCB_HSTS_ACTIVE_NO_HSTS);
}
else {
Telemetry::Accumulate(Telemetry::MIXED_CONTENT_HSTS,
MCB_HSTS_ACTIVE_WITH_HSTS);
}
}
} }

View file

@ -309,7 +309,7 @@ public:
explicit TelemetryAutoTimer(Telemetry::ID aId) explicit TelemetryAutoTimer(Telemetry::ID aId)
: id(aId), start(TimeStamp::Now()) {} : id(aId), start(TimeStamp::Now()) {}
~TelemetryAutoTimer() ~TelemetryAutoTimer()
{ Telemetry::AccumulateDelta_impl<Telemetry::Millisecond>::compute(id, start); } { /* STUB */ }
private: private:
Telemetry::ID id; Telemetry::ID id;
const TimeStamp start; const TimeStamp start;
@ -329,9 +329,6 @@ DOMStorageCache::WaitForPreload(Telemetry::ID aTelemetryID)
// Telemetry of rates of pending preloads // Telemetry of rates of pending preloads
if (!mPreloadTelemetryRecorded) { if (!mPreloadTelemetryRecorded) {
mPreloadTelemetryRecorded = true; mPreloadTelemetryRecorded = true;
Telemetry::Accumulate(
Telemetry::LOCALDOMSTORAGE_PRELOAD_PENDING_ON_FIRST_ACCESS,
!loaded);
} }
if (loaded) { if (loaded) {

View file

@ -13,7 +13,6 @@
#include "CoreLocationLocationProvider.h" #include "CoreLocationLocationProvider.h"
#include "nsCocoaFeatures.h" #include "nsCocoaFeatures.h"
#include "prtime.h" #include "prtime.h"
#include "mozilla/Telemetry.h"
#include "MLSFallback.h" #include "MLSFallback.h"
#include <CoreLocation/CLError.h> #include <CoreLocation/CLError.h>
@ -103,7 +102,6 @@ static const CLLocationAccuracy kDEFAULT_ACCURACY = kCLLocationAccuracyNearestTe
PR_Now() / PR_USEC_PER_MSEC); PR_Now() / PR_USEC_PER_MSEC);
mProvider->Update(geoPosition); mProvider->Update(geoPosition);
Telemetry::Accumulate(Telemetry::GEOLOCATION_OSX_SOURCE_IS_MLS, false);
} }
@end @end
@ -127,7 +125,6 @@ CoreLocationLocationProvider::MLSUpdate::Update(nsIDOMGeoPosition *position)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
mParentLocationProvider.Update(position); mParentLocationProvider.Update(position);
Telemetry::Accumulate(Telemetry::GEOLOCATION_OSX_SOURCE_IS_MLS, true);
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP

View file

@ -10,7 +10,6 @@
#include "nsComponentManagerUtils.h" #include "nsComponentManagerUtils.h"
#include "prtime.h" #include "prtime.h"
#include "MLSFallback.h" #include "MLSFallback.h"
#include "mozilla/Telemetry.h"
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
@ -34,7 +33,6 @@ WindowsLocationProvider::MLSUpdate::Update(nsIDOMGeoPosition *aPosition)
if (!coords) { if (!coords) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
Telemetry::Accumulate(Telemetry::GEOLOCATION_WIN8_SOURCE_IS_MLS, true);
return mCallback->Update(aPosition); return mCallback->Update(aPosition);
} }
NS_IMETHODIMP NS_IMETHODIMP
@ -176,8 +174,6 @@ LocationEvent::OnLocationChanged(REFIID aReportType,
PR_Now() / PR_USEC_PER_MSEC); PR_Now() / PR_USEC_PER_MSEC);
mCallback->Update(position); mCallback->Update(position);
Telemetry::Accumulate(Telemetry::GEOLOCATION_WIN8_SOURCE_IS_MLS, false);
return S_OK; return S_OK;
} }

View file

@ -30,7 +30,6 @@
#include "mozilla/AsyncEventDispatcher.h" #include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/Atomics.h" #include "mozilla/Atomics.h"
#include "mozilla/CycleCollectedJSContext.h" #include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h" #include "mozilla/TimeStamp.h"
#include "mozilla/dom/asmjscache/AsmJSCache.h" #include "mozilla/dom/asmjscache/AsmJSCache.h"
#include "mozilla/dom/AtomList.h" #include "mozilla/dom/AtomList.h"
@ -1534,7 +1533,6 @@ RuntimeService::RegisterWorker(WorkerPrivate* aWorkerPrivate)
const bool isDedicatedWorker = aWorkerPrivate->IsDedicatedWorker(); const bool isDedicatedWorker = aWorkerPrivate->IsDedicatedWorker();
if (isServiceWorker) { if (isServiceWorker) {
AssertIsOnMainThread(); AssertIsOnMainThread();
Telemetry::Accumulate(Telemetry::SERVICE_WORKER_SPAWN_ATTEMPTS, 1);
} }
nsCString sharedWorkerScriptSpec; nsCString sharedWorkerScriptSpec;
@ -1586,14 +1584,6 @@ RuntimeService::RegisterWorker(WorkerPrivate* aWorkerPrivate)
// Worker spawn gets queued due to hitting max workers per domain // Worker spawn gets queued due to hitting max workers per domain
// limit so let's log a warning. // limit so let's log a warning.
WorkerPrivate::ReportErrorToConsole("HittingMaxWorkersPerDomain2"); WorkerPrivate::ReportErrorToConsole("HittingMaxWorkersPerDomain2");
if (isServiceWorker) {
Telemetry::Accumulate(Telemetry::SERVICE_WORKER_SPAWN_GETS_QUEUED, 1);
} else if (isSharedWorker) {
Telemetry::Accumulate(Telemetry::SHARED_WORKER_SPAWN_GETS_QUEUED, 1);
} else if (isDedicatedWorker) {
Telemetry::Accumulate(Telemetry::DEDICATED_WORKER_SPAWN_GETS_QUEUED, 1);
}
} }
else if (parent) { else if (parent) {
domainInfo->mChildWorkerCount++; domainInfo->mChildWorkerCount++;
@ -1669,7 +1659,6 @@ RuntimeService::RegisterWorker(WorkerPrivate* aWorkerPrivate)
if (isServiceWorker) { if (isServiceWorker) {
AssertIsOnMainThread(); AssertIsOnMainThread();
Telemetry::Accumulate(Telemetry::SERVICE_WORKER_WAS_SPAWNED, 1);
} }
return true; return true;
} }
@ -1766,8 +1755,6 @@ RuntimeService::UnregisterWorker(WorkerPrivate* aWorkerPrivate)
if (aWorkerPrivate->IsServiceWorker()) { if (aWorkerPrivate->IsServiceWorker()) {
AssertIsOnMainThread(); AssertIsOnMainThread();
Telemetry::AccumulateTimeDelta(Telemetry::SERVICE_WORKER_LIFE_TIME,
aWorkerPrivate->CreationTimeStamp());
} }
if (aWorkerPrivate->IsSharedWorker() || if (aWorkerPrivate->IsSharedWorker() ||

View file

@ -33,7 +33,6 @@
#include "mozilla/ClearOnShutdown.h" #include "mozilla/ClearOnShutdown.h"
#include "mozilla/ErrorNames.h" #include "mozilla/ErrorNames.h"
#include "mozilla/LoadContext.h" #include "mozilla/LoadContext.h"
#include "mozilla/Telemetry.h"
#include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/ContentParent.h" #include "mozilla/dom/ContentParent.h"
#include "mozilla/dom/DOMError.h" #include "mozilla/dom/DOMError.h"
@ -676,7 +675,6 @@ ServiceWorkerManager::Register(mozIDOMWindow* aWindow,
queue->ScheduleJob(job); queue->ScheduleJob(job);
AssertIsOnMainThread(); AssertIsOnMainThread();
Telemetry::Accumulate(Telemetry::SERVICE_WORKER_REGISTRATIONS, 1);
promise.forget(aPromise); promise.forget(aPromise);
return NS_OK; return NS_OK;
@ -2180,7 +2178,6 @@ ServiceWorkerManager::StartControllingADocument(ServiceWorkerRegistrationInfo* a
if (!aDocumentId.IsEmpty()) { if (!aDocumentId.IsEmpty()) {
aDoc->SetId(aDocumentId); aDoc->SetId(aDocumentId);
} }
Telemetry::Accumulate(Telemetry::SERVICE_WORKER_CONTROLLED_DOCUMENTS, 1);
} }
void void

View file

@ -135,9 +135,6 @@ ServiceWorkerRegistrar::GetRegistrations(
if (firstTime) { if (firstTime) {
firstTime = false; firstTime = false;
Telemetry::AccumulateTimeDelta(
Telemetry::SERVICE_WORKER_REGISTRATION_LOADING,
startTime);
} }
} }

View file

@ -408,8 +408,6 @@ ServiceWorkerUpdateJob::ComparisonResult(nsresult aStatus,
return; return;
} }
Telemetry::Accumulate(Telemetry::SERVICE_WORKER_UPDATED, 1);
// Begin step 7 of the Update algorithm to evaluate the new script. // Begin step 7 of the Update algorithm to evaluate the new script.
RefPtr<ServiceWorkerInfo> sw = RefPtr<ServiceWorkerInfo> sw =

View file

@ -12,7 +12,6 @@
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/dom/MessagePort.h" #include "mozilla/dom/MessagePort.h"
#include "mozilla/dom/SharedWorkerBinding.h" #include "mozilla/dom/SharedWorkerBinding.h"
#include "mozilla/Telemetry.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsIClassInfoImpl.h" #include "nsIClassInfoImpl.h"
#include "nsIDOMEvent.h" #include "nsIDOMEvent.h"
@ -73,8 +72,6 @@ SharedWorker::Constructor(const GlobalObject& aGlobal, JSContext* aCx,
return nullptr; return nullptr;
} }
Telemetry::Accumulate(Telemetry::SHARED_WORKER_COUNT, 1);
return sharedWorker.forget(); return sharedWorker.forget();
} }

View file

@ -15,7 +15,6 @@
#include "mozilla/DebugOnly.h" #include "mozilla/DebugOnly.h"
#include "mozilla/ErrorResult.h" #include "mozilla/ErrorResult.h"
#include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/ScriptSettings.h"
#include "mozilla/Telemetry.h"
#include "js/RootingAPI.h" #include "js/RootingAPI.h"
#include "js/Value.h" #include "js/Value.h"
@ -572,8 +571,6 @@ WorkerMainThreadRunnable::Dispatch(Status aFailStatus, ErrorResult& aRv)
{ {
mWorkerPrivate->AssertIsOnWorkerThread(); mWorkerPrivate->AssertIsOnWorkerThread();
TimeStamp startTime = TimeStamp::NowLoRes();
AutoSyncLoopHolder syncLoop(mWorkerPrivate, aFailStatus); AutoSyncLoopHolder syncLoop(mWorkerPrivate, aFailStatus);
mSyncLoopTarget = syncLoop.GetEventTarget(); mSyncLoopTarget = syncLoop.GetEventTarget();
@ -590,11 +587,6 @@ WorkerMainThreadRunnable::Dispatch(Status aFailStatus, ErrorResult& aRv)
if (!syncLoop.Run()) { if (!syncLoop.Run()) {
aRv.ThrowUncatchableException(); aRv.ThrowUncatchableException();
} }
Telemetry::Accumulate(Telemetry::SYNC_WORKER_OPERATION, mTelemetryKey,
static_cast<uint32_t>((TimeStamp::NowLoRes() - startTime)
.ToMilliseconds()));
Unused << startTime; // Shut the compiler up.
} }
NS_IMETHODIMP NS_IMETHODIMP

View file

@ -757,15 +757,6 @@ XMLHttpRequestMainThread::SetResponseType(XMLHttpRequestResponseType aResponseTy
return; return;
} }
// We want to get rid of this moz-only types. Bug 1335365.
if (aResponseType == XMLHttpRequestResponseType::Moz_blob) {
Telemetry::Accumulate(Telemetry::MOZ_BLOB_IN_XHR, 1);
} else if (aResponseType == XMLHttpRequestResponseType::Moz_chunked_text) {
Telemetry::Accumulate(Telemetry::MOZ_CHUNKED_TEXT_IN_XHR, 1);
} else if (aResponseType == XMLHttpRequestResponseType::Moz_chunked_arraybuffer) {
Telemetry::Accumulate(Telemetry::MOZ_CHUNKED_ARRAYBUFFER_IN_XHR, 1);
}
// Set the responseType attribute's value to the given value. // Set the responseType attribute's value to the given value.
mResponseType = aResponseType; mResponseType = aResponseType;
} }
@ -1521,8 +1512,6 @@ XMLHttpRequestMainThread::Open(const nsACString& aMethod,
GetOwner()->GetExtantDoc()->WarnOnceAbout(nsIDocument::eSyncXMLHttpRequest); GetOwner()->GetExtantDoc()->WarnOnceAbout(nsIDocument::eSyncXMLHttpRequest);
} }
Telemetry::Accumulate(Telemetry::XMLHTTPREQUEST_ASYNC_OR_SYNC, aAsync ? 0 : 1);
// Step 1 // Step 1
nsCOMPtr<nsIDocument> responsibleDocument = GetDocumentIfCurrent(); nsCOMPtr<nsIDocument> responsibleDocument = GetDocumentIfCurrent();
if (!responsibleDocument) { if (!responsibleDocument) {

View file

@ -1588,8 +1588,6 @@ XMLHttpRequestWorker::Construct(const GlobalObject& aGlobal,
WorkerPrivate* workerPrivate = GetWorkerPrivateFromContext(cx); WorkerPrivate* workerPrivate = GetWorkerPrivateFromContext(cx);
MOZ_ASSERT(workerPrivate); MOZ_ASSERT(workerPrivate);
Telemetry::Accumulate(Telemetry::XHR_IN_WORKER, 1);
RefPtr<XMLHttpRequestWorker> xhr = new XMLHttpRequestWorker(workerPrivate); RefPtr<XMLHttpRequestWorker> xhr = new XMLHttpRequestWorker(workerPrivate);
if (workerPrivate->XHRParamsAllowed()) { if (workerPrivate->XHRParamsAllowed()) {

View file

@ -45,12 +45,6 @@ UpdategDisableXULCache()
// Get the value of "nglayout.debug.disable_xul_cache" preference // Get the value of "nglayout.debug.disable_xul_cache" preference
gDisableXULCache = gDisableXULCache =
Preferences::GetBool(kDisableXULCachePref, gDisableXULCache); Preferences::GetBool(kDisableXULCachePref, gDisableXULCache);
// Sets the flag if the XUL cache is disabled
if (gDisableXULCache) {
Telemetry::Accumulate(Telemetry::XUL_CACHE_DISABLED, true);
}
} }
static void static void

View file

@ -22,7 +22,6 @@
#include "nsIPrefBranch.h" #include "nsIPrefBranch.h"
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
#include "nsNativeCharsetUtils.h" #include "nsNativeCharsetUtils.h"
#include "mozilla/Telemetry.h"
#include "nsAuthGSSAPI.h" #include "nsAuthGSSAPI.h"
@ -377,16 +376,6 @@ nsAuthGSSAPI::Init(const char *serviceName,
mServiceName = serviceName; mServiceName = serviceName;
mServiceFlags = serviceFlags; mServiceFlags = serviceFlags;
static bool sTelemetrySent = false;
if (!sTelemetrySent) {
mozilla::Telemetry::Accumulate(
mozilla::Telemetry::NTLM_MODULE_USED_2,
serviceFlags & nsIAuthModule::REQ_PROXY_AUTH
? NTLM_MODULE_KERBEROS_PROXY
: NTLM_MODULE_KERBEROS_DIRECT);
sTelemetrySent = true;
}
return NS_OK; return NS_OK;
} }

View file

@ -20,7 +20,6 @@
#include "nsNetCID.h" #include "nsNetCID.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsICryptoHash.h" #include "nsICryptoHash.h"
#include "mozilla/Telemetry.h"
#include <windows.h> #include <windows.h>
@ -275,16 +274,6 @@ nsAuthSSPI::Init(const char *serviceName,
if (rc != SEC_E_OK) if (rc != SEC_E_OK)
return NS_ERROR_UNEXPECTED; return NS_ERROR_UNEXPECTED;
static bool sTelemetrySent = false;
if (!sTelemetrySent) {
mozilla::Telemetry::Accumulate(
mozilla::Telemetry::NTLM_MODULE_USED_2,
serviceFlags & nsIAuthModule::REQ_PROXY_AUTH
? NTLM_MODULE_WIN_API_PROXY
: NTLM_MODULE_WIN_API_DIRECT);
sTelemetrySent = true;
}
LOG(("AcquireCredentialsHandle() succeeded.\n")); LOG(("AcquireCredentialsHandle() succeeded.\n"));
return NS_OK; return NS_OK;
} }

View file

@ -9,7 +9,6 @@
#include "prenv.h" #include "prenv.h"
#include "plbase64.h" #include "plbase64.h"
#include "prerror.h" #include "prerror.h"
#include "mozilla/Telemetry.h"
#include <stdlib.h> #include <stdlib.h>
@ -212,17 +211,6 @@ nsAuthSambaNTLM::Init(const char *serviceName,
const char16_t *password) const char16_t *password)
{ {
NS_ASSERTION(!username && !domain && !password, "unexpected credentials"); NS_ASSERTION(!username && !domain && !password, "unexpected credentials");
static bool sTelemetrySent = false;
if (!sTelemetrySent) {
mozilla::Telemetry::Accumulate(
mozilla::Telemetry::NTLM_MODULE_USED_2,
serviceFlags & nsIAuthModule::REQ_PROXY_AUTH
? NTLM_MODULE_SAMBA_AUTH_PROXY
: NTLM_MODULE_SAMBA_AUTH_DIRECT);
sTelemetrySent = true;
}
return NS_OK; return NS_OK;
} }

View file

@ -866,9 +866,6 @@ nsPermissionManager::InitDB(bool aRemoveFile)
if (rv == NS_ERROR_FILE_CORRUPTED) { if (rv == NS_ERROR_FILE_CORRUPTED) {
LogToConsole(NS_LITERAL_STRING("permissions.sqlite is corrupted! Try again!")); LogToConsole(NS_LITERAL_STRING("permissions.sqlite is corrupted! Try again!"));
// Add telemetry probe
mozilla::Telemetry::Accumulate(mozilla::Telemetry::PERMISSIONS_SQL_CORRUPTED, 1);
// delete corrupted permissions.sqlite and try again // delete corrupted permissions.sqlite and try again
rv = permissionsFile->Remove(false); rv = permissionsFile->Remove(false);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
@ -891,9 +888,6 @@ nsPermissionManager::InitDB(bool aRemoveFile)
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
LogToConsole(NS_LITERAL_STRING("Defective permissions.sqlite has been removed.")); LogToConsole(NS_LITERAL_STRING("Defective permissions.sqlite has been removed."));
// Add telemetry probe
mozilla::Telemetry::Accumulate(mozilla::Telemetry::DEFECTIVE_PERMISSIONS_SQL_REMOVED, 1);
rv = OpenDatabase(permissionsFile); rv = OpenDatabase(permissionsFile);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
LogToConsole(NS_LITERAL_STRING("OpenDatabase to permissions.sqlite is successful!")); LogToConsole(NS_LITERAL_STRING("OpenDatabase to permissions.sqlite is successful!"));
@ -1185,25 +1179,7 @@ nsPermissionManager::InitDB(bool aRemoveFile)
if (NS_SUCCEEDED(rv) && if (NS_SUCCEEDED(rv) &&
NS_SUCCEEDED(countStmt->ExecuteStep(&hasResult)) && NS_SUCCEEDED(countStmt->ExecuteStep(&hasResult)) &&
hasResult) { hasResult) {
int32_t permsCount = countStmt->AsInt32(0); // Telemetry STUB (count rows and report)
// The id variable contains the number of rows inserted into the
// moz_hosts_new table (as one ID was used per entry)
uint32_t telemetryValue;
if (permsCount > id) {
telemetryValue = 3; // NEW > OLD
} else if (permsCount == id) {
telemetryValue = 2; // NEW == OLD
} else if (permsCount == 0) {
telemetryValue = 0; // NEW = 0
} else {
telemetryValue = 1; // NEW < OLD
}
// Report the telemetry value to telemetry
mozilla::Telemetry::Accumulate(
mozilla::Telemetry::PERMISSIONS_REMIGRATION_COMPARISON,
telemetryValue);
} else { } else {
NS_WARNING("Could not count the rows in moz_perms"); NS_WARNING("Could not count the rows in moz_perms");
} }
@ -1221,9 +1197,6 @@ nsPermissionManager::InitDB(bool aRemoveFile)
rv = mDBConn->CommitTransaction(); rv = mDBConn->CommitTransaction();
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
mozilla::Telemetry::Accumulate(mozilla::Telemetry::PERMISSIONS_MIGRATION_7_ERROR,
NS_WARN_IF(migrationError));
} else { } else {
// We don't have a moz_hosts table, so we create one for downgrading purposes. // We don't have a moz_hosts table, so we create one for downgrading purposes.
// This table is empty. // This table is empty.

View file

@ -9,7 +9,6 @@
#include "gfxUtils.h" #include "gfxUtils.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Assertions.h" #include "mozilla/Assertions.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Tokenizer.h" #include "mozilla/Tokenizer.h"
#include "mozilla/ScopeExit.h" #include "mozilla/ScopeExit.h"
#include "mozilla/Unused.h" #include "mozilla/Unused.h"
@ -472,20 +471,6 @@ GLLibraryEGL::EnsureInitialized(bool forceAccel, nsACString* const out_failureId
chosenDisplay = GetAndInitDisplayForAccelANGLE(*this, out_failureId); chosenDisplay = GetAndInitDisplayForAccelANGLE(*this, out_failureId);
} }
// Report the acceleration status to telemetry
if (!chosenDisplay) {
if (accelAngleFailureId.IsEmpty()) {
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_ACCL_FAILURE_ID,
NS_LITERAL_CSTRING("FEATURE_FAILURE_ACCL_ANGLE_UNKNOWN"));
} else {
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_ACCL_FAILURE_ID,
accelAngleFailureId);
}
} else {
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_ACCL_FAILURE_ID,
NS_LITERAL_CSTRING("SUCCESS"));
}
// Fallback to a WARP display if ANGLE fails, or if WARP is forced // Fallback to a WARP display if ANGLE fails, or if WARP is forced
if (!chosenDisplay && shouldTryWARP) { if (!chosenDisplay && shouldTryWARP) {
chosenDisplay = GetAndInitWARPDisplay(*this, EGL_DEFAULT_DISPLAY); chosenDisplay = GetAndInitWARPDisplay(*this, EGL_DEFAULT_DISPLAY);

View file

@ -8,7 +8,6 @@
#include "gfxPrefs.h" #include "gfxPrefs.h"
#include "GPUProcessHost.h" #include "GPUProcessHost.h"
#include "GPUProcessManager.h" #include "GPUProcessManager.h"
#include "mozilla/Telemetry.h"
#include "mozilla/dom/CheckerboardReportService.h" #include "mozilla/dom/CheckerboardReportService.h"
#include "mozilla/gfx/gfxVars.h" #include "mozilla/gfx/gfxVars.h"
#if defined(XP_WIN) #if defined(XP_WIN)
@ -80,7 +79,6 @@ GPUChild::EnsureGPUReady()
SendGetDeviceStatus(&data); SendGetDeviceStatus(&data);
gfxPlatform::GetPlatform()->ImportGPUDeviceData(data); gfxPlatform::GetPlatform()->ImportGPUDeviceData(data);
Telemetry::AccumulateTimeDelta(Telemetry::GPU_PROCESS_LAUNCH_TIME_MS, mHost->GetLaunchTime());
mGPUReady = true; mGPUReady = true;
} }
@ -93,7 +91,6 @@ GPUChild::RecvInitComplete(const GPUDeviceData& aData)
} }
gfxPlatform::GetPlatform()->ImportGPUDeviceData(aData); gfxPlatform::GetPlatform()->ImportGPUDeviceData(aData);
Telemetry::AccumulateTimeDelta(Telemetry::GPU_PROCESS_LAUNCH_TIME_MS, mHost->GetLaunchTime());
mGPUReady = true; mGPUReady = true;
return true; return true;
} }
@ -131,14 +128,14 @@ GPUChild::RecvNotifyUiObservers(const nsCString& aTopic)
bool bool
GPUChild::RecvAccumulateChildHistogram(InfallibleTArray<Accumulation>&& aAccumulations) GPUChild::RecvAccumulateChildHistogram(InfallibleTArray<Accumulation>&& aAccumulations)
{ {
Telemetry::AccumulateChild(GeckoProcessType_GPU, aAccumulations); /* Telemetry STUB */
return true; return true;
} }
bool bool
GPUChild::RecvAccumulateChildKeyedHistogram(InfallibleTArray<KeyedAccumulation>&& aAccumulations) GPUChild::RecvAccumulateChildKeyedHistogram(InfallibleTArray<KeyedAccumulation>&& aAccumulations)
{ {
Telemetry::AccumulateChildKeyed(GeckoProcessType_GPU, aAccumulations); /* Telemetry STUB */
return true; return true;
} }
@ -152,11 +149,6 @@ GPUChild::RecvNotifyDeviceReset()
void void
GPUChild::ActorDestroy(ActorDestroyReason aWhy) GPUChild::ActorDestroy(ActorDestroyReason aWhy)
{ {
if (aWhy == AbnormalShutdown) {
Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT,
nsDependentCString(XRE_ChildProcessTypeToString(GeckoProcessType_GPU), 1));
}
gfxVars::RemoveReceiver(this); gfxVars::RemoveReceiver(this);
mHost->OnChannelClosed(); mHost->OnChannelClosed();
} }

View file

@ -22,7 +22,6 @@
#include "gfxUtils.h" // for gfxUtils, etc #include "gfxUtils.h" // for gfxUtils, etc
#include "gfx2DGlue.h" #include "gfx2DGlue.h"
#include "mozilla/DebugOnly.h" // for DebugOnly #include "mozilla/DebugOnly.h" // for DebugOnly
#include "mozilla/Telemetry.h" // for Accumulate
#include "mozilla/ToString.h" #include "mozilla/ToString.h"
#include "mozilla/dom/Animation.h" // for ComputedTimingFunction #include "mozilla/dom/Animation.h" // for ComputedTimingFunction
#include "mozilla/gfx/2D.h" // for DrawTarget #include "mozilla/gfx/2D.h" // for DrawTarget
@ -1621,8 +1620,6 @@ void
LayerManager::PostPresent() LayerManager::PostPresent()
{ {
if (!mTabSwitchStart.IsNull()) { if (!mTabSwitchStart.IsNull()) {
Telemetry::Accumulate(Telemetry::FX_TAB_SWITCH_TOTAL_MS,
uint32_t((TimeStamp::Now() - mTabSwitchStart).ToMilliseconds()));
mTabSwitchStart = TimeStamp(); mTabSwitchStart = TimeStamp();
} }
} }

View file

@ -904,9 +904,6 @@ nsEventStatus AsyncPanZoomController::HandleDragEvent(const MouseInput& aEvent,
return nsEventStatus_eConsumeNoDefault; return nsEventStatus_eConsumeNoDefault;
} }
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::ApzScrollbarDrag);
ReentrantMonitorAutoEnter lock(mMonitor); ReentrantMonitorAutoEnter lock(mMonitor);
CSSPoint scrollFramePoint = aEvent.mLocalOrigin / GetFrameMetrics().GetZoom(); CSSPoint scrollFramePoint = aEvent.mLocalOrigin / GetFrameMetrics().GetZoom();
// The scrollbar can be transformed with the frame but the pres shell // The scrollbar can be transformed with the frame but the pres shell
@ -1731,10 +1728,6 @@ nsEventStatus AsyncPanZoomController::OnScrollWheel(const ScrollWheelInput& aEve
return nsEventStatus_eIgnore; return nsEventStatus_eIgnore;
} }
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethodForWheelDeltaType(aEvent.mDeltaType));
switch (aEvent.mScrollMode) { switch (aEvent.mScrollMode) {
case ScrollWheelInput::SCROLLMODE_INSTANT: { case ScrollWheelInput::SCROLLMODE_INSTANT: {
@ -1934,9 +1927,6 @@ nsEventStatus AsyncPanZoomController::OnPan(const PanGestureInput& aEvent, bool
HandlePanningUpdate(physicalPanDisplacement); HandlePanningUpdate(physicalPanDisplacement);
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::ApzPanGesture);
ScreenPoint panDistance(fabs(physicalPanDisplacement.x), fabs(physicalPanDisplacement.y)); ScreenPoint panDistance(fabs(physicalPanDisplacement.x), fabs(physicalPanDisplacement.y));
MOZ_ASSERT(GetCurrentPanGestureBlock()); MOZ_ASSERT(GetCurrentPanGestureBlock());
OverscrollHandoffState handoffState( OverscrollHandoffState handoffState(
@ -2600,8 +2590,6 @@ void AsyncPanZoomController::TrackTouch(const MultiTouchInput& aEvent) {
UpdateWithTouchAtDevicePoint(aEvent); UpdateWithTouchAtDevicePoint(aEvent);
if (prevTouchPoint != touchPoint) { if (prevTouchPoint != touchPoint) {
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::ApzTouch);
MOZ_ASSERT(GetCurrentTouchBlock()); MOZ_ASSERT(GetCurrentTouchBlock());
OverscrollHandoffState handoffState( OverscrollHandoffState handoffState(
*GetCurrentTouchBlock()->GetOverscrollHandoffChain(), *GetCurrentTouchBlock()->GetOverscrollHandoffChain(),
@ -3260,14 +3248,7 @@ AsyncPanZoomController::UpdateCheckerboardEvent(const MutexAutoLock& aProofOfLoc
uint32_t aMagnitude) uint32_t aMagnitude)
{ {
if (mCheckerboardEvent && mCheckerboardEvent->RecordFrameInfo(aMagnitude)) { if (mCheckerboardEvent && mCheckerboardEvent->RecordFrameInfo(aMagnitude)) {
// This checkerboard event is done. Report some metrics to telemetry. // This checkerboard event is done.
mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_SEVERITY,
mCheckerboardEvent->GetSeverity());
mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_PEAK,
mCheckerboardEvent->GetPeak());
mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_DURATION,
(uint32_t)mCheckerboardEvent->GetDuration().ToMilliseconds());
mPotentialCheckerboardTracker.CheckerboardDone(); mPotentialCheckerboardTracker.CheckerboardDone();
if (gfxPrefs::APZRecordCheckerboarding()) { if (gfxPrefs::APZRecordCheckerboarding()) {

View file

@ -10,7 +10,6 @@
#include "gfxPrefs.h" // for gfxPrefs #include "gfxPrefs.h" // for gfxPrefs
#include "mozilla/MouseEvents.h" #include "mozilla/MouseEvents.h"
#include "mozilla/SizePrintfMacros.h" // for PRIuSIZE #include "mozilla/SizePrintfMacros.h" // for PRIuSIZE
#include "mozilla/Telemetry.h" // for Telemetry
#include "mozilla/layers/APZCTreeManager.h" // for AllowedTouchBehavior #include "mozilla/layers/APZCTreeManager.h" // for AllowedTouchBehavior
#include "OverscrollHandoffState.h" #include "OverscrollHandoffState.h"
#include "QueuedInput.h" #include "QueuedInput.h"
@ -246,8 +245,6 @@ CancelableBlockState::RecordContentResponseTime()
// Not done yet, we'll get called again // Not done yet, we'll get called again
return; return;
} }
mozilla::Telemetry::Accumulate(mozilla::Telemetry::CONTENT_RESPONSE_DURATION,
(uint32_t)(TimeStamp::Now() - mContentResponseTimer).ToMilliseconds());
mContentResponseTimer = TimeStamp(); mContentResponseTimer = TimeStamp();
} }

View file

@ -33,9 +33,7 @@ PotentialCheckerboardDurationTracker::CheckerboardDone()
MOZ_ASSERT(Tracking()); MOZ_ASSERT(Tracking());
mInCheckerboard = false; mInCheckerboard = false;
if (!Tracking()) { if (!Tracking()) {
mozilla::Telemetry::AccumulateTimeDelta( /* Telemetry STUB */
mozilla::Telemetry::CHECKERBOARD_POTENTIAL_DURATION,
mCurrentPeriodStart);
} }
} }
@ -63,9 +61,7 @@ PotentialCheckerboardDurationTracker::InTransform(bool aInTransform)
// would have taken the other !Tracking branch above. If it's false now, // would have taken the other !Tracking branch above. If it's false now,
// it means we just stopped tracking, so we are ending a potential // it means we just stopped tracking, so we are ending a potential
// checkerboard period. // checkerboard period.
mozilla::Telemetry::AccumulateTimeDelta( /* Telemetry STUB */
mozilla::Telemetry::CHECKERBOARD_POTENTIAL_DURATION,
mCurrentPeriodStart);
} }
} }

View file

@ -484,8 +484,6 @@ CompositorVsyncScheduler::Composite(TimeStamp aVsyncTimestamp)
mVsyncNotificationsSkipped = 0; mVsyncNotificationsSkipped = 0;
TimeDuration compositeFrameTotal = TimeStamp::Now() - aVsyncTimestamp; TimeDuration compositeFrameTotal = TimeStamp::Now() - aVsyncTimestamp;
mozilla::Telemetry::Accumulate(mozilla::Telemetry::COMPOSITE_FRAME_ROUNDTRIP_TIME,
compositeFrameTotal.ToMilliseconds());
} else if (mVsyncNotificationsSkipped++ > gfxPrefs::CompositorUnobserveCount()) { } else if (mVsyncNotificationsSkipped++ > gfxPrefs::CompositorUnobserveCount()) {
UnobserveVsync(); UnobserveVsync();
} }
@ -1305,7 +1303,6 @@ CompositorBridgeParent::CompositeToTarget(DrawTarget* aTarget, const gfx::IntRec
} }
mCompositor->SetCompositionTime(TimeStamp()); mCompositor->SetCompositionTime(TimeStamp());
mozilla::Telemetry::AccumulateTimeDelta(mozilla::Telemetry::COMPOSITE_TIME, start);
profiler_tracing("Paint", "Composite", TRACING_INTERVAL_END); profiler_tracing("Paint", "Composite", TRACING_INTERVAL_END);
} }
@ -1660,19 +1657,6 @@ CompositorBridgeParent::NewCompositor(const nsTArray<LayersBackend>& aBackendHin
failureReason = "SUCCESS"; failureReason = "SUCCESS";
} }
// should only report success here
if (aBackendHints[i] == LayersBackend::LAYERS_OPENGL){
Telemetry::Accumulate(Telemetry::OPENGL_COMPOSITING_FAILURE_ID, failureReason);
}
#ifdef XP_WIN
else if (aBackendHints[i] == LayersBackend::LAYERS_D3D9){
Telemetry::Accumulate(Telemetry::D3D9_COMPOSITING_FAILURE_ID, failureReason);
}
else if (aBackendHints[i] == LayersBackend::LAYERS_D3D11){
Telemetry::Accumulate(Telemetry::D3D11_COMPOSITING_FAILURE_ID, failureReason);
}
#endif
compositor->SetCompositorID(mCompositorID); compositor->SetCompositorID(mCompositorID);
return compositor; return compositor;
} }
@ -1681,18 +1665,15 @@ CompositorBridgeParent::NewCompositor(const nsTArray<LayersBackend>& aBackendHin
if (aBackendHints[i] == LayersBackend::LAYERS_OPENGL){ if (aBackendHints[i] == LayersBackend::LAYERS_OPENGL){
gfxCriticalNote << "[OPENGL] Failed to init compositor with reason: " gfxCriticalNote << "[OPENGL] Failed to init compositor with reason: "
<< failureReason.get(); << failureReason.get();
Telemetry::Accumulate(Telemetry::OPENGL_COMPOSITING_FAILURE_ID, failureReason);
} }
#ifdef XP_WIN #ifdef XP_WIN
else if (aBackendHints[i] == LayersBackend::LAYERS_D3D9){ else if (aBackendHints[i] == LayersBackend::LAYERS_D3D9){
gfxCriticalNote << "[D3D9] Failed to init compositor with reason: " gfxCriticalNote << "[D3D9] Failed to init compositor with reason: "
<< failureReason.get(); << failureReason.get();
Telemetry::Accumulate(Telemetry::D3D9_COMPOSITING_FAILURE_ID, failureReason);
} }
else if (aBackendHints[i] == LayersBackend::LAYERS_D3D11){ else if (aBackendHints[i] == LayersBackend::LAYERS_D3D11){
gfxCriticalNote << "[D3D11] Failed to init compositor with reason: " gfxCriticalNote << "[D3D11] Failed to init compositor with reason: "
<< failureReason.get(); << failureReason.get();
Telemetry::Accumulate(Telemetry::D3D11_COMPOSITING_FAILURE_ID, failureReason);
} }
#endif #endif
} }

View file

@ -11,7 +11,6 @@
#include "nsString.h" #include "nsString.h"
#include "nsXULAppAPI.h" #include "nsXULAppAPI.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include "mozilla/gfx/Logging.h" #include "mozilla/gfx/Logging.h"
#include "mozilla/dom/ContentChild.h" #include "mozilla/dom/ContentChild.h"
@ -469,20 +468,7 @@ D3D11LayersCrashGuard::LogFeatureDisabled()
void void
D3D11LayersCrashGuard::RecordTelemetry(TelemetryState aState) D3D11LayersCrashGuard::RecordTelemetry(TelemetryState aState)
{ {
// D3D11LayersCrashGuard is a no-op in the child process. /* STUB */
if (!XRE_IsParentProcess()) {
return;
}
// Since we instantiate this class more than once, make sure we only record
// the first state (since that is really all we care about).
static bool sTelemetryStateRecorded = false;
if (sTelemetryStateRecorded) {
return;
}
Telemetry::Accumulate(Telemetry::GRAPHICS_DRIVER_STARTUP_TEST, int32_t(aState));
sTelemetryStateRecorded = true;
} }
D3D9VideoCrashGuard::D3D9VideoCrashGuard(dom::ContentParent* aContentParent) D3D9VideoCrashGuard::D3D9VideoCrashGuard(dom::ContentParent* aContentParent)

View file

@ -10,7 +10,6 @@
#include "gfxPrefs.h" #include "gfxPrefs.h"
#include "gfxWindowsPlatform.h" #include "gfxWindowsPlatform.h"
#include "mozilla/D3DMessageUtils.h" #include "mozilla/D3DMessageUtils.h"
#include "mozilla/Telemetry.h"
#include "mozilla/WindowsVersion.h" #include "mozilla/WindowsVersion.h"
#include "mozilla/gfx/GraphicsMessages.h" #include "mozilla/gfx/GraphicsMessages.h"
#include "mozilla/gfx/Logging.h" #include "mozilla/gfx/Logging.h"
@ -589,10 +588,6 @@ DeviceManagerDx::MaybeResetAndReacquireDevices()
return false; return false;
} }
if (resetReason != DeviceResetReason::FORCED_RESET) {
Telemetry::Accumulate(Telemetry::DEVICE_RESET_REASON, uint32_t(resetReason));
}
bool createCompositorDevice = !!mCompositorDevice; bool createCompositorDevice = !!mCompositorDevice;
bool createContentDevice = !!mContentDevice; bool createContentDevice = !!mContentDevice;
@ -724,7 +719,6 @@ DeviceManagerDx::GetAnyDeviceRemovedReason(DeviceResetReason* aOutReason)
void void
DeviceManagerDx::ForceDeviceReset(ForcedDeviceResetReason aReason) DeviceManagerDx::ForceDeviceReset(ForcedDeviceResetReason aReason)
{ {
Telemetry::Accumulate(Telemetry::FORCED_DEVICE_RESET_REASON, uint32_t(aReason));
{ {
MutexAutoLock lock(mDeviceLock); MutexAutoLock lock(mDeviceLock);
mDeviceResetReason = Some(DeviceResetReason::FORCED_RESET); mDeviceResetReason = Some(DeviceResetReason::FORCED_RESET);

View file

@ -14,7 +14,6 @@
#include "nsCharSeparatedTokenizer.h" #include "nsCharSeparatedTokenizer.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Sprintf.h" #include "mozilla/Sprintf.h"
#include "mozilla/Telemetry.h"
#include "nsDirectoryServiceUtils.h" #include "nsDirectoryServiceUtils.h"
#include "nsDirectoryServiceDefs.h" #include "nsDirectoryServiceDefs.h"
#include "nsAppDirectoryServiceDefs.h" #include "nsAppDirectoryServiceDefs.h"
@ -864,8 +863,6 @@ gfxDWriteFontList::InitFontListForPlatform()
hr = gfxWindowsPlatform::GetPlatform()->GetDWriteFactory()-> hr = gfxWindowsPlatform::GetPlatform()->GetDWriteFactory()->
GetGdiInterop(getter_AddRefs(mGDIInterop)); GetGdiInterop(getter_AddRefs(mGDIInterop));
if (FAILED(hr)) { if (FAILED(hr)) {
Telemetry::Accumulate(Telemetry::DWRITEFONT_INIT_PROBLEM,
uint32_t(errGDIInterop));
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
@ -878,8 +875,6 @@ gfxDWriteFontList::InitFontListForPlatform()
NS_ASSERTION(SUCCEEDED(hr), "GetSystemFontCollection failed!"); NS_ASSERTION(SUCCEEDED(hr), "GetSystemFontCollection failed!");
if (FAILED(hr)) { if (FAILED(hr)) {
Telemetry::Accumulate(Telemetry::DWRITEFONT_INIT_PROBLEM,
uint32_t(errSystemFontCollection));
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
@ -891,8 +886,6 @@ gfxDWriteFontList::InitFontListForPlatform()
NS_ASSERTION(mFontFamilies.Count() != 0, NS_ASSERTION(mFontFamilies.Count() != 0,
"no fonts found in the system fontlist -- holy crap batman!"); "no fonts found in the system fontlist -- holy crap batman!");
if (mFontFamilies.Count() == 0) { if (mFontFamilies.Count() == 0) {
Telemetry::Accumulate(Telemetry::DWRITEFONT_INIT_PROBLEM,
uint32_t(errNoFonts));
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
@ -1001,9 +994,6 @@ gfxDWriteFontList::InitFontListForPlatform()
} }
elapsedTime = (t5.QuadPart - t1.QuadPart) * 1000.0 / frequency.QuadPart; elapsedTime = (t5.QuadPart - t1.QuadPart) * 1000.0 / frequency.QuadPart;
Telemetry::Accumulate(Telemetry::DWRITEFONT_DELAYEDINITFONTLIST_TOTAL, elapsedTime);
Telemetry::Accumulate(Telemetry::DWRITEFONT_DELAYEDINITFONTLIST_COUNT,
mSystemFonts->GetFontFamilyCount());
LOG_FONTINIT(( LOG_FONTINIT((
"(fontinit) Total time in InitFontList: %9.3f ms (families: %d, %s)\n", "(fontinit) Total time in InitFontList: %9.3f ms (families: %d, %s)\n",
elapsedTime, mSystemFonts->GetFontFamilyCount(), elapsedTime, mSystemFonts->GetFontFamilyCount(),
@ -1013,7 +1003,6 @@ gfxDWriteFontList::InitFontListForPlatform()
LOG_FONTINIT(("(fontinit) --- base/interop obj initialization init: %9.3f ms\n", elapsedTime)); LOG_FONTINIT(("(fontinit) --- base/interop obj initialization init: %9.3f ms\n", elapsedTime));
elapsedTime = (t3.QuadPart - t2.QuadPart) * 1000.0 / frequency.QuadPart; elapsedTime = (t3.QuadPart - t2.QuadPart) * 1000.0 / frequency.QuadPart;
Telemetry::Accumulate(Telemetry::DWRITEFONT_DELAYEDINITFONTLIST_COLLECT, elapsedTime);
LOG_FONTINIT(("(fontinit) --- GetSystemFontCollection: %9.3f ms\n", elapsedTime)); LOG_FONTINIT(("(fontinit) --- GetSystemFontCollection: %9.3f ms\n", elapsedTime));
elapsedTime = (t4.QuadPart - t3.QuadPart) * 1000.0 / frequency.QuadPart; elapsedTime = (t4.QuadPart - t3.QuadPart) * 1000.0 / frequency.QuadPart;
@ -1455,7 +1444,6 @@ gfxDWriteFontList::PlatformGlobalFontFallback(const uint32_t aCh,
*aMatchedFamily = family; *aMatchedFamily = family;
return fontEntry; return fontEntry;
} }
Telemetry::Accumulate(Telemetry::BAD_FALLBACK_FONT, true);
} }
return nullptr; return nullptr;

View file

@ -229,7 +229,6 @@ gfxFontCache::Lookup(const gfxFontEntry* aFontEntry,
Key key(aFontEntry, aStyle, aUnicodeRangeMap); Key key(aFontEntry, aStyle, aUnicodeRangeMap);
HashEntry *entry = mFonts.GetEntry(key); HashEntry *entry = mFonts.GetEntry(key);
Telemetry::Accumulate(Telemetry::FONT_CACHE_HIT, entry != nullptr);
if (!entry) if (!entry)
return nullptr; return nullptr;
@ -2578,9 +2577,6 @@ gfxFont::GetShapedWord(DrawTarget *aDrawTarget,
if (sw) { if (sw) {
sw->ResetAge(); sw->ResetAge();
Telemetry::Accumulate((isContent ? Telemetry::WORD_CACHE_HITS_CONTENT :
Telemetry::WORD_CACHE_HITS_CHROME),
aLength);
#ifndef RELEASE_OR_BETA #ifndef RELEASE_OR_BETA
if (aTextPerf) { if (aTextPerf) {
aTextPerf->current.wordCacheHit++; aTextPerf->current.wordCacheHit++;
@ -2589,9 +2585,6 @@ gfxFont::GetShapedWord(DrawTarget *aDrawTarget,
return sw; return sw;
} }
Telemetry::Accumulate((isContent ? Telemetry::WORD_CACHE_MISSES_CONTENT :
Telemetry::WORD_CACHE_MISSES_CHROME),
aLength);
#ifndef RELEASE_OR_BETA #ifndef RELEASE_OR_BETA
if (aTextPerf) { if (aTextPerf) {
aTextPerf->current.wordCacheMiss++; aTextPerf->current.wordCacheMiss++;

View file

@ -8,7 +8,6 @@
#include "PLDHashTable.h" #include "PLDHashTable.h"
#include "nsExpirationTracker.h" #include "nsExpirationTracker.h"
#include "nsClassHashtable.h" #include "nsClassHashtable.h"
#include "mozilla/Telemetry.h"
#include "gfxGradientCache.h" #include "gfxGradientCache.h"
#include <time.h> #include <time.h>
@ -127,7 +126,6 @@ class GradientCache final : public nsExpirationTracker<GradientCacheData,4>
{ {
srand(time(nullptr)); srand(time(nullptr));
mTimerPeriod = rand() % MAX_GENERATION_MS + 1; mTimerPeriod = rand() % MAX_GENERATION_MS + 1;
Telemetry::Accumulate(Telemetry::GRADIENT_RETENTION_TIME, mTimerPeriod);
} }
virtual void NotifyExpired(GradientCacheData* aObject) virtual void NotifyExpired(GradientCacheData* aObject)

View file

@ -65,7 +65,6 @@
#include "mozilla/MemoryReporting.h" #include "mozilla/MemoryReporting.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Sprintf.h" #include "mozilla/Sprintf.h"
#include "mozilla/Telemetry.h"
#include "mozilla/gfx/2D.h" #include "mozilla/gfx/2D.h"
#include <unistd.h> #include <unistd.h>
@ -1043,10 +1042,6 @@ gfxMacPlatformFontList::PlatformGlobalFontFallback(const uint32_t aCh,
} }
} }
if (cantUseFallbackFont) {
Telemetry::Accumulate(Telemetry::BAD_FALLBACK_FONT, cantUseFallbackFont);
}
::CFRelease(str); ::CFRelease(str);
return fontEntry; return fontEntry;

View file

@ -361,7 +361,6 @@ class CrashTelemetryEvent : public Runnable
NS_IMETHOD Run() override { NS_IMETHOD Run() override {
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
Telemetry::Accumulate(Telemetry::GFX_CRASH, mReason);
return NS_OK; return NS_OK;
} }
@ -374,29 +373,7 @@ NS_IMPL_ISUPPORTS_INHERITED0(CrashTelemetryEvent, Runnable);
void void
CrashStatsLogForwarder::CrashAction(LogReason aReason) CrashStatsLogForwarder::CrashAction(LogReason aReason)
{ {
#ifndef RELEASE_OR_BETA MOZ_CRASH("GFX_CRASH");
// Non-release builds crash by default, but will use telemetry
// if this environment variable is present.
static bool useTelemetry = gfxEnv::GfxDevCrashTelemetry();
#else
// Release builds use telemetry by default, but will crash instead
// if this environment variable is present.
static bool useTelemetry = !gfxEnv::GfxDevCrashMozCrash();
#endif
if (useTelemetry) {
// The callers need to assure that aReason is in the range
// that the telemetry call below supports.
if (NS_IsMainThread()) {
Telemetry::Accumulate(Telemetry::GFX_CRASH, (uint32_t)aReason);
} else {
nsCOMPtr<nsIRunnable> r1 = new CrashTelemetryEvent((uint32_t)aReason);
NS_DispatchToMainThread(r1);
}
} else {
// ignoring aReason, we can get the information we need from the stack
MOZ_CRASH("GFX_CRASH");
}
} }
NS_IMPL_ISUPPORTS(SRGBOverrideObserver, nsIObserver, nsISupportsWeakReference) NS_IMPL_ISUPPORTS(SRGBOverrideObserver, nsIObserver, nsISupportsWeakReference)

View file

@ -322,8 +322,6 @@ gfxPlatformFontList::InitOtherFamilyNames()
mOtherFamilyNamesInitialized = true; mOtherFamilyNamesInitialized = true;
} }
TimeStamp end = TimeStamp::Now(); TimeStamp end = TimeStamp::Now();
Telemetry::AccumulateTimeDelta(Telemetry::FONTLIST_INITOTHERFAMILYNAMES,
start, end);
if (LOG_FONTINIT_ENABLED()) { if (LOG_FONTINIT_ENABLED()) {
TimeDuration elapsed = end - start; TimeDuration elapsed = end - start;
@ -370,8 +368,6 @@ gfxPlatformFontList::SearchFamiliesForFaceName(const nsAString& aFaceName)
lookup = FindFaceName(aFaceName); lookup = FindFaceName(aFaceName);
TimeStamp end = TimeStamp::Now(); TimeStamp end = TimeStamp::Now();
Telemetry::AccumulateTimeDelta(Telemetry::FONTLIST_INITFACENAMELISTS,
start, end);
if (LOG_FONTINIT_ENABLED()) { if (LOG_FONTINIT_ENABLED()) {
TimeDuration elapsed = end - start; TimeDuration elapsed = end - start;
LOG_FONTINIT(("(fontinit) SearchFamiliesForFaceName took %8.2f ms %s %s", LOG_FONTINIT(("(fontinit) SearchFamiliesForFaceName took %8.2f ms %s %s",
@ -587,16 +583,8 @@ gfxPlatformFontList::SystemFindFontForChar(uint32_t aCh, uint32_t aNextCh,
static bool first = true; static bool first = true;
int32_t intElapsed = int32_t(first ? elapsed.ToMilliseconds() : int32_t intElapsed = int32_t(first ? elapsed.ToMilliseconds() :
elapsed.ToMicroseconds()); elapsed.ToMicroseconds());
Telemetry::Accumulate((first ? Telemetry::SYSTEM_FONT_FALLBACK_FIRST :
Telemetry::SYSTEM_FONT_FALLBACK),
intElapsed);
first = false; first = false;
// track the script for which fallback occurred (incremented one make it
// 1-based)
Telemetry::Accumulate(Telemetry::SYSTEM_FONT_FALLBACK_SCRIPT,
int(aRunScript) + 1);
return fontEntry; return fontEntry;
} }

View file

@ -453,8 +453,6 @@ gfxUserFontEntry::LoadNextSrc()
gfxUserFontData::kUnknownCompression); gfxUserFontData::kUnknownCompression);
mPlatformFontEntry = fe; mPlatformFontEntry = fe;
SetLoadState(STATUS_LOADED); SetLoadState(STATUS_LOADED);
Telemetry::Accumulate(Telemetry::WEBFONT_SRCTYPE,
currSrc.mSourceType + 1);
return; return;
} else { } else {
LOG(("userfonts (%p) [src %d] failed local: (%s) for (%s)\n", LOG(("userfonts (%p) [src %d] failed local: (%s) for (%s)\n",
@ -517,8 +515,6 @@ gfxUserFontEntry::LoadNextSrc()
if (NS_SUCCEEDED(rv) && if (NS_SUCCEEDED(rv) &&
LoadPlatformFont(buffer, bufferLength)) { LoadPlatformFont(buffer, bufferLength)) {
SetLoadState(STATUS_LOADED); SetLoadState(STATUS_LOADED);
Telemetry::Accumulate(Telemetry::WEBFONT_SRCTYPE,
currSrc.mSourceType + 1);
return; return;
} else { } else {
mFontSet->LogMessage(this, mFontSet->LogMessage(this,
@ -572,8 +568,6 @@ gfxUserFontEntry::LoadNextSrc()
// LoadPlatformFont takes ownership of the buffer, so no need // LoadPlatformFont takes ownership of the buffer, so no need
// to free it here. // to free it here.
SetLoadState(STATUS_LOADED); SetLoadState(STATUS_LOADED);
Telemetry::Accumulate(Telemetry::WEBFONT_SRCTYPE,
currSrc.mSourceType + 1);
return; return;
} else { } else {
mFontSet->LogMessage(this, mFontSet->LogMessage(this,
@ -617,7 +611,6 @@ gfxUserFontEntry::LoadPlatformFont(const uint8_t* aFontData, uint32_t& aLength)
gfxUserFontType fontType = gfxUserFontType fontType =
gfxFontUtils::DetermineFontDataType(aFontData, aLength); gfxFontUtils::DetermineFontDataType(aFontData, aLength);
Telemetry::Accumulate(Telemetry::WEBFONT_FONTTYPE, uint32_t(fontType));
// Unwrap/decompress/sanitize or otherwise munge the downloaded data // Unwrap/decompress/sanitize or otherwise munge the downloaded data
// to make a usable sfnt structure. // to make a usable sfnt structure.
@ -650,13 +643,6 @@ gfxUserFontEntry::LoadPlatformFont(const uint8_t* aFontData, uint32_t& aLength)
if (saneData) { if (saneData) {
if (saneLen) { if (saneLen) {
fontCompressionRatio = uint32_t(100.0 * aLength / saneLen + 0.5); fontCompressionRatio = uint32_t(100.0 * aLength / saneLen + 0.5);
if (fontType == GFX_USERFONT_WOFF ||
fontType == GFX_USERFONT_WOFF2) {
Telemetry::Accumulate(fontType == GFX_USERFONT_WOFF ?
Telemetry::WEBFONT_COMPRESSION_WOFF :
Telemetry::WEBFONT_COMPRESSION_WOFF2,
fontCompressionRatio);
}
} }
// The sanitizer ensures that we have a valid sfnt and a usable // The sanitizer ensures that we have a valid sfnt and a usable

View file

@ -444,10 +444,6 @@ gfxWindowsPlatform::HandleDeviceReset()
return false; return false;
} }
if (resetReason != DeviceResetReason::FORCED_RESET) {
Telemetry::Accumulate(Telemetry::DEVICE_RESET_REASON, uint32_t(resetReason));
}
// Remove devices and adapters. // Remove devices and adapters.
DeviceManagerDx::Get()->ResetDevices(); DeviceManagerDx::Get()->ResetDevices();
@ -1487,15 +1483,7 @@ gfxWindowsPlatform::InitializeD3D11Config()
/* static */ void /* static */ void
gfxWindowsPlatform::RecordContentDeviceFailure(TelemetryDeviceCode aDevice) gfxWindowsPlatform::RecordContentDeviceFailure(TelemetryDeviceCode aDevice)
{ {
// If the parent process fails to acquire a device, we record this /* STUB */
// normally as part of the environment. The exceptional case we're
// looking for here is when the parent process successfully acquires
// a device, but the content process fails to acquire the same device.
// This would not normally be displayed in about:support.
if (!XRE_IsContentProcess()) {
return;
}
Telemetry::Accumulate(Telemetry::GFX_CONTENT_FAILED_TO_ACQUIRE_DEVICE, uint32_t(aDevice));
} }
void void

View file

@ -39,8 +39,8 @@
#include "mozilla/MemoryReporting.h" #include "mozilla/MemoryReporting.h"
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include <stdint.h> #include <stdint.h>
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h" #include "mozilla/TimeStamp.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Tuple.h" #include "mozilla/Tuple.h"
#include "mozilla/ClearOnShutdown.h" #include "mozilla/ClearOnShutdown.h"
#include "mozilla/gfx/Scale.h" #include "mozilla/gfx/Scale.h"
@ -104,9 +104,6 @@ RasterImage::~RasterImage()
// Release all frames from the surface cache. // Release all frames from the surface cache.
SurfaceCache::RemoveImage(ImageKey(this)); SurfaceCache::RemoveImage(ImageKey(this));
// Record Telemetry.
Telemetry::Accumulate(Telemetry::IMAGE_DECODE_COUNT, mDecodeCount);
} }
nsresult nsresult
@ -1365,19 +1362,9 @@ RasterImage::Draw(gfxContext* aContext,
return DrawResult::NOT_READY; return DrawResult::NOT_READY;
} }
bool shouldRecordTelemetry = !mDrawStartTime.IsNull() &&
surface->IsFinished();
auto result = DrawInternal(Move(surface), aContext, aSize, auto result = DrawInternal(Move(surface), aContext, aSize,
aRegion, aSamplingFilter, flags); aRegion, aSamplingFilter, flags);
if (shouldRecordTelemetry) {
TimeDuration drawLatency = TimeStamp::Now() - mDrawStartTime;
Telemetry::Accumulate(Telemetry::IMAGE_DECODE_ON_DRAW_LATENCY,
int32_t(drawLatency.ToMicroseconds()));
mDrawStartTime = TimeStamp();
}
return result; return result;
} }
@ -1614,22 +1601,6 @@ RasterImage::NotifyDecodeComplete(const DecoderFinalStatus& aStatus,
mAnimationState->SetDoneDecoding(true); mAnimationState->SetDoneDecoding(true);
} }
// Do some telemetry if this isn't a metadata decode.
if (!aStatus.mWasMetadataDecode) {
if (aTelemetry.mChunkCount) {
Telemetry::Accumulate(Telemetry::IMAGE_DECODE_CHUNKS, aTelemetry.mChunkCount);
}
if (aStatus.mFinished) {
Telemetry::Accumulate(Telemetry::IMAGE_DECODE_TIME,
int32_t(aTelemetry.mDecodeTime.ToMicroseconds()));
if (aTelemetry.mSpeedHistogram) {
Telemetry::Accumulate(*aTelemetry.mSpeedHistogram, aTelemetry.Speed());
}
}
}
// Only act on errors if we have no usable frames from the decoder. // Only act on errors if we have no usable frames from the decoder.
if (aStatus.mHadError && if (aStatus.mHadError &&
(!mAnimationState || mAnimationState->KnownFrameCount() == 0)) { (!mAnimationState || mAnimationState->KnownFrameCount() == 0)) {

View file

@ -22,7 +22,6 @@
#include "mozilla/gfx/Tools.h" #include "mozilla/gfx/Tools.h"
#include "mozilla/Likely.h" #include "mozilla/Likely.h"
#include "mozilla/MemoryReporting.h" #include "mozilla/MemoryReporting.h"
#include "mozilla/Telemetry.h"
#include "nsMargin.h" #include "nsMargin.h"
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
@ -620,8 +619,6 @@ imgFrame::Finish(Opacity aFrameOpacity /* = Opacity::SOME_TRANSPARENCY */,
if (aFrameOpacity == Opacity::FULLY_OPAQUE) { if (aFrameOpacity == Opacity::FULLY_OPAQUE) {
mHasNoAlpha = true; mHasNoAlpha = true;
Telemetry::Accumulate(Telemetry::IMAGE_DECODE_OPAQUE_BGRA,
mFormat == SurfaceFormat::B8G8R8A8);
} }
mDisposalMethod = aDisposalMethod; mDisposalMethod = aDisposalMethod;

View file

@ -83,8 +83,6 @@ public:
mGB2312Decoder = nullptr; mGB2312Decoder = nullptr;
mEUCKRDecoder = nullptr; mEUCKRDecoder = nullptr;
mISO88597Decoder = nullptr; mISO88597Decoder = nullptr;
mozilla::Telemetry::Accumulate(
mozilla::Telemetry::DECODER_INSTANTIATED_ISO2022JP, true);
} }
virtual ~nsISO2022JPToUnicodeV2() virtual ~nsISO2022JPToUnicodeV2()
{ {

View file

@ -20,7 +20,6 @@ nsCP866ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "cp866.ut" #include "cp866.ut"
}; };
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_IBM866, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable, return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult); aOuter, aIID, aResult);
} }

View file

@ -20,7 +20,6 @@ nsISO88595ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "8859-5.ut" #include "8859-5.ut"
}; };
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_ISO_8859_5, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable, return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult); aOuter, aIID, aResult);
} }

View file

@ -5,7 +5,6 @@
#include "nsUCConstructors.h" #include "nsUCConstructors.h"
#include "nsKOI8RToUnicode.h" #include "nsKOI8RToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla; using namespace mozilla;
@ -20,7 +19,6 @@ nsKOI8RToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "koi8r.ut" #include "koi8r.ut"
}; };
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_KOI8R, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable, return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult); aOuter, aIID, aResult);
} }

View file

@ -20,7 +20,6 @@ nsKOI8UToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "koi8u.ut" #include "koi8u.ut"
}; };
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_KOI8U, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable, return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult); aOuter, aIID, aResult);
} }

View file

@ -5,7 +5,6 @@
#include "nsUCConstructors.h" #include "nsUCConstructors.h"
#include "nsMacArabicToUnicode.h" #include "nsMacArabicToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla; using namespace mozilla;
@ -20,7 +19,6 @@ nsMacArabicToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "macarabic.ut" #include "macarabic.ut"
}; };
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACARABIC, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable, return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult); aOuter, aIID, aResult);
} }

View file

@ -20,7 +20,6 @@ nsMacCEToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "macce.ut" #include "macce.ut"
}; };
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACCE, true);
return CreateOneByteDecoder((uMappingTable*) &g_MacCEMappingTable, return CreateOneByteDecoder((uMappingTable*) &g_MacCEMappingTable,
aOuter, aIID, aResult); aOuter, aIID, aResult);
} }

View file

@ -5,7 +5,6 @@
#include "nsUCConstructors.h" #include "nsUCConstructors.h"
#include "nsMacCroatianToUnicode.h" #include "nsMacCroatianToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla; using namespace mozilla;
@ -20,7 +19,6 @@ nsMacCroatianToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "maccroat.ut" #include "maccroat.ut"
}; };
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACCROATIAN, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable, return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult); aOuter, aIID, aResult);
} }

View file

@ -5,7 +5,6 @@
#include "nsUCConstructors.h" #include "nsUCConstructors.h"
#include "nsMacCyrillicToUnicode.h" #include "nsMacCyrillicToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla; using namespace mozilla;
@ -20,7 +19,6 @@ nsMacCyrillicToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "maccyril.ut" #include "maccyril.ut"
}; };
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACCYRILLIC, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable, return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult); aOuter, aIID, aResult);
} }

View file

@ -5,7 +5,6 @@
#include "nsUCConstructors.h" #include "nsUCConstructors.h"
#include "nsMacDevanagariToUnicode.h" #include "nsMacDevanagariToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla; using namespace mozilla;
@ -20,7 +19,6 @@ nsMacDevanagariToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "macdevanaga.ut" #include "macdevanaga.ut"
}; };
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACDEVANAGARI, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable, return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult); aOuter, aIID, aResult);
} }

View file

@ -5,7 +5,6 @@
#include "nsUCConstructors.h" #include "nsUCConstructors.h"
#include "nsMacFarsiToUnicode.h" #include "nsMacFarsiToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla; using namespace mozilla;
@ -20,7 +19,6 @@ nsMacFarsiToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "macfarsi.ut" #include "macfarsi.ut"
}; };
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACFARSI, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable, return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult); aOuter, aIID, aResult);
} }

View file

@ -5,7 +5,6 @@
#include "nsUCConstructors.h" #include "nsUCConstructors.h"
#include "nsMacGreekToUnicode.h" #include "nsMacGreekToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla; using namespace mozilla;
@ -20,7 +19,6 @@ nsMacGreekToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "macgreek.ut" #include "macgreek.ut"
}; };
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACGREEK, true);
return CreateOneByteDecoder((uMappingTable*) &g_MacGreekMappingTable, return CreateOneByteDecoder((uMappingTable*) &g_MacGreekMappingTable,
aOuter, aIID, aResult); aOuter, aIID, aResult);
} }

View file

@ -17,7 +17,6 @@ nsMacGujaratiToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "macgujarati.ut" #include "macgujarati.ut"
}; };
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACGUJARATI, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable, return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult); aOuter, aIID, aResult);
} }

View file

@ -5,7 +5,6 @@
#include "nsUCConstructors.h" #include "nsUCConstructors.h"
#include "nsMacGurmukhiToUnicode.h" #include "nsMacGurmukhiToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla; using namespace mozilla;
@ -20,7 +19,6 @@ nsMacGurmukhiToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "macgurmukhi.ut" #include "macgurmukhi.ut"
}; };
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACGURMUKHI, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable, return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult); aOuter, aIID, aResult);
} }

View file

@ -5,7 +5,6 @@
#include "nsUCConstructors.h" #include "nsUCConstructors.h"
#include "nsMacHebrewToUnicode.h" #include "nsMacHebrewToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla; using namespace mozilla;
@ -20,7 +19,6 @@ nsMacHebrewToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "machebrew.ut" #include "machebrew.ut"
}; };
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACHEBREW, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable, return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult); aOuter, aIID, aResult);
} }

View file

@ -5,7 +5,6 @@
#include "nsUCConstructors.h" #include "nsUCConstructors.h"
#include "nsMacIcelandicToUnicode.h" #include "nsMacIcelandicToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla; using namespace mozilla;
@ -20,7 +19,6 @@ nsMacIcelandicToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "macicela.ut" #include "macicela.ut"
}; };
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACICELANDIC, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable, return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult); aOuter, aIID, aResult);
} }

Some files were not shown because too many files have changed in this diff Show more