Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2022-04-28 10:45:19 +08:00
commit 6de07653b9
368 changed files with 144 additions and 46366 deletions

View file

@ -12,7 +12,6 @@
#include "mozilla/dom/TabChild.h"
#include "mozilla/dom/Element.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
using namespace mozilla::a11y;

View file

@ -72,13 +72,6 @@ crashreporter
Always defined.
datareporting
Whether data reporting (MOZ_DATA_REPORTING) is enabled for this build.
Values are ``true`` and ``false``.
Always defined.
debug
Whether this is a debug build.
@ -86,13 +79,6 @@ debug
Always defined.
healthreport
Whether the Health Report feature is enabled.
Values are ``true`` and ``false``.
Always defined.
mozconfig
The path of the :ref:`mozconfig file <mozconfig>` used to produce this build.

View file

@ -40,7 +40,6 @@
fun:malloc
fun:moz_xmalloc
fun:operator new
fun:_Z21XRE_CreateStatsObjectv
...
}

View file

@ -180,13 +180,10 @@ function loadSourceText(source) {
[PROMISE]: Task.spawn(function* () {
let transportType = gClient.localTransport ? "_LOCAL" : "_REMOTE";
let histogramId = "DEVTOOLS_DEBUGGER_DISPLAY_SOURCE" + transportType + "_MS";
let histogram = Services.telemetry.getHistogramById(histogramId);
let startTime = Date.now();
const response = yield sourceClient.source();
histogram.add(Date.now() - startTime);
// Automatically pretty print if enabled and the test is
// detected to be "minified"
if (Prefs.autoPrettyPrint &&

View file

@ -11474,7 +11474,6 @@ var Debugger =
if (telemetry) {
var transportType = this._transport.onOutputStreamReady === undefined ? "LOCAL_" : "REMOTE_";
var histogramId = "DEVTOOLS_DEBUGGER_RDP_" + transportType + telemetry + "_MS";
histogram = Services.telemetry.getHistogramById(histogramId);
startTime = +new Date();
}
var outgoingPacket = {
@ -11513,10 +11512,6 @@ var Debugger =
if (thisCallback) {
thisCallback(aResponse);
}
if (histogram) {
histogram.add(+new Date() - startTime);
}
}, "DebuggerClient.requester request callback"));
}, "DebuggerClient.requester");
};

View file

@ -8,14 +8,7 @@ const {SIDE, BOTTOM, WINDOW} = Toolbox.HostType;
const URL = "data:text/html;charset=utf8,browser_toolbox_hosts_telemetry.js";
function getHostHistogram() {
return Services.telemetry.getHistogramById("DEVTOOLS_TOOLBOX_HOST");
}
add_task(function* () {
// Reset it to make counting easier
getHostHistogram().clear();
info("Create a test tab and open the toolbox");
let tab = yield addTab(URL);
let target = TargetFactory.forTab(tab);
@ -27,9 +20,6 @@ add_task(function* () {
toolbox = target = null;
gBrowser.removeCurrentTab();
// Cleanup
getHostHistogram().clear();
});
function* changeToolboxHost(toolbox) {
@ -43,8 +33,5 @@ function* changeToolboxHost(toolbox) {
}
function checkResults() {
let counts = getHostHistogram().snapshot().counts;
is(counts[0], 3, "Toolbox HostType bottom has 3 successful entries");
is(counts[1], 2, "Toolbox HostType side has 2 successful entries");
is(counts[2], 2, "Toolbox HostType window has 2 successful entries");
// STUB
}

View file

@ -13,18 +13,12 @@ const { makeInfallible, immutableUpdate } = require("devtools/shared/DevToolsUti
const { labelDisplays, treeMapDisplays, censusDisplays } = require("./constants");
exports.countTakeSnapshot = makeInfallible(function () {
const histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_TAKE_SNAPSHOT_COUNT");
histogram.add(1);
}, "devtools/client/memory/telemetry#countTakeSnapshot");
exports.countImportSnapshot = makeInfallible(function () {
const histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_IMPORT_SNAPSHOT_COUNT");
histogram.add(1);
}, "devtools/client/memory/telemetry#countImportSnapshot");
exports.countExportSnapshot = makeInfallible(function () {
const histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_EXPORT_SNAPSHOT_COUNT");
histogram.add(1);
}, "devtools/client/memory/telemetry#countExportSnapshot");
const COARSE_TYPE = "Coarse Type";
@ -43,25 +37,6 @@ const CUSTOM = "Custom";
* The display used with the census.
*/
exports.countCensus = makeInfallible(function ({ filter, diffing, display }) {
let histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_INVERTED_CENSUS");
histogram.add(!!display.inverted);
histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_FILTER_CENSUS");
histogram.add(!!filter);
histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_DIFF_CENSUS");
histogram.add(!!diffing);
histogram = telemetry.getKeyedHistogramById("DEVTOOLS_MEMORY_BREAKDOWN_CENSUS_COUNT");
if (display === censusDisplays.coarseType) {
histogram.add(COARSE_TYPE);
} else if (display === censusDisplays.allocationStack) {
histogram.add(ALLOCATION_STACK);
} else if (display === censusDisplays.invertedAllocationStack) {
histogram.add(INVERTED_ALLOCATION_STACK);
} else {
histogram.add(CUSTOM);
}
}, "devtools/client/memory/telemetry#countCensus");
/**
@ -77,15 +52,4 @@ exports.countDiff = makeInfallible(function (opts) {
* The display used to label nodes in the dominator tree.
*/
exports.countDominatorTree = makeInfallible(function ({ display }) {
let histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_DOMINATOR_TREE_COUNT");
histogram.add(1);
histogram = telemetry.getKeyedHistogramById("DEVTOOLS_MEMORY_BREAKDOWN_DOMINATOR_TREE_COUNT");
if (display === labelDisplays.coarseType) {
histogram.add(COARSE_TYPE);
} else if (display === labelDisplays.allocationStack) {
histogram.add(ALLOCATION_STACK);
} else {
histogram.add(CUSTOM);
}
}, "devtools/client/memory/telemetry#countDominatorTree");

View file

@ -502,7 +502,7 @@ const Services = {
return window.navigator.appVersion;
},
// This is only used by telemetry, which is disabled for the
// This was only used by telemetry, which is disabled for the
// content case. So, being totally wrong is ok.
get is64Bit() {
return true;

View file

@ -283,15 +283,7 @@ Telemetry.prototype = {
* Value to store.
*/
log: function (histogramId, value) {
if (histogramId) {
try {
let histogram = Services.telemetry.getHistogramById(histogramId);
histogram.add(value);
} catch (e) {
dump("Warning: An attempt was made to write to the " + histogramId +
" histogram, which is not defined in Histograms.json\n");
}
}
/* STUB */
},
/**
@ -305,15 +297,7 @@ Telemetry.prototype = {
* Value to store.
*/
logKeyed: function (histogramId, key, value) {
if (histogramId) {
try {
let histogram = Services.telemetry.getKeyedHistogramById(histogramId);
histogram.add(key, value);
} catch (e) {
dump("Warning: An attempt was made to write to the " + histogramId +
" histogram, which is not defined in Histograms.json\n");
}
}
/* STUB */
},
/**

View file

@ -135,10 +135,6 @@ static RedirEntry kRedirMap[] = {
{
"support", "chrome://global/content/aboutSupport.xhtml",
nsIAboutModule::ALLOW_SCRIPT
},
{
"telemetry", "chrome://global/content/aboutTelemetry.xhtml",
nsIAboutModule::ALLOW_SCRIPT
#ifdef MOZ_WEBRTC
},
{

View file

@ -129,9 +129,6 @@ private:
*
* File blobs are copies of the underlying data string since we cannot adopt
* char* chunks embedded within the larger body without significant effort.
* FIXME(nsm): Bug 1127552 - We should add telemetry to calls to formData() and
* friends to figure out if Fetch ends up copying big blobs to see if this is
* worth optimizing.
*/
class MOZ_STACK_CLASS FormDataParser
{

View file

@ -4,7 +4,6 @@
#include "mozilla/dom/DocGroup.h"
#include "mozilla/dom/TabGroup.h"
#include "mozilla/Telemetry.h"
#include "nsIURI.h"
#include "nsIEffectiveTLDService.h"
#include "mozilla/StaticPtr.h"

View file

@ -127,7 +127,6 @@
#include "nsWrapperCacheInlines.h"
#include "xpcpublic.h"
#include "nsIScriptError.h"
#include "mozilla/Telemetry.h"
#include "mozilla/CORSMode.h"
#include "mozilla/dom/ShadowRoot.h"

View file

@ -117,7 +117,6 @@
#include "nsCycleCollector.h"
#include "xpcpublic.h"
#include "nsIScriptError.h"
#include "mozilla/Telemetry.h"
#include "mozilla/CORSMode.h"

View file

@ -28,7 +28,6 @@
#include "nsContentUtils.h"
#include "nsUnicharUtils.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#ifdef MOZ_GAMEPAD
#include "mozilla/dom/GamepadServiceTest.h"
#endif
@ -1629,9 +1628,7 @@ Navigator::RequestMediaKeySystemAccess(const nsAString& aKeySystem,
nsCOMPtr<nsIGlobalObject> go = do_QueryInterface(mWindow);
RefPtr<DetailedPromise> promise =
DetailedPromise::Create(go, aRv,
NS_LITERAL_CSTRING("navigator.requestMediaKeySystemAccess"),
Telemetry::VIDEO_EME_REQUEST_SUCCESS_LATENCY_MS,
Telemetry::VIDEO_EME_REQUEST_FAILURE_LATENCY_MS);
NS_LITERAL_CSTRING("navigator.requestMediaKeySystemAccess"));
if (aRv.Failed()) {
return nullptr;
}

View file

@ -8,7 +8,6 @@
#include "mozilla/dom/DocGroup.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/Telemetry.h"
#include "mozilla/ThrottledEventQueue.h"
#include "nsIDocShell.h"
#include "nsIEffectiveTLDService.h"

View file

@ -1,36 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef UseCounter_h_
#define UseCounter_h_
#include <stdint.h>
namespace mozilla {
enum UseCounter : int16_t {
eUseCounter_UNKNOWN = -1,
#define USE_COUNTER_DOM_METHOD(interface_, name_) \
eUseCounter_##interface_##_##name_,
#define USE_COUNTER_DOM_ATTRIBUTE(interface_, name_) \
eUseCounter_##interface_##_##name_##_getter, \
eUseCounter_##interface_##_##name_##_setter,
#define USE_COUNTER_CSS_PROPERTY(name_, id_) \
eUseCounter_property_##id_,
#include "mozilla/dom/UseCounterList.h"
#undef USE_COUNTER_DOM_METHOD
#undef USE_COUNTER_DOM_ATTRIBUTE
#undef USE_COUNTER_CSS_PROPERTY
#define DEPRECATED_OPERATION(op_) \
eUseCounter_##op_,
#include "nsDeprecatedOperationList.h"
#undef DEPRECATED_OPERATION
eUseCounter_Count
};
}
#endif

View file

@ -1,63 +0,0 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
// This file defines a list of use counters, which are things that can
// record usage of Web platform features and then report this information
// through Telemetry.
//
// The format of this file is very strict. Each line can be:
//
// (a) a blank line
//
// (b) a comment, which is a line that begins with "//"
//
// (c) one of three possible use counter declarations:
//
// method <IDL interface name>.<IDL operation name>
// attribute <IDL interface name>.<IDL attribute name>
// property <CSS property method name>
//
// The |CSS property method name| should be identical to the |method|
// argument to CSS_PROP and related macros. The method name is
// identical to the name of the property, except that all hyphens are
// removed and CamelCase naming is used. See nsCSSPropList.h for
// further details.
//
// To actually cause use counters to be incremented, DOM methods
// and attributes must have a [UseCounter] extended attribute in
// the Web IDL file. CSS properties require no special treatment
// beyond being listed below.
//
// You might reasonably ask why we have this file and we require
// annotating things with [UseCounter] in the relevant WebIDL file as
// well. Generating things from bindings codegen and ensuring all the
// dependencies were correct would have been rather difficult, and
// annotating the WebIDL files does nothing for identifying CSS
// property usage, which we would also like to track.
method SVGSVGElement.getElementById
attribute SVGSVGElement.currentScale
property Fill
property FillOpacity
// Push API
method PushManager.subscribe
method PushSubscription.unsubscribe
// window.sidebar.addSearchEngine
attribute Window.sidebar
method External.addSearchEngine
// AppCache API
method OfflineResourceList.swapCache
method OfflineResourceList.update
attribute OfflineResourceList.status
attribute OfflineResourceList.onchecking
attribute OfflineResourceList.onerror
attribute OfflineResourceList.onnoupdate
attribute OfflineResourceList.ondownloading
attribute OfflineResourceList.onprogress
attribute OfflineResourceList.onupdateready
attribute OfflineResourceList.oncached
attribute OfflineResourceList.onobsolete

View file

@ -1,80 +0,0 @@
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function
import json
import os
import sys
sys.path.append(os.path.dirname(__file__))
import usecounters
AUTOGENERATED_WARNING_COMMENT = "/* THIS FILE IS AUTOGENERATED BY gen-usecounters.py - DO NOT EDIT */"
def generate_list(f, counters):
def print_optional_macro_declare(name):
print('''
#ifndef %(name)s
#define %(name)s(interface_, name_) // nothing
#define DEFINED_%(name)s
#endif
''' % { 'name': name }, file=f)
def print_optional_macro_undeclare(name):
print('''
#ifdef DEFINED_%(name)s
#undef DEFINED_%(name)s
#undef %(name)s
#endif
''' % { 'name': name }, file=f)
print(AUTOGENERATED_WARNING_COMMENT, file=f)
print_optional_macro_declare('USE_COUNTER_DOM_METHOD')
print_optional_macro_declare('USE_COUNTER_DOM_ATTRIBUTE')
print_optional_macro_declare('USE_COUNTER_CSS_PROPERTY')
for counter in counters:
if counter['type'] == 'method':
print('USE_COUNTER_DOM_METHOD(%s, %s)' % (counter['interface_name'], counter['method_name']), file=f)
elif counter['type'] == 'attribute':
print('USE_COUNTER_DOM_ATTRIBUTE(%s, %s)' % (counter['interface_name'], counter['attribute_name']), file=f)
elif counter['type'] == 'property':
prop = counter['property_name']
print('USE_COUNTER_CSS_PROPERTY(%s, %s)' % (prop, prop), file=f)
print_optional_macro_undeclare('USE_COUNTER_DOM_METHOD')
print_optional_macro_undeclare('USE_COUNTER_DOM_ATTRIBUTE')
print_optional_macro_undeclare('USE_COUNTER_CSS_PROPERTY')
def generate_property_map(f, counters):
print(AUTOGENERATED_WARNING_COMMENT, file=f)
print('''
enum {
#define CSS_PROP_PUBLIC_OR_PRIVATE(publicname_, privatename_) privatename_
#define CSS_PROP_LIST_INCLUDE_LOGICAL
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \\
kwtable_, stylestruct_, stylestructoffset_, animtype_) \\
USE_COUNTER_FOR_CSS_PROPERTY_##method_ = eUseCounter_UNKNOWN,
#include "nsCSSPropList.h"
#undef CSS_PROP
#undef CSS_PROP_LIST_INCLUDE_LOGICAL
#undef CSS_PROP_PUBLIC_OR_PRIVATE
};
''', file=f)
for counter in counters:
if counter['type'] == 'property':
prop = counter['property_name']
print('#define USE_COUNTER_FOR_CSS_PROPERTY_%s eUseCounter_property_%s' % (prop, prop), file=f)
def use_counter_list(output_header, conf_filename):
counters = usecounters.read_conf(conf_filename)
generate_list(output_header, counters)
def property_map(output_map, conf_filename):
counters = usecounters.read_conf(conf_filename)
generate_property_map(output_map, counters)

View file

@ -141,11 +141,9 @@ EXPORTS.mozilla += [
'FeedWriterEnabled.h',
'TextInputProcessor.h',
'TimerClamping.h',
'UseCounter.h',
]
EXPORTS.mozilla.dom += [
'!UseCounterList.h',
'AnonymousContent.h',
'Attr.h',
'BarProps.h',
@ -471,18 +469,5 @@ if CONFIG['MOZ_PHOENIX'] or CONFIG['MOZ_XULRUNNER']:
if CONFIG['MOZ_X11']:
CXXFLAGS += CONFIG['TK_CFLAGS']
GENERATED_FILES += [
'PropertyUseCounterMap.inc',
'UseCounterList.h',
]
countermap = GENERATED_FILES['PropertyUseCounterMap.inc']
countermap.script = 'gen-usecounters.py:property_map'
countermap.inputs = ['UseCounters.conf']
counterlist = GENERATED_FILES['UseCounterList.h']
counterlist.script = 'gen-usecounters.py:use_counter_list'
counterlist.inputs = ['UseCounters.conf']
if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wno-error=shadow']

View file

@ -104,9 +104,6 @@
#include "nsContentPermissionHelper.h"
#include "nsCSSPseudoElements.h" // for CSSPseudoElementType
#include "nsNetUtil.h"
#include "nsDocument.h"
#include "HTMLImageElement.h"
#include "mozilla/css/ImageLoader.h"
#include "mozilla/layers/APZCTreeManager.h" // for layers::ZoomToRectBehavior
#include "mozilla/dom/Promise.h"
#include "mozilla/StyleSheetInlines.h"
@ -4025,27 +4022,6 @@ nsDOMWindowUtils::LeaveChaosMode()
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::ForceUseCounterFlush(nsIDOMNode *aNode)
{
NS_ENSURE_ARG_POINTER(aNode);
if (nsCOMPtr<nsIDocument> doc = do_QueryInterface(aNode)) {
mozilla::css::ImageLoader* loader = doc->StyleImageLoader();
loader->FlushUseCounters();
return NS_OK;
}
if (nsCOMPtr<nsIContent> content = do_QueryInterface(aNode)) {
if (HTMLImageElement* img = HTMLImageElement::FromContent(content)) {
img->FlushUseCounters();
return NS_OK;
}
}
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::HasRuleProcessorUsedByMultipleStyleSets(uint32_t aSheetType,
bool* aRetVal)

View file

@ -9718,19 +9718,6 @@ static const char* kDocumentWarnings[] = {
};
#undef DOCUMENT_WARNING
static UseCounter
OperationToUseCounter(nsIDocument::DeprecatedOperations aOperation)
{
switch(aOperation) {
#define DEPRECATED_OPERATION(_op) \
case nsIDocument::e##_op: return eUseCounter_##_op;
#include "nsDeprecatedOperationList.h"
#undef DEPRECATED_OPERATION
default:
MOZ_CRASH();
}
}
bool
nsIDocument::HasWarnedAbout(DeprecatedOperations aOperation) const
{
@ -9746,7 +9733,6 @@ nsIDocument::WarnOnceAbout(DeprecatedOperations aOperation,
return;
}
mDeprecationWarnedAbout[aOperation] = true;
const_cast<nsIDocument*>(this)->SetDocumentAndPageUseCounter(OperationToUseCounter(aOperation));
uint32_t flags = asError ? nsIScriptError::errorFlag
: nsIScriptError::warningFlag;
nsContentUtils::ReportToConsole(flags,
@ -11997,69 +11983,6 @@ nsIDocument::GetTopLevelContentDocument()
return parent;
}
void
nsIDocument::PropagateUseCounters(nsIDocument* aParentDocument)
{
MOZ_ASSERT(this != aParentDocument);
// What really matters here is that our use counters get propagated as
// high up in the content document hierarchy as possible. So,
// starting with aParentDocument, we need to find the toplevel content
// document, and propagate our use counters into its
// mChildDocumentUseCounters.
nsIDocument* contentParent = aParentDocument->GetTopLevelContentDocument();
if (!contentParent) {
return;
}
contentParent->mChildDocumentUseCounters |= mUseCounters;
contentParent->mChildDocumentUseCounters |= mChildDocumentUseCounters;
}
void
nsIDocument::SetPageUseCounter(UseCounter aUseCounter)
{
// We want to set the use counter on the "page" that owns us; the definition
// of "page" depends on what kind of document we are. See the comments below
// for details. In any event, checking all the conditions below is
// reasonably expensive, so we cache whether we've notified our owning page.
if (mNotifiedPageForUseCounter[aUseCounter]) {
return;
}
mNotifiedPageForUseCounter[aUseCounter] = true;
if (mDisplayDocument) {
// If we are a resource document, we won't have a docshell and so we won't
// record any page use counters on this document. Instead, we should
// forward it up to the document that loaded us.
MOZ_ASSERT(!mDocumentContainer);
mDisplayDocument->SetChildDocumentUseCounter(aUseCounter);
return;
}
if (IsBeingUsedAsImage()) {
// If this is an SVG image document, we also won't have a docshell.
MOZ_ASSERT(!mDocumentContainer);
return;
}
// We only care about use counters in content. If we're already a toplevel
// content document, then we should have already set the use counter on
// ourselves, and we are done.
nsIDocument* contentParent = GetTopLevelContentDocument();
if (!contentParent) {
return;
}
if (this == contentParent) {
MOZ_ASSERT(GetUseCounter(aUseCounter));
return;
}
contentParent->SetChildDocumentUseCounter(aUseCounter);
}
bool
nsIDocument::HasScriptsBlockedBySandbox()
{

View file

@ -24,7 +24,6 @@
#include "nsTHashtable.h" // for member
#include "mozilla/net/ReferrerPolicy.h" // for member
#include "nsWeakReference.h"
#include "mozilla/UseCounter.h"
#include "mozilla/WeakPtr.h"
#include "Units.h"
#include "nsContentListDeclarations.h"
@ -2782,23 +2781,6 @@ public:
bool DidFireDOMContentLoaded() const { return mDidFireDOMContentLoaded; }
void SetDocumentUseCounter(mozilla::UseCounter aUseCounter)
{
if (!mUseCounters[aUseCounter]) {
mUseCounters[aUseCounter] = true;
}
}
void SetPageUseCounter(mozilla::UseCounter aUseCounter);
void SetDocumentAndPageUseCounter(mozilla::UseCounter aUseCounter)
{
SetDocumentUseCounter(aUseCounter);
SetPageUseCounter(aUseCounter);
}
void PropagateUseCounters(nsIDocument* aParentDocument);
void SetUserHasInteracted(bool aUserHasInteracted)
{
mUserHasInteracted = aUserHasInteracted;
@ -2857,24 +2839,6 @@ public:
virtual void ScheduleResizeObserversNotification() const = 0;
protected:
bool GetUseCounter(mozilla::UseCounter aUseCounter)
{
return mUseCounters[aUseCounter];
}
void SetChildDocumentUseCounter(mozilla::UseCounter aUseCounter)
{
if (!mChildDocumentUseCounters[aUseCounter]) {
mChildDocumentUseCounters[aUseCounter] = true;
}
}
bool GetChildDocumentUseCounter(mozilla::UseCounter aUseCounter)
{
return mChildDocumentUseCounters[aUseCounter];
}
private:
mutable std::bitset<eDeprecatedOperationCount> mDeprecationWarnedAbout;
mutable std::bitset<eDocumentWarningCount> mDocWarningWarnedAbout;
@ -3315,15 +3279,7 @@ protected:
// Our live MediaQueryLists
PRCList mDOMMediaQueryLists;
// Flags for use counters used directly by this document.
std::bitset<mozilla::eUseCounter_Count> mUseCounters;
// Flags for use counters used by any child documents of this document.
std::bitset<mozilla::eUseCounter_Count> mChildDocumentUseCounters;
// Flags for whether we've notified our top-level "page" of a use counter
// for this child document.
std::bitset<mozilla::eUseCounter_Count> mNotifiedPageForUseCounter;
// Whether the user has interacted with the document or not:
// Whether the user has interacted with the document or not:
bool mUserHasInteracted;
mozilla::TimeStamp mPageUnloadingEventTimeStamp;

View file

@ -20,7 +20,6 @@
#include "mozilla/Likely.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/ServoBindings.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/css/StyleRule.h"
#include "mozilla/dom/Element.h"

View file

@ -198,12 +198,6 @@ nsImageLoadingContent::Notify(imgIRequest* aRequest,
}
if (aType == imgINotificationObserver::DECODE_COMPLETE) {
nsCOMPtr<imgIContainer> container;
aRequest->GetImage(getter_AddRefs(container));
if (container) {
container->PropagateUseCounters(GetOurOwnerDoc());
}
UpdateImageState(true);
}

View file

@ -56,7 +56,6 @@
#include "mozilla/dom/ScriptSettings.h"
#include "nsAXPCNativeCallContext.h"
#include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/Telemetry.h"
#include "nsJSPrincipals.h"
@ -2007,7 +2006,7 @@ DOMGCSliceCallback(JSContext* aCx, JS::GCProgress aProgress, const JS::GCDescrip
}
if (!sShuttingDown) {
if (sPostGCEventsToObserver || Telemetry::CanRecordExtended()) {
if (sPostGCEventsToObserver) {
nsString json;
json.Adopt(aDesc.formatJSON(aCx, PR_Now()));
RefPtr<NotifyGCEndRunnable> notify = new NotifyGCEndRunnable(json);

View file

@ -10,7 +10,6 @@
#include "nsNodeInfoManager.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/Telemetry.h"
#include "mozilla/dom/NodeInfo.h"
#include "mozilla/dom/NodeInfoInlines.h"
#include "nsCOMPtr.h"

View file

@ -32,7 +32,6 @@
#include "mozilla/dom/DOMStringList.h"
#include "mozilla/dom/ShadowRoot.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Likely.h"
#include "nsCSSFrameConstructor.h"
#include "nsStyleStruct.h"

View file

@ -4,13 +4,6 @@ support-files =
file_bug1011748_redirect.sjs
file_bug1011748_OK.sjs
file_messagemanager_unload.html
file_use_counter_outer.html
file_use_counter_svg_getElementById.svg
file_use_counter_svg_currentScale.svg
file_use_counter_svg_fill_pattern_definition.svg
file_use_counter_svg_fill_pattern.svg
file_use_counter_svg_fill_pattern_internal.svg
file_use_counter_svg_fill_pattern_data.svg
[browser_bug593387.js]
[browser_bug902350.js]
@ -24,5 +17,4 @@ tags = mcb
skip-if = e10s # this tests non-e10s behavior. it's not expected to work in e10s.
[browser_state_notifications.js]
skip-if = true # Bug 1271028
[browser_use_counters.js]
[browser_bug1307747.js]

View file

@ -1,305 +0,0 @@
/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
requestLongerTimeout(2);
var {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
Cu.import("resource://gre/modules/Services.jsm");
const gHttpTestRoot = "http://example.com/browser/dom/base/test/";
/**
* Enable local telemetry recording for the duration of the tests.
*/
var gOldContentCanRecord = false;
var gOldParentCanRecord = false;
add_task(function* test_initialize() {
let Telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
gOldParentCanRecord = Telemetry.canRecordExtended
Telemetry.canRecordExtended = true;
// Because canRecordExtended is a per-process variable, we need to make sure
// that all of the pages load in the same content process. Limit the number
// of content processes to at most 1 (or 0 if e10s is off entirely).
yield SpecialPowers.pushPrefEnv({ set: [[ "dom.ipc.processCount", 1 ]] });
gOldContentCanRecord = yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function () {
let telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
let old = telemetry.canRecordExtended;
telemetry.canRecordExtended = true;
return old;
});
info("canRecord for content: " + gOldContentCanRecord);
});
add_task(function* () {
// Check that use counters are incremented by SVGs loaded directly in iframes.
yield check_use_counter_iframe("file_use_counter_svg_getElementById.svg",
"SVGSVGELEMENT_GETELEMENTBYID");
yield check_use_counter_iframe("file_use_counter_svg_currentScale.svg",
"SVGSVGELEMENT_CURRENTSCALE_getter");
yield check_use_counter_iframe("file_use_counter_svg_currentScale.svg",
"SVGSVGELEMENT_CURRENTSCALE_setter");
// Check that even loads from the imglib cache update use counters. The
// images should still be there, because we just loaded them in the last
// set of tests. But we won't get updated counts for the document
// counters, because we won't be re-parsing the SVG documents.
yield check_use_counter_iframe("file_use_counter_svg_getElementById.svg",
"SVGSVGELEMENT_GETELEMENTBYID", false);
yield check_use_counter_iframe("file_use_counter_svg_currentScale.svg",
"SVGSVGELEMENT_CURRENTSCALE_getter", false);
yield check_use_counter_iframe("file_use_counter_svg_currentScale.svg",
"SVGSVGELEMENT_CURRENTSCALE_setter", false);
// Check that use counters are incremented by SVGs loaded as images.
// Note that SVG images are not permitted to execute script, so we can only
// check for properties here.
yield check_use_counter_img("file_use_counter_svg_getElementById.svg",
"PROPERTY_FILL");
yield check_use_counter_img("file_use_counter_svg_currentScale.svg",
"PROPERTY_FILL");
// Check that use counters are incremented by directly loading SVGs
// that reference patterns defined in another SVG file.
yield check_use_counter_direct("file_use_counter_svg_fill_pattern.svg",
"PROPERTY_FILLOPACITY", /*xfail=*/true);
// Check that use counters are incremented by directly loading SVGs
// that reference patterns defined in the same file or in data: URLs.
yield check_use_counter_direct("file_use_counter_svg_fill_pattern_internal.svg",
"PROPERTY_FILLOPACITY");
// data: URLs don't correctly propagate to their referring document yet.
//yield check_use_counter_direct("file_use_counter_svg_fill_pattern_data.svg",
// "PROPERTY_FILL_OPACITY");
});
add_task(function* () {
let Telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
Telemetry.canRecordExtended = gOldParentCanRecord;
yield ContentTask.spawn(gBrowser.selectedBrowser, { oldCanRecord: gOldContentCanRecord }, function (arg) {
Cu.import("resource://gre/modules/PromiseUtils.jsm");
yield new Promise(resolve => {
let telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
telemetry.canRecordExtended = arg.oldCanRecord;
resolve();
});
});
});
function waitForDestroyedDocuments() {
let deferred = promise.defer();
SpecialPowers.exactGC(deferred.resolve);
return deferred.promise;
}
function waitForPageLoad(browser) {
return ContentTask.spawn(browser, null, function*() {
Cu.import("resource://gre/modules/PromiseUtils.jsm");
yield new Promise(resolve => {
let listener = () => {
removeEventListener("load", listener, true);
resolve();
}
addEventListener("load", listener, true);
});
});
}
function grabHistogramsFromContent(use_counter_middlefix, page_before = null) {
let telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
let suffix = Services.appinfo.browserTabsRemoteAutostart ? "#content" : "";
let gather = () => [
telemetry.getHistogramById("USE_COUNTER2_" + use_counter_middlefix + "_PAGE" + suffix).snapshot().sum,
telemetry.getHistogramById("USE_COUNTER2_" + use_counter_middlefix + "_DOCUMENT" + suffix).snapshot().sum,
telemetry.getHistogramById("CONTENT_DOCUMENTS_DESTROYED" + suffix).snapshot().sum,
telemetry.getHistogramById("TOP_LEVEL_CONTENT_DOCUMENTS_DESTROYED" + suffix).snapshot().sum,
];
return BrowserTestUtils.waitForCondition(() => {
return page_before != telemetry.getHistogramById("USE_COUNTER2_" + use_counter_middlefix + "_PAGE" + suffix).snapshot().sum;
}).then(gather, gather);
}
var check_use_counter_iframe = Task.async(function* (file, use_counter_middlefix, check_documents=true) {
info("checking " + file + " with histogram " + use_counter_middlefix);
let newTab = gBrowser.addTab( "about:blank");
gBrowser.selectedTab = newTab;
newTab.linkedBrowser.stop();
// Hold on to the current values of the telemetry histograms we're
// interested in.
let [histogram_page_before, histogram_document_before,
histogram_docs_before, histogram_toplevel_docs_before] =
yield grabHistogramsFromContent(use_counter_middlefix);
gBrowser.selectedBrowser.loadURI(gHttpTestRoot + "file_use_counter_outer.html");
yield waitForPageLoad(gBrowser.selectedBrowser);
// Inject our desired file into the iframe of the newly-loaded page.
yield ContentTask.spawn(gBrowser.selectedBrowser, { file: file }, function(opts) {
Cu.import("resource://gre/modules/PromiseUtils.jsm");
let deferred = PromiseUtils.defer();
let wu = content.window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
let iframe = content.document.getElementById('content');
iframe.src = opts.file;
let listener = (event) => {
event.target.removeEventListener("load", listener, true);
// We flush the main document first, then the iframe's document to
// ensure any propagation that might happen from content->parent should
// have already happened when counters are reported to telemetry.
wu.forceUseCounterFlush(content.document);
wu.forceUseCounterFlush(iframe.contentDocument);
deferred.resolve();
};
iframe.addEventListener("load", listener, true);
return deferred.promise;
});
// Tear down the page.
gBrowser.removeTab(newTab);
// The histograms only get recorded when the document actually gets
// destroyed, which might not have happened yet due to GC/CC effects, etc.
// Try to force document destruction.
yield waitForDestroyedDocuments();
// Grab histograms again and compare.
let [histogram_page_after, histogram_document_after,
histogram_docs_after, histogram_toplevel_docs_after] =
yield grabHistogramsFromContent(use_counter_middlefix, histogram_page_before);
is(histogram_page_after, histogram_page_before + 1,
"page counts for " + use_counter_middlefix + " after are correct");
ok(histogram_toplevel_docs_after >= histogram_toplevel_docs_before + 1,
"top level document counts are correct");
if (check_documents) {
is(histogram_document_after, histogram_document_before + 1,
"document counts for " + use_counter_middlefix + " after are correct");
}
});
var check_use_counter_img = Task.async(function* (file, use_counter_middlefix) {
info("checking " + file + " as image with histogram " + use_counter_middlefix);
let newTab = gBrowser.addTab("about:blank");
gBrowser.selectedTab = newTab;
newTab.linkedBrowser.stop();
// Hold on to the current values of the telemetry histograms we're
// interested in.
let [histogram_page_before, histogram_document_before,
histogram_docs_before, histogram_toplevel_docs_before] =
yield grabHistogramsFromContent(use_counter_middlefix);
gBrowser.selectedBrowser.loadURI(gHttpTestRoot + "file_use_counter_outer.html");
yield waitForPageLoad(gBrowser.selectedBrowser);
// Inject our desired file into the img of the newly-loaded page.
yield ContentTask.spawn(gBrowser.selectedBrowser, { file: file }, function(opts) {
Cu.import("resource://gre/modules/PromiseUtils.jsm");
let deferred = PromiseUtils.defer();
let img = content.document.getElementById('display');
img.src = opts.file;
let listener = (event) => {
img.removeEventListener("load", listener, true);
// Flush for the image. It matters what order we do these in, so that
// the image can propagate its use counters to the document prior to the
// document reporting its use counters.
let wu = content.window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
wu.forceUseCounterFlush(img);
// Flush for the main window.
wu.forceUseCounterFlush(content.document);
deferred.resolve();
};
img.addEventListener("load", listener, true);
return deferred.promise;
});
// Tear down the page.
gBrowser.removeTab(newTab);
// The histograms only get recorded when the document actually gets
// destroyed, which might not have happened yet due to GC/CC effects, etc.
// Try to force document destruction.
yield waitForDestroyedDocuments();
// Grab histograms again and compare.
let [histogram_page_after, histogram_document_after,
histogram_docs_after, histogram_toplevel_docs_after] =
yield grabHistogramsFromContent(use_counter_middlefix, histogram_page_before);
is(histogram_page_after, histogram_page_before + 1,
"page counts for " + use_counter_middlefix + " after are correct");
is(histogram_document_after, histogram_document_before + 1,
"document counts for " + use_counter_middlefix + " after are correct");
ok(histogram_toplevel_docs_after >= histogram_toplevel_docs_before + 1,
"top level document counts are correct");
// 2 documents: one for the outer html page containing the <img> element, and
// one for the SVG image itself.
ok(histogram_docs_after >= histogram_docs_before + 2,
"document counts are correct");
});
var check_use_counter_direct = Task.async(function* (file, use_counter_middlefix, xfail=false) {
info("checking " + file + " with histogram " + use_counter_middlefix);
let newTab = gBrowser.addTab( "about:blank");
gBrowser.selectedTab = newTab;
newTab.linkedBrowser.stop();
// Hold on to the current values of the telemetry histograms we're
// interested in.
let [histogram_page_before, histogram_document_before,
histogram_docs_before, histogram_toplevel_docs_before] =
yield grabHistogramsFromContent(use_counter_middlefix);
gBrowser.selectedBrowser.loadURI(gHttpTestRoot + file);
yield ContentTask.spawn(gBrowser.selectedBrowser, null, function*() {
Cu.import("resource://gre/modules/PromiseUtils.jsm");
yield new Promise(resolve => {
let listener = () => {
removeEventListener("load", listener, true);
let wu = content.window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
wu.forceUseCounterFlush(content.document);
setTimeout(resolve, 0);
}
addEventListener("load", listener, true);
});
});
// Tear down the page.
gBrowser.removeTab(newTab);
// The histograms only get recorded when the document actually gets
// destroyed, which might not have happened yet due to GC/CC effects, etc.
// Try to force document destruction.
yield waitForDestroyedDocuments();
// Grab histograms again and compare.
let [histogram_page_after, histogram_document_after,
histogram_docs_after, histogram_toplevel_docs_after] =
yield grabHistogramsFromContent(use_counter_middlefix, histogram_page_before);
if (!xfail) {
is(histogram_page_after, histogram_page_before + 1,
"page counts for " + use_counter_middlefix + " after are correct");
is(histogram_document_after, histogram_document_before + 1,
"document counts for " + use_counter_middlefix + " after are correct");
}
ok(histogram_toplevel_docs_after >= histogram_toplevel_docs_before + 1,
"top level document counts are correct");
ok(histogram_docs_after >= histogram_docs_before + 1,
"document counts are correct");
});

View file

@ -1,17 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=968923
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 968923</title>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=968923">Mozilla Bug 968923</a>
<img id="display" />
<iframe id="content">
</iframe>
</body>
</html>

View file

@ -1,17 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="4in" height="3in" version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<desc>Test graphic for hitting currentScale
</desc>
<script type="text/javascript"> <![CDATA[
document.documentElement.currentScale = document.documentElement.currentScale;
]]>
</script>
<image id="i1" x="200" y="200" width="100px" height="80px">
</image>
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red"/>
</svg>

Before

Width:  |  Height:  |  Size: 635 B

View file

@ -1,15 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="8cm" height="4cm" viewBox="0 0 800 400" version="1.1"
xmlns="http://www.w3.org/2000/svg">
<desc>Borrowed from http://www.w3.org/TR/SVG/pservers.html</desc>
<!-- Outline the drawing area in blue -->
<rect fill="none" stroke="blue"
x="1" y="1" width="798" height="398"/>
<!-- The ellipse is filled using a triangle pattern paint server
and stroked with black -->
<ellipse fill="url(http://example.com/browser/dom/base/test/file_use_counter_svg_fill_pattern_definition.svg#TrianglePattern)" stroke="black" stroke-width="5"
cx="400" cy="200" rx="350" ry="150" />
</svg>

Before

Width:  |  Height:  |  Size: 763 B

View file

@ -1,15 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="8cm" height="4cm" viewBox="0 0 800 400" version="1.1"
xmlns="http://www.w3.org/2000/svg">
<desc>Borrowed from http://www.w3.org/TR/SVG/pservers.html</desc>
<!-- Outline the drawing area in blue -->
<rect fill="none" stroke="blue"
x="1" y="1" width="798" height="398"/>
<!-- The ellipse is filled using a triangle pattern paint server
and stroked with black -->
<ellipse fill="url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iIAogICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPgo8c3ZnIHdpZHRoPSI4Y20iIGhlaWdodD0iNGNtIiB2aWV3Qm94PSIwIDAgODAwIDQwMCIgdmVyc2lvbj0iMS4xIgogICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGRlc2M+Qm9ycm93ZWQgZnJvbSBodHRwOi8vd3d3LnczLm9yZy9UUi9TVkcvcHNlcnZlcnMuaHRtbDwvZGVzYz4KICA8ZGVmcz4KICAgIDxwYXR0ZXJuIGlkPSJUcmlhbmdsZVBhdHRlcm4iIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiCiAgICAgICAgICAgICB4PSIwIiB5PSIwIiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIKICAgICAgICAgICAgIHZpZXdCb3g9IjAgMCAxMCAxMCIgPgogICAgICA8cGF0aCBkPSJNIDAgMCBMIDcgMCBMIDMuNSA3IHoiIGZpbGw9InJlZCIgZmlsbC1vcGFjaXR5PSIwLjciIHN0cm9rZT0iYmx1ZSIgLz4KICAgIDwvcGF0dGVybj4gCiAgPC9kZWZzPgo8L3N2Zz4K#TrianglePattern)" stroke="black" stroke-width="5"
cx="400" cy="200" rx="350" ry="150" />
</svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -1,14 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="8cm" height="4cm" viewBox="0 0 800 400" version="1.1"
xmlns="http://www.w3.org/2000/svg">
<desc>Borrowed from http://www.w3.org/TR/SVG/pservers.html</desc>
<defs>
<pattern id="TrianglePattern" patternUnits="userSpaceOnUse"
x="0" y="0" width="100" height="100"
viewBox="0 0 10 10" >
<path d="M 0 0 L 7 0 L 3.5 7 z" fill="red" fill-opacity="0.7" stroke="blue" />
</pattern>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 591 B

View file

@ -1,23 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="8cm" height="4cm" viewBox="0 0 800 400" version="1.1"
xmlns="http://www.w3.org/2000/svg">
<desc>Borrowed from http://www.w3.org/TR/SVG/pservers.html</desc>
<!-- Outline the drawing area in blue -->
<rect fill="none" stroke="blue"
x="1" y="1" width="798" height="398"/>
<defs>
<pattern id="TrianglePattern" patternUnits="userSpaceOnUse"
x="0" y="0" width="100" height="100"
viewBox="0 0 10 10" >
<path d="M 0 0 L 7 0 L 3.5 7 z" fill="red" fill-opacity="0.7" stroke="blue" />
</pattern>
</defs>
<!-- The ellipse is filled using a triangle pattern paint server
and stroked with black -->
<ellipse fill="url(#TrianglePattern)" stroke="black" stroke-width="5"
cx="400" cy="200" rx="350" ry="150" />
</svg>

Before

Width:  |  Height:  |  Size: 944 B

View file

@ -1,22 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="4in" height="3in" version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<desc>Test graphic for hitting getElementById
</desc>
<image id="i1" x="200" y="200" width="100px" height="80px">
</image>
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red"/>
<script type="text/javascript"> <![CDATA[
var image = document.documentElement.getElementById("i1");
image.addEventListener("load",
function() {
document.documentElement.removeAttribute("class");
},
false);
]]>
</script>
</svg>

Before

Width:  |  Height:  |  Size: 836 B

View file

@ -1,71 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import buildconfig
import collections
import re
import StringIO
import sys
def read_conf(conf_filename):
# Can't read/write from a single StringIO, so make a new one for reading.
stream = open(conf_filename, 'rU')
def parse_counters(stream):
for line_num, line in enumerate(stream):
line = line.rstrip('\n')
if not line or line.startswith('//'):
# empty line or comment
continue
m = re.match(r'method ([A-Za-z0-9]+)\.([A-Za-z0-9]+)$', line)
if m:
interface_name, method_name = m.groups()
yield { 'type': 'method',
'interface_name': interface_name,
'method_name': method_name }
continue
m = re.match(r'attribute ([A-Za-z0-9]+)\.([A-Za-z0-9]+)$', line)
if m:
interface_name, attribute_name = m.groups()
yield { 'type': 'attribute',
'interface_name': interface_name,
'attribute_name': attribute_name }
continue
m = re.match(r'property ([A-Za-z0-9]+)$', line)
if m:
property_name = m.group(1)
yield { 'type': 'property',
'property_name': property_name }
continue
raise ValueError('error parsing %s at line %d' % (conf_filename, line_num))
return parse_counters(stream)
def generate_histograms(filename):
# The mapping for use counters to telemetry histograms depends on the
# ordering of items in the dictionary.
items = collections.OrderedDict()
for counter in read_conf(filename):
def append_counter(name, desc):
items[name] = { 'expires_in_version': 'never',
'kind' : 'boolean',
'description': desc }
def append_counters(name, desc):
append_counter('USE_COUNTER2_%s_DOCUMENT' % name, 'Whether a document %s' % desc)
append_counter('USE_COUNTER2_%s_PAGE' % name, 'Whether a page %s' % desc)
if counter['type'] == 'method':
method = '%s.%s' % (counter['interface_name'], counter['method_name'])
append_counters(method.replace('.', '_').upper(), 'called %s' % method)
elif counter['type'] == 'attribute':
attr = '%s.%s' % (counter['interface_name'], counter['attribute_name'])
counter_name = attr.replace('.', '_').upper()
append_counters('%s_getter' % counter_name, 'got %s' % attr)
append_counters('%s_setter' % counter_name, 'set %s' % attr)
elif counter['type'] == 'property':
prop = counter['property_name']
append_counters('PROPERTY_%s' % prop.replace('-', '_').upper(), "used the '%s' property" % prop)
return items

View file

@ -14,7 +14,6 @@
#include "mozilla/Preferences.h"
#include "mozilla/SizePrintfMacros.h"
#include "mozilla/Unused.h"
#include "mozilla/UseCounter.h"
#include "mozilla/dom/DocGroup.h"
#include "AccessCheck.h"
@ -59,7 +58,6 @@
#include "mozilla/jsipc/CrossProcessObjectWrappers.h"
#include "nsDOMClassInfo.h"
#include "ipc/ErrorIPCUtils.h"
#include "mozilla/UseCounter.h"
namespace mozilla {
namespace dom {
@ -3592,16 +3590,6 @@ AssertReflectorHasGivenProto(JSContext* aCx, JSObject* aReflector,
} // namespace binding_detail
#endif // DEBUG
void
SetDocumentAndPageUseCounter(JSContext* aCx, JSObject* aObject,
UseCounter aUseCounter)
{
nsGlobalWindow* win = xpc::WindowGlobalOrNull(js::UncheckedUnwrap(aObject));
if (win && win->GetDocument()) {
win->GetDocument()->SetDocumentAndPageUseCounter(aUseCounter);
}
}
namespace {
// This runnable is used to write a deprecation message from a worker to the

View file

@ -46,8 +46,6 @@ class nsIJSID;
namespace mozilla {
enum UseCounter : int16_t;
namespace dom {
class CustomElementReactionsStack;
template<typename KeyType, typename ValueType> class Record;
@ -3428,10 +3426,6 @@ already_AddRefed<nsGenericHTMLElement>
CreateHTMLElement(const GlobalObject& aGlobal, const JS::CallArgs& aCallArgs,
JS::Handle<JSObject*> aGivenProto, ErrorResult& aRv);
void
SetDocumentAndPageUseCounter(JSContext* aCx, JSObject* aObject,
UseCounter aUseCounter);
// Warnings
void
DeprecationWarning(JSContext* aCx, JSObject* aObject,

View file

@ -7467,8 +7467,8 @@ class CGPerSignatureCall(CGThing):
def __init__(self, returnType, arguments, nativeMethodName, static,
descriptor, idlNode, argConversionStartsAt=0, getter=False,
setter=False, isConstructor=False, useCounterName=None,
resultVar=None, objectName="obj"):
setter=False, isConstructor=False, resultVar=None,
objectName="obj"):
assert idlNode.isMethod() == (not getter and not setter)
assert idlNode.isAttr() == (getter or setter)
# Constructors are always static
@ -7701,11 +7701,6 @@ class CGPerSignatureCall(CGThing):
nativeMethodName,
static, argsPost=argsPost, resultVar=resultVar))
if useCounterName:
# Generate a telemetry call for when [UseCounter] is used.
code = "SetDocumentAndPageUseCounter(cx, obj, eUseCounter_%s);\n" % useCounterName
cgThings.append(CGGeneric(code))
self.cgRoot = CGList(cgThings)
def getArguments(self):
@ -7934,11 +7929,6 @@ class CGMethodCall(CGThing):
methodName = "%s.%s" % (descriptor.interface.identifier.name, method.identifier.name)
argDesc = "argument %d of " + methodName
if method.getExtendedAttribute("UseCounter"):
useCounterName = methodName.replace(".", "_")
else:
useCounterName = None
if method.isStatic():
nativeType = descriptor.nativeType
staticTypeOverride = PropertyDefiner.getStringAttr(method, "StaticClassOverride")
@ -7960,8 +7950,7 @@ class CGMethodCall(CGThing):
nativeMethodName, static, descriptor,
method,
argConversionStartsAt=argConversionStartsAt,
isConstructor=isConstructor,
useCounterName=useCounterName)
isConstructor=isConstructor)
signatures = method.signatures()
if len(signatures) == 1:
@ -8337,16 +8326,11 @@ class CGGetterCall(CGPerSignatureCall):
getter.
"""
def __init__(self, returnType, nativeMethodName, descriptor, attr):
if attr.getExtendedAttribute("UseCounter"):
useCounterName = "%s_%s_getter" % (descriptor.interface.identifier.name,
attr.identifier.name)
else:
useCounterName = None
if attr.isStatic():
nativeMethodName = "%s::%s" % (descriptor.nativeType, nativeMethodName)
CGPerSignatureCall.__init__(self, returnType, [], nativeMethodName,
attr.isStatic(), descriptor, attr,
getter=True, useCounterName=useCounterName)
getter=True)
class CGNavigatorGetterCall(CGPerSignatureCall):
@ -8413,17 +8397,12 @@ class CGSetterCall(CGPerSignatureCall):
setter.
"""
def __init__(self, argType, nativeMethodName, descriptor, attr):
if attr.getExtendedAttribute("UseCounter"):
useCounterName = "%s_%s_setter" % (descriptor.interface.identifier.name,
attr.identifier.name)
else:
useCounterName = None
if attr.isStatic():
nativeMethodName = "%s::%s" % (descriptor.nativeType, nativeMethodName)
CGPerSignatureCall.__init__(self, None,
[FakeArgument(argType, attr, allowTreatNonCallableAsNull=True)],
nativeMethodName, attr.isStatic(),
descriptor, attr, setter=True, useCounterName=useCounterName)
descriptor, attr, setter=True)
def wrap_return_value(self):
attr = self.idlNode
@ -13932,12 +13911,6 @@ class CGBindingRoot(CGThing):
bindingHeaders[CGHeaders.getDeclarationFilename(enums[0])] = True
bindingHeaders["jsapi.h"] = True
# For things that have [UseCounter]
def descriptorRequiresTelemetry(desc):
iface = desc.interface
return any(m.getExtendedAttribute("UseCounter") for m in iface.members)
bindingHeaders["mozilla/UseCounter.h"] = any(
descriptorRequiresTelemetry(d) for d in descriptors)
bindingHeaders["mozilla/dom/SimpleGlobalObject.h"] = any(
CGDictionary.dictionarySafeToJSONify(d) for d in dictionaries)
bindingHeaders["XrayWrapper.h"] = any(

View file

@ -4245,11 +4245,6 @@ class IDLAttribute(IDLInterfaceMember):
"readonly attributes" % attr.value(),
[attr.location, self.location])
self._setDependsOn(attr.value())
elif identifier == "UseCounter":
if self.stringifier:
raise WebIDLError("[UseCounter] must not be used on a "
"stringifier attribute",
[attr.location, self.location])
elif identifier == "Unscopable":
if not attr.noArguments():
raise WebIDLError("[Unscopable] must take no arguments",
@ -4979,11 +4974,6 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
raise WebIDLError("[Alias] takes an identifier or string",
[attr.location])
self._addAlias(attr.value())
elif identifier == "UseCounter":
if self.isSpecial():
raise WebIDLError("[UseCounter] must not be used on a special "
"operation",
[attr.location, self.location])
elif identifier == "Unscopable":
if not attr.noArguments():
raise WebIDLError("[Unscopable] must take no arguments",

View file

@ -95,7 +95,6 @@
#include "mozilla/layers/PersistentBufferProvider.h"
#include "mozilla/MathAlgorithms.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/Unused.h"

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -15,7 +14,6 @@
#include "mozilla/layers/AsyncCanvasRenderer.h"
#include "mozilla/layers/CanvasClient.h"
#include "mozilla/layers/ImageBridgeChild.h"
#include "mozilla/Telemetry.h"
#include "CanvasRenderingContext2D.h"
#include "CanvasUtils.h"
#include "GLContext.h"

View file

@ -9,7 +9,6 @@
#include "GLContext.h"
#include "mozilla/dom/WebGL2RenderingContextBinding.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/Telemetry.h"
#include "nsPrintfCString.h"
#include "WebGLBuffer.h"
#include "WebGLFormats.h"

View file

@ -31,7 +31,6 @@
#include "mozilla/ProcessPriorityManager.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/Services.h"
#include "mozilla/Telemetry.h"
#include "nsContentUtils.h"
#include "nsDisplayList.h"
#include "nsError.h"

View file

@ -11,7 +11,6 @@
#include "nsProxyRelease.h"
#include "jsapi.h"
#include "mozilla/Telemetry.h"
#include "mozilla/dom/CryptoBuffer.h"
#include "mozilla/dom/CryptoKey.h"
#include "mozilla/dom/KeyAlgorithmProxy.h"
@ -45,56 +44,6 @@ using mozilla::dom::workers::Status;
using mozilla::dom::workers::WorkerHolder;
using mozilla::dom::workers::WorkerPrivate;
// Pre-defined identifiers for telemetry histograms
enum TelemetryMethod {
TM_ENCRYPT = 0,
TM_DECRYPT = 1,
TM_SIGN = 2,
TM_VERIFY = 3,
TM_DIGEST = 4,
TM_GENERATEKEY = 5,
TM_DERIVEKEY = 6,
TM_DERIVEBITS = 7,
TM_IMPORTKEY = 8,
TM_EXPORTKEY = 9,
TM_WRAPKEY = 10,
TM_UNWRAPKEY = 11
};
enum TelemetryAlgorithm {
// Please make additions at the end of the list,
// to preserve comparability of histograms over time
TA_UNKNOWN = 0,
// encrypt / decrypt
TA_AES_CBC = 1,
TA_AES_CFB = 2,
TA_AES_CTR = 3,
TA_AES_GCM = 4,
TA_RSAES_PKCS1 = 5, // NB: This algorithm has been removed
TA_RSA_OAEP = 6,
// sign/verify
TA_RSASSA_PKCS1 = 7,
TA_RSA_PSS = 8,
TA_HMAC_SHA_1 = 9,
TA_HMAC_SHA_224 = 10,
TA_HMAC_SHA_256 = 11,
TA_HMAC_SHA_384 = 12,
TA_HMAC_SHA_512 = 13,
// digest
TA_SHA_1 = 14,
TA_SHA_224 = 15,
TA_SHA_256 = 16,
TA_SHA_384 = 17,
TA_SHA_512 = 18,
// Later additions
TA_AES_KW = 19,
TA_ECDH = 20,
TA_PBKDF2 = 21,
TA_ECDSA = 22,
TA_HKDF = 23,
};
// Convenience functions for extracting / converting information
// OOM-safe CryptoBuffer initialization, suitable for constructors
@ -577,12 +526,10 @@ public:
}
// Cache parameters depending on the specific algorithm
TelemetryAlgorithm telemetryAlg;
if (algName.EqualsLiteral(WEBCRYPTO_ALG_AES_CBC)) {
CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_AES_CBC);
mMechanism = CKM_AES_CBC_PAD;
telemetryAlg = TA_AES_CBC;
RootedDictionary<AesCbcParams> params(aCx);
nsresult rv = Coerce(aCx, params, aAlgorithm);
if (NS_FAILED(rv)) {
@ -599,7 +546,6 @@ public:
CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_AES_CTR);
mMechanism = CKM_AES_CTR;
telemetryAlg = TA_AES_CTR;
RootedDictionary<AesCtrParams> params(aCx);
nsresult rv = Coerce(aCx, params, aAlgorithm);
if (NS_FAILED(rv)) {
@ -618,7 +564,6 @@ public:
CHECK_KEY_ALGORITHM(aKey.Algorithm(), WEBCRYPTO_ALG_AES_GCM);
mMechanism = CKM_AES_GCM;
telemetryAlg = TA_AES_GCM;
RootedDictionary<AesGcmParams> params(aCx);
nsresult rv = Coerce(aCx, params, aAlgorithm);
if (NS_FAILED(rv)) {
@ -1032,16 +977,6 @@ public:
mEarlyRv = NS_ERROR_DOM_DATA_ERR;
return;
}
TelemetryAlgorithm telemetryAlg;
switch (mMechanism) {
case CKM_SHA_1_HMAC: telemetryAlg = TA_HMAC_SHA_1; break;
case CKM_SHA224_HMAC: telemetryAlg = TA_HMAC_SHA_224; break;
case CKM_SHA256_HMAC: telemetryAlg = TA_HMAC_SHA_256; break;
case CKM_SHA384_HMAC: telemetryAlg = TA_HMAC_SHA_384; break;
case CKM_SHA512_HMAC: telemetryAlg = TA_HMAC_SHA_512; break;
default: telemetryAlg = TA_UNKNOWN;
}
}
private:
@ -1332,15 +1267,11 @@ public:
return;
}
TelemetryAlgorithm telemetryAlg;
if (algName.EqualsLiteral(WEBCRYPTO_ALG_SHA1)) {
telemetryAlg = TA_SHA_1;
} else if (algName.EqualsLiteral(WEBCRYPTO_ALG_SHA256)) {
telemetryAlg = TA_SHA_224;
} else if (algName.EqualsLiteral(WEBCRYPTO_ALG_SHA384)) {
telemetryAlg = TA_SHA_256;
} else if (algName.EqualsLiteral(WEBCRYPTO_ALG_SHA512)) {
telemetryAlg = TA_SHA_384;
if (algName.EqualsLiteral(WEBCRYPTO_ALG_SHA1) ||
algName.EqualsLiteral(WEBCRYPTO_ALG_SHA256) ||
algName.EqualsLiteral(WEBCRYPTO_ALG_SHA384) ||
algName.EqualsLiteral(WEBCRYPTO_ALG_SHA512)) {
// All good, fall through.
} else {
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
return;

View file

@ -53,7 +53,6 @@
#include "mozilla/ipc/MessageChannel.h"
#include "mozilla/MiscEvents.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TextEvents.h"
#include "mozilla/TouchEvents.h"
#include "mozilla/Unused.h"

View file

@ -25,7 +25,6 @@
#include "mozilla/layers/AsyncCanvasRenderer.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "nsAttrValueInlines.h"
#include "nsContentUtils.h"
#include "nsDisplayList.h"

View file

@ -10,7 +10,6 @@
#include "nsPresContext.h"
#include "nsMappedAttributes.h"
#include "nsSize.h"
#include "nsDocument.h"
#include "nsIDocument.h"
#include "nsIDOMMutationEvent.h"
#include "nsIScriptContext.h"
@ -27,7 +26,6 @@
#include "mozilla/dom/HTMLFormElement.h"
#include "nsAttrValueOrString.h"
#include "imgLoader.h"
#include "Image.h"
// Responsive images!
#include "mozilla/dom/HTMLSourceElement.h"
@ -1362,16 +1360,6 @@ HTMLImageElement::MediaFeatureValuesChanged()
QueueImageLoadTask(false);
}
void
HTMLImageElement::FlushUseCounters()
{
nsCOMPtr<imgIRequest> request;
GetRequest(CURRENT_REQUEST, getter_AddRefs(request));
nsCOMPtr<imgIContainer> container;
request->GetImage(getter_AddRefs(container));
}
} // namespace dom
} // namespace mozilla

View file

@ -261,12 +261,6 @@ public:
const nsAString& aMediaAttr,
nsAString& aResult);
/**
* If this image's src pointers to an SVG document, flush the SVG document's
* use counters to telemetry. Only used for testing purposes.
*/
void FlushUseCounters();
protected:
virtual ~HTMLImageElement();

View file

@ -49,7 +49,7 @@ interface nsIJSRAIIHelper;
interface nsIContentPermissionRequest;
interface nsIObserver;
[scriptable, uuid(c471d440-004b-4c50-a6f2-747db5f443b6)]
[scriptable, uuid(7fcc7958-77d9-45ff-8c81-277bde5f0dc8)]
interface nsIDOMWindowUtils : nsISupports {
/**
@ -1938,17 +1938,6 @@ interface nsIDOMWindowUtils : nsISupports {
*/
bool hasRuleProcessorUsedByMultipleStyleSets(in unsigned long aSheetType);
/*
* Force the use counters for the node's associated document(s) to be
* flushed to telemetry. For example, a document node will flush its own
* counters and an image node with an SVG source will flush the SVG
* document's counters. Normally, use counters are flushed to telemetry
* upon document destruction, but as document destruction is somewhat
* non-deterministic, we have this method here for more determinism when
* running tests.
*/
void forceUseCounterFlush(in nsIDOMNode aNode);
void setNextPaintSyncId(in long aSyncId);
/**

View file

@ -40,7 +40,6 @@ var DoPreloadPostfork = function(aCallback) {
Cc["@mozilla.org/appshell/appShellService;1"].getService(Ci["nsIAppShellService"]);
Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci["nsIWindowMediator"]);
Cc["@mozilla.org/base/telemetry;1"].getService(Ci["nsITelemetry"]);
Cc["@mozilla.org/categorymanager;1"].getService(Ci["nsICategoryManager"]);
Cc["@mozilla.org/childprocessmessagemanager;1"].getService(Ci["nsIMessageSender"]);
Cc["@mozilla.org/consoleservice;1"].getService(Ci["nsIConsoleService"]);

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -14,7 +13,6 @@
#include "mozilla/Sprintf.h"
#include "mozilla/StaticMutex.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Logging.h"
#include "nsThreadUtils.h"
#include "CubebUtils.h"

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -8,7 +7,6 @@
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/dom/HTMLMediaElement.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "nsContentUtils.h"
#include "nsPrintfCString.h"
#include "nsSize.h"

View file

@ -1405,22 +1405,6 @@ PeerConnectionObserver.prototype = {
handleIceConnectionStateChange: function(iceConnectionState) {
let pc = this._dompc;
if (pc.iceConnectionState === 'new') {
var checking_histogram = Services.telemetry.getHistogramById("WEBRTC_ICE_CHECKING_RATE");
if (iceConnectionState === 'checking') {
checking_histogram.add(true);
} else if (iceConnectionState === 'failed') {
checking_histogram.add(false);
}
} else if (pc.iceConnectionState === 'checking') {
var success_histogram = Services.telemetry.getHistogramById("WEBRTC_ICE_SUCCESS_RATE");
if (iceConnectionState === 'completed' ||
iceConnectionState === 'connected') {
success_histogram.add(true);
} else if (iceConnectionState === 'failed') {
success_histogram.add(false);
}
}
if (iceConnectionState === 'failed') {
pc.logError("ICE failed, see about:webrtc for more details");

View file

@ -19,23 +19,8 @@ DetailedPromise::DetailedPromise(nsIGlobalObject* aGlobal,
{
}
DetailedPromise::DetailedPromise(nsIGlobalObject* aGlobal,
const nsACString& aName,
Telemetry::ID aSuccessLatencyProbe,
Telemetry::ID aFailureLatencyProbe)
: DetailedPromise(aGlobal, aName)
{
mSuccessLatencyProbe.Construct(aSuccessLatencyProbe);
mFailureLatencyProbe.Construct(aFailureLatencyProbe);
}
DetailedPromise::~DetailedPromise()
{
// It would be nice to assert that mResponded is identical to
// GetPromiseState() == PromiseState::Rejected. But by now we've been
// unlinked, so don't have a reference to our actual JS Promise object
// anymore.
MaybeReportTelemetry(Failed);
}
void
@ -45,8 +30,6 @@ DetailedPromise::MaybeReject(nsresult aArg, const nsACString& aReason)
PromiseFlatCString(aReason).get());
EME_LOG(msg.get());
MaybeReportTelemetry(Failed);
LogToBrowserConsole(NS_ConvertUTF8toUTF16(msg));
ErrorResult rv;
@ -70,32 +53,5 @@ DetailedPromise::Create(nsIGlobalObject* aGlobal,
return aRv.Failed() ? nullptr : promise.forget();
}
/* static */ already_AddRefed<DetailedPromise>
DetailedPromise::Create(nsIGlobalObject* aGlobal,
ErrorResult& aRv,
const nsACString& aName,
Telemetry::ID aSuccessLatencyProbe,
Telemetry::ID aFailureLatencyProbe)
{
RefPtr<DetailedPromise> promise = new DetailedPromise(aGlobal, aName, aSuccessLatencyProbe, aFailureLatencyProbe);
promise->CreateWrapper(nullptr, aRv);
return aRv.Failed() ? nullptr : promise.forget();
}
void
DetailedPromise::MaybeReportTelemetry(Status aStatus)
{
if (mResponded) {
return;
}
mResponded = true;
if (!mSuccessLatencyProbe.WasPassed() || !mFailureLatencyProbe.WasPassed()) {
return;
}
uint32_t latency = (TimeStamp::Now() - mStartTime).ToMilliseconds();
EME_LOG("%s %s latency %ums reported via telemetry", mName.get(),
((aStatus == Succeeded) ? "succcess" : "failure"), latency);
}
} // namespace dom
} // namespace mozilla

View file

@ -7,7 +7,6 @@
#define __DetailedPromise_h__
#include "mozilla/dom/Promise.h"
#include "mozilla/Telemetry.h"
#include "EMEUtils.h"
namespace mozilla {
@ -26,17 +25,10 @@ public:
ErrorResult& aRv,
const nsACString& aName);
static already_AddRefed<DetailedPromise>
Create(nsIGlobalObject* aGlobal, ErrorResult& aRv,
const nsACString& aName,
Telemetry::ID aSuccessLatencyProbe,
Telemetry::ID aFailureLatencyProbe);
template <typename T>
void MaybeResolve(const T& aArg)
{
EME_LOG("%s promise resolved", mName.get());
MaybeReportTelemetry(Succeeded);
Promise::MaybeResolve<T>(aArg);
}
@ -50,20 +42,13 @@ private:
explicit DetailedPromise(nsIGlobalObject* aGlobal,
const nsACString& aName);
explicit DetailedPromise(nsIGlobalObject* aGlobal,
const nsACString& aName,
Telemetry::ID aSuccessLatencyProbe,
Telemetry::ID aFailureLatencyProbe);
virtual ~DetailedPromise();
enum Status { Succeeded, Failed };
void MaybeReportTelemetry(Status aStatus);
nsCString mName;
bool mResponded;
TimeStamp mStartTime;
Optional<Telemetry::ID> mSuccessLatencyProbe;
Optional<Telemetry::ID> mFailureLatencyProbe;
};
} // namespace dom

View file

@ -92,17 +92,4 @@ KeySystemToGMPName(const nsAString& aKeySystem)
return EmptyString();
}
CDMType
ToCDMTypeTelemetryEnum(const nsString& aKeySystem)
{
if (IsWidevineKeySystem(aKeySystem)) {
return CDMType::eWidevine;
} else if (IsClearkeyKeySystem(aKeySystem)) {
return CDMType::eClearKey;
} else if (IsPrimetimeKeySystem(aKeySystem)) {
return CDMType::ePrimetime;
}
return CDMType::eUnknown;
}
} // namespace mozilla

View file

@ -103,9 +103,6 @@ enum CDMType {
eUnknown = 3
};
CDMType
ToCDMTypeTelemetryEnum(const nsString& aKeySystem);
} // namespace mozilla
#endif // EME_LOG_H_

View file

@ -24,8 +24,6 @@
using mozilla::ipc::GeckoChildProcessHost;
#include "mozilla/Telemetry.h"
#ifdef XP_WIN
#include "WMFDecoderModule.h"
#endif

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -10,7 +9,6 @@
#include "WMFUtils.h"
#include "nsTArray.h"
#include "TimeUnits.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Logging.h"
#define LOG(...) MOZ_LOG(sPDMLog, mozilla::LogLevel::Debug, (__VA_ARGS__))
@ -250,10 +248,6 @@ WMFAudioMFTManager::Output(int64_t aStreamOffset,
if (!sample) {
LOG("Audio MFTDecoder returned success but null output.");
nsCOMPtr<nsIRunnable> task = NS_NewRunnableFunction([]() -> void {
LOG("Reporting telemetry AUDIO_MFT_OUTPUT_NULL_SAMPLES");
});
AbstractThread::MainThread()->Dispatch(task.forget());
return E_FAIL;
}

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -25,7 +24,6 @@
#include "gfxWindowsPlatform.h"
#include "IMFYCbCrImage.h"
#include "mozilla/WindowsVersion.h"
#include "mozilla/Telemetry.h"
#include "nsPrintfCString.h"
#include "GMPUtils.h" // For SplitAt. TODO: Move SplitAt to a central place.
#include "MP4Decoder.h"
@ -116,19 +114,6 @@ WMFVideoMFTManager::~WMFVideoMFTManager()
if (mDXVA2Manager) {
DeleteOnMainThread(mDXVA2Manager);
}
// Record whether the video decoder successfully decoded, or output null
// samples but did/didn't recover.
uint32_t telemetry = (mNullOutputCount == 0) ? 0 :
(mGotValidOutputAfterNullOutput && mGotExcessiveNullOutput) ? 1 :
mGotExcessiveNullOutput ? 2 :
mGotValidOutputAfterNullOutput ? 3 :
4;
nsCOMPtr<nsIRunnable> task = NS_NewRunnableFunction([=]() -> void {
LOG(nsPrintfCString("Reporting telemetry VIDEO_MFT_OUTPUT_NULL_SAMPLES=%d", telemetry).get());
});
AbstractThread::MainThread()->Dispatch(task.forget());
}
const GUID&

View file

@ -88,7 +88,6 @@
#include "nsIContentPolicy.h"
#include "nsContentPolicyUtils.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/Telemetry.h"
#include "nsIImageLoadingContent.h"
#include "mozilla/Preferences.h"
#include "nsVersionComparator.h"

View file

@ -11,7 +11,6 @@
#include "mozilla/plugins/PluginInstanceParent.h"
#include "mozilla/plugins/PluginModuleParent.h"
#include "mozilla/plugins/PluginScriptableObjectParent.h"
#include "mozilla/Telemetry.h"
#include "nsJSNPRuntime.h"
#include "nsNPAPIPlugin.h"
#include "nsNPAPIPluginInstance.h"

View file

@ -30,33 +30,6 @@ using mozilla::widget::WidgetUtils;
using std::string;
using std::vector;
namespace {
class nsPluginHangUITelemetry : public mozilla::Runnable
{
public:
nsPluginHangUITelemetry(int aResponseCode, int aDontAskCode,
uint32_t aResponseTimeMs, uint32_t aTimeoutMs)
: mResponseCode(aResponseCode),
mDontAskCode(aDontAskCode),
mResponseTimeMs(aResponseTimeMs),
mTimeoutMs(aTimeoutMs)
{
}
NS_IMETHOD
Run() override
{
return NS_OK;
}
private:
int mResponseCode;
int mDontAskCode;
uint32_t mResponseTimeMs;
uint32_t mTimeoutMs;
};
} // namespace
namespace mozilla {
namespace plugins {
@ -358,11 +331,6 @@ PluginHangUIParent::RecvUserResponse(const unsigned int& aResponse)
responseCode = 3;
}
int dontAskCode = (aResponse & HANGUI_USER_RESPONSE_DONT_SHOW_AGAIN) ? 1 : 0;
nsCOMPtr<nsIRunnable> workItem = new nsPluginHangUITelemetry(responseCode,
dontAskCode,
LastShowDurationMs(),
mTimeoutPrefMs);
NS_DispatchToMainThread(workItem);
return true;
}

View file

@ -769,8 +769,6 @@ PluginInstanceParent::SetCurrentImage(Image* aImage)
gfx::IntRect rect = aImage->GetPictureRect();
NPRect nprect = {uint16_t(rect.x), uint16_t(rect.y), uint16_t(rect.width), uint16_t(rect.height)};
RecvNPN_InvalidateRect(nprect);
RecordDrawingModel();
}
bool
@ -907,7 +905,6 @@ PluginInstanceParent::RecvShow(const NPRect& updatedRect,
PLUGIN_LOG_DEBUG((" (RecvShow invalidated for surface %p)",
mFrontSurface.get()));
RecordDrawingModel();
return true;
}
@ -1273,7 +1270,6 @@ PluginInstanceParent::NPP_SetWindow(const NPWindow* aWindow)
return NPERR_GENERIC_ERROR;
}
RecordDrawingModel();
return NPERR_NO_ERROR;
}
@ -2232,28 +2228,3 @@ PluginInstanceParent::RecvOnWindowedPluginKeyEvent(
owner->OnWindowedPluginKeyEvent(aKeyEventData);
return true;
}
void
PluginInstanceParent::RecordDrawingModel()
{
int mode = -1;
switch (mWindowType) {
case NPWindowTypeWindow:
// We use 0=windowed since there is no specific NPDrawingModel value.
mode = 0;
break;
case NPWindowTypeDrawable:
mode = mDrawingModel + 1;
break;
default:
MOZ_ASSERT_UNREACHABLE("bad window type");
return;
}
if (mode == mLastRecordedDrawingModel) {
return;
}
MOZ_ASSERT(mode >= 0);
mLastRecordedDrawingModel = mode;
}

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: sw=4 ts=4 et :
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -387,9 +386,6 @@ private:
void SetCurrentImage(layers::Image* aImage);
// Update Telemetry with the current drawing model.
void RecordDrawingModel();
private:
PluginModuleParent* mParent;
RefPtr<PluginAsyncSurrogate> mSurrogate;

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: sw=4 ts=4 et :
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -11,7 +10,6 @@
#include "mozilla/ipc/BrowserProcessSubThread.h"
#include "mozilla/plugins/PluginMessageUtils.h"
#include "mozilla/Telemetry.h"
#include "nsThreadUtils.h"
using std::vector;

View file

@ -92,8 +92,6 @@ Push.prototype = {
subscribe: function(options) {
console.debug("subscribe()", this._scope);
let histogram = Services.telemetry.getHistogramById("PUSH_API_USED");
histogram.add(true);
return this.askPermission().then(() =>
this.createPromise((resolve, reject) => {
let callback = new PushSubscriptionCallback(this, resolve, reject);
@ -180,20 +178,14 @@ Push.prototype = {
principal: this._principal,
QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPermissionRequest]),
allow: function() {
let histogram = Services.telemetry.getHistogramById("PUSH_API_PERMISSION_GRANTED");
histogram.add();
allowCallback();
},
cancel: function() {
let histogram = Services.telemetry.getHistogramById("PUSH_API_PERMISSION_DENIED");
histogram.add();
cancelCallback();
},
window: this._window,
};
let histogram = Services.telemetry.getHistogramById("PUSH_API_PERMISSION_REQUESTED");
histogram.add(1);
// Using askPermission from nsIDOMWindowUtils that takes care of the
// remoting if needed.
let windowUtils = this._window.QueryInterface(Ci.nsIInterfaceRequestor)

View file

@ -84,7 +84,6 @@ PushRecord.prototype = {
Math.round(8 * Math.pow(daysElapsed, -0.8)),
prefs.get("maxQuotaPerSubscription")
);
Services.telemetry.getHistogramById("PUSH_API_QUOTA_RESET_TO").add(this.quota);
}
},
@ -125,7 +124,6 @@ PushRecord.prototype = {
// We check for ctime > 0 to skip older records that did not have ctime.
if (this.isExpired() && this.ctime > 0) {
let duration = Date.now() - this.ctime;
Services.telemetry.getHistogramById("PUSH_API_QUOTA_EXPIRATION_TIME").add(duration / 1000);
}
},

View file

@ -1,4 +1,3 @@
/* jshint moz: true, esnext: true */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -51,16 +50,6 @@ const PUSH_SERVICE_CONNECTION_DISABLE = 3;
const PUSH_SERVICE_ACTIVE_OFFLINE = 4;
const PUSH_SERVICE_RUNNING = 5;
// Telemetry failure to send push notification to Service Worker reasons.
// Key not found in local database.
const kDROP_NOTIFICATION_REASON_KEY_NOT_FOUND = 0;
// User cleared history.
const kDROP_NOTIFICATION_REASON_NO_HISTORY = 1;
// Version of message received not newer than previous one.
const kDROP_NOTIFICATION_REASON_NO_VERSION_INCREMENT = 2;
// Subscription has expired.
const kDROP_NOTIFICATION_REASON_EXPIRED = 3;
/**
* State is change only in couple of functions:
* init - change state to PUSH_SERVICE_INIT if state was PUSH_SERVICE_UNINIT
@ -655,7 +644,6 @@ this.PushService = {
return;
}
Services.telemetry.getHistogramById("PUSH_API_NOTIFY_REGISTRATION_LOST").add();
gPushNotifier.notifySubscriptionChange(record.scope, record.principal);
},
@ -729,12 +717,6 @@ this.PushService = {
});
},
_recordDidNotNotify: function(reason) {
Services.telemetry.
getHistogramById("PUSH_API_NOTIFICATION_RECEIVED_BUT_DID_NOT_NOTIFY").
add(reason);
},
/**
* Dispatches an incoming message to a service worker, recalculating the
* quota for the associated push registration. If the quota is exceeded,
@ -757,7 +739,6 @@ this.PushService = {
*/
receivedPushMessage(keyID, messageID, headers, data, updateFunc) {
console.debug("receivedPushMessage()");
Services.telemetry.getHistogramById("PUSH_API_NOTIFICATION_RECEIVED").add();
return this._updateRecordAfterPush(keyID, updateFunc).then(record => {
if (record.quotaApplies()) {
@ -790,14 +771,12 @@ this.PushService = {
_updateRecordAfterPush(keyID, updateFunc) {
return this.getByKeyID(keyID).then(record => {
if (!record) {
this._recordDidNotNotify(kDROP_NOTIFICATION_REASON_KEY_NOT_FOUND);
throw new Error("No record for key ID " + keyID);
}
return record.getLastVisit().then(lastVisit => {
// As a special case, don't notify the service worker if the user
// cleared their history.
if (!isFinite(lastVisit)) {
this._recordDidNotNotify(kDROP_NOTIFICATION_REASON_NO_HISTORY);
throw new Error("Ignoring message sent to unvisited origin");
}
return lastVisit;
@ -807,7 +786,6 @@ this.PushService = {
return this._db.update(keyID, record => {
let newRecord = updateFunc(record);
if (!newRecord) {
this._recordDidNotNotify(kDROP_NOTIFICATION_REASON_NO_VERSION_INCREMENT);
return null;
}
// Because `unregister` is advisory only, we can still receive messages
@ -871,7 +849,6 @@ this.PushService = {
return record;
}).then(record => {
if (record.isExpired()) {
this._recordDidNotNotify(kDROP_NOTIFICATION_REASON_EXPIRED);
// Drop the registration in the background. If the user returns to the
// site, the service worker will be notified on the next `idle-daily`
// event.
@ -945,11 +922,6 @@ this.PushService = {
let payload = ArrayBuffer.isView(message) ?
new Uint8Array(message.buffer) : message;
if (aPushRecord.quotaApplies()) {
// Don't record telemetry for chrome push messages.
Services.telemetry.getHistogramById("PUSH_API_NOTIFY").add();
}
if (payload) {
gPushNotifier.notifyPushWithData(aPushRecord.scope,
aPushRecord.principal,
@ -998,7 +970,6 @@ this.PushService = {
_registerWithServer: function(aPageRecord) {
console.debug("registerWithServer()", aPageRecord);
Services.telemetry.getHistogramById("PUSH_API_SUBSCRIBE_ATTEMPT").add();
return this._sendRequest("register", aPageRecord)
.then(record => this._onRegisterSuccess(record),
err => this._onRegisterError(err))
@ -1014,12 +985,9 @@ this.PushService = {
},
_sendUnregister(aRecord, aReason) {
Services.telemetry.getHistogramById("PUSH_API_UNSUBSCRIBE_ATTEMPT").add();
return this._sendRequest("unregister", aRecord, aReason).then(function(v) {
Services.telemetry.getHistogramById("PUSH_API_UNSUBSCRIBE_SUCCEEDED").add();
return v;
}).catch(function(e) {
Services.telemetry.getHistogramById("PUSH_API_UNSUBSCRIBE_FAILED").add();
return Promise.reject(e);
});
},
@ -1033,11 +1001,9 @@ this.PushService = {
return this._db.put(aRecord)
.then(record => {
Services.telemetry.getHistogramById("PUSH_API_SUBSCRIBE_SUCCEEDED").add();
return record;
})
.catch(error => {
Services.telemetry.getHistogramById("PUSH_API_SUBSCRIBE_FAILED").add()
// Unable to save. Destroy the subscription in the background.
this._backgroundUnregister(aRecord,
Ci.nsIPushErrorReporter.UNSUBSCRIBE_MANUAL);
@ -1051,7 +1017,6 @@ this.PushService = {
*/
_onRegisterError: function(reply) {
console.debug("_onRegisterError()");
Services.telemetry.getHistogramById("PUSH_API_SUBSCRIBE_FAILED").add()
if (!reply.error) {
console.warn("onRegisterError: Called without valid error message!",
reply);

View file

@ -1,4 +1,3 @@
/* jshint moz: true, esnext: true */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -332,7 +331,6 @@ SubscriptionListener.prototype = {
ctime: Date.now(),
});
Services.telemetry.getHistogramById("PUSH_API_SUBSCRIBE_HTTP2_TIME").add(Date.now() - this._ctime);
this._resolve(reply);
},

View file

@ -1,4 +1,3 @@
/* jshint moz: true, esnext: true */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -638,7 +637,6 @@ this.PushServiceWebSocket = {
appServerKey: tmp.record.appServerKey,
ctime: Date.now(),
});
Services.telemetry.getHistogramById("PUSH_API_SUBSCRIBE_WS_TIME").add(Date.now() - tmp.ctime);
tmp.resolve(record);
} else {
console.error("handleRegisterReply: Unexpected server response", reply);

View file

@ -1150,7 +1150,7 @@ public:
MappedAttrParser(css::Loader* aLoader,
nsIURI* aDocURI,
already_AddRefed<nsIURI> aBaseURI,
nsSVGElement* aElement);
nsIPrincipal* aNodePrincipal);
~MappedAttrParser();
// Parses a mapped attribute value.
@ -1170,20 +1170,18 @@ private:
// Arguments for nsCSSParser::ParseProperty
nsIURI* mDocURI;
nsCOMPtr<nsIURI> mBaseURI;
nsIPrincipal* mNodePrincipal;
// Declaration for storing parsed values (lazily initialized)
css::Declaration* mDecl;
// For reporting use counters
nsSVGElement* mElement;
};
MappedAttrParser::MappedAttrParser(css::Loader* aLoader,
nsIURI* aDocURI,
already_AddRefed<nsIURI> aBaseURI,
nsSVGElement* aElement)
nsIPrincipal* aNodePrincipal)
: mParser(aLoader), mDocURI(aDocURI), mBaseURI(aBaseURI),
mDecl(nullptr), mElement(aElement)
mNodePrincipal(aNodePrincipal), mDecl(nullptr)
{
}
@ -1208,27 +1206,9 @@ MappedAttrParser::ParseMappedAttrValue(nsIAtom* aMappedAttrName,
nsCSSProps::LookupProperty(nsDependentAtomString(aMappedAttrName),
CSSEnabledState::eForAllContent);
if (propertyID != eCSSProperty_UNKNOWN) {
bool changed = false; // outparam for ParseProperty.
bool changed; // outparam for ParseProperty. (ignored)
mParser.ParseProperty(propertyID, aMappedAttrValue, mDocURI, mBaseURI,
mElement->NodePrincipal(), mDecl, &changed, false, true);
if (changed) {
// The normal reporting of use counters by the nsCSSParser won't happen
// since it doesn't have a sheet.
if (nsCSSProps::IsShorthand(propertyID)) {
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(subprop, propertyID,
CSSEnabledState::eForAllContent) {
UseCounter useCounter = nsCSSProps::UseCounterFor(*subprop);
if (useCounter != eUseCounter_UNKNOWN) {
mElement->OwnerDoc()->SetDocumentAndPageUseCounter(useCounter);
}
}
} else {
UseCounter useCounter = nsCSSProps::UseCounterFor(propertyID);
if (useCounter != eUseCounter_UNKNOWN) {
mElement->OwnerDoc()->SetDocumentAndPageUseCounter(useCounter);
}
}
}
mNodePrincipal, mDecl, &changed, false, true);
return;
}
MOZ_ASSERT(aMappedAttrName == nsGkAtoms::lang,
@ -1275,7 +1255,7 @@ nsSVGElement::UpdateContentStyleRule()
nsIDocument* doc = OwnerDoc();
MappedAttrParser mappedAttrParser(doc->CSSLoader(), doc->GetDocumentURI(),
GetBaseURI(), this);
GetBaseURI(), NodePrincipal());
for (uint32_t i = 0; i < attrCount; ++i) {
const nsAttrName* attrName = mAttrsAndChildren.AttrNameAt(i);
@ -1366,7 +1346,7 @@ nsSVGElement::UpdateAnimatedContentStyleRule()
}
MappedAttrParser mappedAttrParser(doc->CSSLoader(), doc->GetDocumentURI(),
GetBaseURI(), this);
GetBaseURI(), NodePrincipal());
doc->PropertyTable(SMIL_MAPPED_ATTR_ANIMVAL)->
Enumerate(this, ParseMappedAttrAnimValueCallback, &mappedAttrParser);

View file

@ -13,7 +13,7 @@ interface External
// Mozilla extension
partial interface External {
[UnsafeInPrerendering, UseCounter]
[UnsafeInPrerendering]
void addSearchEngine(DOMString engineURL, DOMString iconURL,
DOMString suggestedTitle, DOMString suggestedCategory);
};

View file

@ -25,38 +25,30 @@ interface OfflineResourceList : EventTarget {
/* The application cache group is now obsolete. */
const unsigned short OBSOLETE = 5;
[Throws, UseCounter]
[Throws]
readonly attribute unsigned short status;
/**
* Begin the application update process on the associated application cache.
*/
[Throws, UseCounter]
[Throws]
void update();
/**
* Swap in the newest version of the application cache, or disassociate
* from the cache if the cache group is obsolete.
*/
[Throws, UseCounter]
[Throws]
void swapCache();
/* Events */
[UseCounter]
attribute EventHandler onchecking;
[UseCounter]
attribute EventHandler onerror;
[UseCounter]
attribute EventHandler onnoupdate;
[UseCounter]
attribute EventHandler ondownloading;
[UseCounter]
attribute EventHandler onprogress;
[UseCounter]
attribute EventHandler onupdateready;
[UseCounter]
attribute EventHandler oncached;
[UseCounter]
attribute EventHandler onobsolete;
};

View file

@ -25,7 +25,7 @@ interface PushManagerImpl {
[Exposed=(Window,Worker), Func="nsContentUtils::PushEnabled",
ChromeConstructor(DOMString scope)]
interface PushManager {
[Throws, UseCounter]
[Throws]
Promise<PushSubscription> subscribe(optional PushSubscriptionOptionsInit options);
[Throws]
Promise<PushSubscription?> getSubscription();

View file

@ -44,7 +44,7 @@ interface PushSubscription
readonly attribute PushSubscriptionOptions options;
[Throws]
ArrayBuffer? getKey(PushEncryptionKeyName name);
[Throws, UseCounter]
[Throws]
Promise<boolean> unsubscribe();
// Implements the custom serializer specified in Push API, section 9.

View file

@ -33,7 +33,6 @@ interface SVGSVGElement : SVGGraphicsElement {
readonly attribute float screenPixelToMillimeterY;
readonly attribute boolean useCurrentView;
// readonly attribute SVGViewSpec currentView;
[UseCounter]
attribute float currentScale;
readonly attribute SVGPoint currentTranslate;
@ -71,7 +70,6 @@ interface SVGSVGElement : SVGGraphicsElement {
SVGTransform createSVGTransform();
[NewObject]
SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix);
[UseCounter]
Element? getElementById(DOMString elementId);
};

View file

@ -368,7 +368,7 @@ Window implements OnErrorEventHandlerForWindow;
#ifdef HAVE_SIDEBAR
// Mozilla extension
partial interface Window {
[Replaceable, Throws, UseCounter]
[Replaceable, Throws]
readonly attribute (External or WindowProxy) sidebar;
};
#endif

View file

@ -7,7 +7,6 @@
#define mozilla_dom_workers_ServiceWorkerRegistrar_h
#include "mozilla/Monitor.h"
#include "mozilla/Telemetry.h"
#include "nsClassHashtable.h"
#include "nsIObserver.h"
#include "nsCOMPtr.h"

View file

@ -65,7 +65,6 @@
#include "nsAsyncRedirectVerifyHelper.h"
#include "nsStringBuffer.h"
#include "nsIFileChannel.h"
#include "mozilla/Telemetry.h"
#include "jsfriendapi.h"
#include "GeckoProfiler.h"
#include "mozilla/dom/EncodingUtils.h"

View file

@ -21,7 +21,6 @@
#include "mozilla/dom/ProgressEvent.h"
#include "mozilla/dom/StructuredCloneHolder.h"
#include "mozilla/dom/URLSearchParams.h"
#include "mozilla/Telemetry.h"
#include "nsComponentManagerUtils.h"
#include "nsContentUtils.h"
#include "nsJSUtils.h"

View file

@ -26,7 +26,6 @@
#include "mozilla/Preferences.h"
#include "mozilla/scache/StartupCache.h"
#include "mozilla/scache/StartupCacheUtils.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
using namespace mozilla::scache;

View file

@ -561,10 +561,6 @@ typedef Log<LOG_CRITICAL, CriticalLogger> CriticalLog;
#define gfxWarning mozilla::gfx::WarningLog
#define gfxWarningOnce static gfxWarning GFX_LOGGING_GLUE(sOnceAtLine,__LINE__) = gfxWarning
// In the debug build, this is equivalent to the default gfxCriticalError.
// In the non-debug build, on nightly and dev edition, it will MOZ_CRASH.
// On beta and release versions, it will telemetry count, but proceed.
//
// You should create a (new) enum in the LogReason and use it for the reason
// parameter to ensure uniqueness.
#define gfxDevCrash(reason) gfxCriticalError(int(gfx::LogOptions::AutoPrefix) | int(gfx::LogOptions::AssertOnCall) | int(gfx::LogOptions::CrashAction), (reason))

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: sts=8 sw=2 ts=2 tw=99 et :
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -85,10 +84,8 @@ public:
return !!mGPUChild;
}
// Return the time stamp for when we tried to launch the GPU process. This is
// currently used for Telemetry so that we can determine how long GPU processes
// take to spin up. Note this doesn't denote a successful launch, just when we
// attempted launch.
// Return the time stamp for when we tried to launch the GPU process.
// Note this doesn't denote a successful launch, just when we attempted launch.
TimeStamp GetLaunchTime() const {
return mLaunchTime;
}

View file

@ -228,14 +228,14 @@ public:
uint32_t GetCheckerboardMagnitude() const;
/**
* Report the number of CSSPixel-milliseconds of checkerboard to telemetry.
* Report the number of CSSPixel-milliseconds of checkerboard.
*/
void ReportCheckerboard(const TimeStamp& aSampleTime);
/**
* Flush any active checkerboard report that's in progress. This basically
* pretends like any in-progress checkerboard event has terminated, and pushes
* out the report to the checkerboard reporting service and telemetry. If the
* out the report to the checkerboard reporting service. If the
* checkerboard event has not really finished, it will start a new event
* on the next composite.
*/

View file

@ -157,8 +157,7 @@ private:
private:
/**
* If true, we should log the various properties during the checkerboard
* event. If false, we only need to record things we need for telemetry
* measures.
* event.
*/
const bool mRecordTrace;
/**

View file

@ -46,7 +46,7 @@ InputBlockState::SetConfirmedTargetApzc(const RefPtr<AsyncPanZoomController>& aT
aState == TargetConfirmationState::eConfirmed) {
// The main thread finally responded. We had already timed out the
// confirmation, but we want to update the state internally so that we
// can record the time for telemetry purposes.
// can record the time.
mTargetConfirmed = TargetConfirmationState::eTimedOutAndMainThreadResponded;
}
if (mTargetConfirmed != TargetConfirmationState::eUnconfirmed) {

View file

@ -143,8 +143,7 @@ public:
/**
* This should be called when a content response notification has been
* delivered to this block. If all the notifications have arrived, this
* will report the total time take to telemetry.
* delivered to this block.
*/
void RecordContentResponseTime();

View file

@ -11,7 +11,6 @@ namespace layers {
/**
* An enumeration that lists various input methods used to trigger scrolling.
* Used as the values for the SCROLL_INPUT_METHODS telemetry histogram.
*/
enum class ScrollInputMethod {

View file

@ -25,7 +25,6 @@
#include "mozilla/widget/WinCompositorWidget.h"
#include "mozilla/EnumeratedArray.h"
#include "mozilla/Telemetry.h"
#include "BlendShaderConstants.h"
#include "D3D11ShareHandleImage.h"
@ -1376,9 +1375,6 @@ DeviceAttachmentsD3D11::InitSyncObject()
if (FAILED(hr) || !mSyncHandle) {
gfxCriticalError() << "Failed to get SharedHandle for sync texture. Result: "
<< hexa(hr);
NS_DispatchToMainThread(NS_NewRunnableFunction([] () -> void {
Accumulate(Telemetry::D3D11_SYNC_HANDLE_FAILURE, 1);
}));
return false;
}

View file

@ -49,7 +49,6 @@
#include "mozilla/layout/RenderFrameParent.h"
#include "mozilla/media/MediaSystemResourceService.h" // for MediaSystemResourceService
#include "mozilla/mozalloc.h" // for operator new, etc
#include "mozilla/Telemetry.h"
#ifdef MOZ_WIDGET_GTK
#include "basic/X11BasicCompositor.h" // for X11BasicCompositor
#endif
@ -70,7 +69,6 @@
#include "mozilla/Hal.h"
#include "mozilla/HalTypes.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/Telemetry.h"
#include "mozilla/VsyncDispatcher.h"
#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
#include "VsyncSource.h"

View file

@ -70,8 +70,6 @@ public:
// Force gfxDevCrash to use MOZ_CRASH in Beta and Release
DECL_GFX_ENV("MOZ_GFX_CRASH_MOZ_CRASH", GfxDevCrashMozCrash);
// Force gfxDevCrash to use telemetry in Nightly and Aurora
DECL_GFX_ENV("MOZ_GFX_CRASH_TELEMETRY", GfxDevCrashTelemetry);
DECL_GFX_ENV("MOZ_GFX_VR_NO_DISTORTION", VRNoDistortion);

View file

@ -34,7 +34,6 @@
#include "mozilla/MemoryReporting.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
#include "mozilla/Telemetry.h"
#include "gfxSVGGlyphs.h"
#include "gfx2DGlue.h"

View file

@ -28,7 +28,6 @@
#include "GeckoProfiler.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Telemetry.h"
#include "mozilla/WindowsVersion.h"
#include <usp10.h>

View file

@ -159,9 +159,7 @@ public:
static gfxPlatform *GetPlatform();
/**
* Returns whether or not graphics has been initialized yet. This is
* intended for Telemetry where we don't necessarily want to initialize
* graphics just to observe its state.
* Returns whether or not graphics has been initialized yet.
*/
static bool Initialized();

View file

@ -17,7 +17,6 @@
#include "gfxFontConstants.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
#include "mozilla/Telemetry.h"
#include "mozilla/gfx/2D.h"
#include "gfxPlatformFontList.h"

View file

@ -13,7 +13,6 @@
#include "nsProxyRelease.h"
#include "nsServiceManagerUtils.h"
#include "nsComponentManagerUtils.h"
#include "mozilla/Telemetry.h"
using mozilla::gfx::IntSize;
using mozilla::gfx::SurfaceFormat;
@ -21,29 +20,6 @@ using mozilla::gfx::SurfaceFormat;
namespace mozilla {
namespace image {
class MOZ_STACK_CLASS AutoRecordDecoderTelemetry final
{
public:
explicit AutoRecordDecoderTelemetry(Decoder* aDecoder)
: mDecoder(aDecoder)
{
MOZ_ASSERT(mDecoder);
// Begin recording telemetry data.
mStartTime = TimeStamp::Now();
}
~AutoRecordDecoderTelemetry()
{
// Finish telemetry.
mDecoder->mDecodeTime += (TimeStamp::Now() - mStartTime);
}
private:
Decoder* mDecoder;
TimeStamp mStartTime;
};
Decoder::Decoder(RasterImage* aImage)
: mImageData(nullptr)
, mImageDataLength(0)
@ -124,7 +100,6 @@ Decoder::Decode(IResumable* aOnResume /* = nullptr */)
LexerResult lexerResult(TerminalState::FAILURE);
{
PROFILER_LABEL("ImageDecoder", "Decode", js::ProfileEntry::Category::GRAPHICS);
AutoRecordDecoderTelemetry telemetry(this);
lexerResult = DoDecode(*mIterator, aOnResume);
};
@ -267,16 +242,6 @@ Decoder::FinalStatus() const
ShouldReportError());
}
DecoderTelemetry
Decoder::Telemetry() const
{
MOZ_ASSERT(mIterator);
return DecoderTelemetry(SpeedHistogram(),
mIterator->ByteCount(),
mIterator->ChunkCount(),
mDecodeTime);
}
nsresult
Decoder::AllocateFrame(const gfx::IntSize& aOutputSize,
const gfx::IntRect& aFrameRect,

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