Browse Source

Issue #21 - Remove remaining telemetry structs, callers and flags.

pull/28/head
Moonchild 9 months ago committed by roytam1
parent
commit
eaf9e756a0
  1. 53
      image/Decoder.h
  2. 4
      image/RasterImage.h
  3. 3
      js/xpconnect/idl/xpccomponents.idl
  4. 23
      js/xpconnect/src/XPCComponents.cpp
  5. 6
      js/xpconnect/src/XPCShellImpl.cpp
  6. 6
      js/xpconnect/src/XPCWrappedNativeJSOps.cpp
  7. 9
      layout/tools/reftest/reftest-preferences.js
  8. 11
      mailnews/db/gloda/modules/datastore.js
  9. 19
      mailnews/db/gloda/modules/indexer.js
  10. 4
      mailnews/local/src/nsPop3Sink.cpp
  11. 25
      modules/libpref/Preferences.cpp
  12. 6
      modules/libpref/goanna.js
  13. 16
      modules/libpref/init/all.js
  14. 3
      mozglue/misc/TimeStamp.cpp
  15. 7
      netwerk/base/Predictor.cpp
  16. 15
      netwerk/base/nsIAuthModule.idl
  17. 3
      netwerk/base/nsIBrowserSearchService.idl
  18. 6
      netwerk/base/nsISpeculativeConnect.idl
  19. 2
      netwerk/base/security-prefs.js
  20. 2
      netwerk/cache/nsDiskCache.h
  21. 2
      netwerk/cache2/CacheFileMetadata.cpp
  22. 7
      netwerk/protocol/http/AlternateServices.cpp
  23. 38
      netwerk/protocol/http/nsHttpChannel.cpp
  24. 2
      netwerk/protocol/http/nsHttpConnection.h
  25. 15
      netwerk/protocol/http/nsHttpConnectionMgr.cpp
  26. 11
      netwerk/protocol/http/nsHttpConnectionMgr.h
  27. 4
      netwerk/protocol/http/nsHttpHandler.cpp
  28. 31
      netwerk/protocol/websocket/WebSocketChannel.cpp
  29. 3
      netwerk/protocol/websocket/WebSocketChannel.h
  30. 2
      parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/Tokenizer.java
  31. 13
      security/certverifier/CertVerifier.cpp
  32. 3
      security/certverifier/CertVerifier.h
  33. 2
      security/certverifier/OCSPVerificationTrustDomain.cpp
  34. 2
      security/manager/ssl/nsCertOverrideService.h
  35. 1
      security/manager/ssl/nsNSSCallbacks.cpp
  36. 13
      startupcache/StartupCache.cpp
  37. 2
      startupcache/StartupCache.h
  38. 4
      startupcache/nsIStartupCache.idl
  39. 50
      startupcache/test/TestStartupCache.cpp
  40. 60
      startupcache/test/TestStartupCacheTelemetry.js
  41. 2
      startupcache/test/TestStartupCacheTelemetry.manifest
  42. 4
      startupcache/test/moz.build
  43. 3
      widget/nsIGfxInfo.idl
  44. 4
      widget/windows/WinUtils.cpp
  45. 6
      xpcom/base/nsIMemoryReporter.idl
  46. 3
      xpcom/build/nsXULAppAPI.h
  47. 10
      xpcom/glue/FileUtils.h
  48. 7
      xpcom/system/nsICrashReporter.idl
  49. 1
      xpcom/tests/TestHarness.h
  50. 3
      xpcom/threads/HangAnnotations.cpp

53
image/Decoder.h

@ -23,10 +23,6 @@
namespace mozilla {
namespace Telemetry {
enum ID : uint32_t;
} // namespace Telemetry
namespace image {
class imgFrame;
@ -57,41 +53,6 @@ struct DecoderFinalStatus final
const bool mShouldReportError : 1;
};
struct DecoderTelemetry final
{
DecoderTelemetry(Maybe<Telemetry::ID> aSpeedHistogram,
size_t aBytesDecoded,
uint32_t aChunkCount,
TimeDuration aDecodeTime)
: mSpeedHistogram(aSpeedHistogram)
, mBytesDecoded(aBytesDecoded)
, mChunkCount(aChunkCount)
, mDecodeTime(aDecodeTime)
{ }
/// @return our decoder's speed, in KBps.
int32_t Speed() const
{
return mBytesDecoded / (1024 * mDecodeTime.ToSeconds());
}
/// @return our decoder's decode time, in microseconds.
int32_t DecodeTimeMicros() { return mDecodeTime.ToMicroseconds(); }
/// The per-image-format telemetry ID for recording our decoder's speed, or
/// Nothing() if we don't record speed telemetry for this kind of decoder.
const Maybe<Telemetry::ID> mSpeedHistogram;
/// The number of bytes of input our decoder processed.
const size_t mBytesDecoded;
/// The number of chunks our decoder's input was divided into.
const uint32_t mChunkCount;
/// The amount of time our decoder spent inside DoDecode().
const TimeDuration mDecodeTime;
};
class Decoder
{
public:
@ -359,9 +320,6 @@ public:
/// @return the metadata we collected about this image while decoding.
const ImageMetadata& GetImageMetadata() { return mImageMetadata; }
/// @return performance telemetry we collected while decoding.
DecoderTelemetry Telemetry() const;
/**
* @return a weak pointer to the image associated with this decoder. Illegal
* to call if this decoder is not associated with an image.
@ -383,7 +341,6 @@ public:
protected:
friend class AutoRecordDecoderTelemetry;
friend class nsICODecoder;
friend class PalettedSurfaceSink;
friend class SurfaceSink;
@ -405,13 +362,6 @@ protected:
virtual nsresult FinishInternal();
virtual nsresult FinishWithErrorInternal();
/**
* @return the per-image-format telemetry ID for recording this decoder's
* speed, or Nothing() if we don't record speed telemetry for this kind of
* decoder.
*/
virtual Maybe<Telemetry::ID> SpeedHistogram() const { return Nothing(); }
/*
* Progress notifications.
@ -534,9 +484,6 @@ private:
gfx::IntRect mFirstFrameRefreshArea; // The area of the image that needs to
// be invalidated when the animation loops.
// Telemetry data for this decoder.
TimeDuration mDecodeTime;
DecoderFlags mDecoderFlags;
SurfaceFlags mSurfaceFlags;

4
image/RasterImage.h

@ -137,7 +137,6 @@ namespace image {
class Decoder;
struct DecoderFinalStatus;
struct DecoderTelemetry;
class ImageMetadata;
class SourceBuffer;
@ -205,14 +204,13 @@ public:
/**
* Records decoding results, sends out any final notifications, updates the
* state of this image, and records telemetry.
* state of this image.
*
* Main-thread only.
*
* @param aStatus Final status information about the decoder. (Whether it
* encountered an error, etc.)
* @param aMetadata Metadata about this image that the decoder gathered.
* @param aTelemetry Telemetry data about the decoder.
* @param aProgress Any final progress notifications to send.
* @param aInvalidRect Any final invalidation rect to send.
* @param aFrameCount If Some(), a final updated count of the number of frames

3
js/xpconnect/idl/xpccomponents.idl

@ -616,9 +616,6 @@ interface nsIXPCComponents_Utils : nsISupports
*/
PRTime getWatchdogTimestamp(in AString aCategory);
[implicit_jscontext]
jsval getJSEngineTelemetryValue();
/*
* Clone an object into a scope.
* The 3rd argument is an optional options object:

23
js/xpconnect/src/XPCComponents.cpp

@ -3193,29 +3193,6 @@ nsXPCComponents_Utils::GetWatchdogTimestamp(const nsAString& aCategory, PRTime*
return NS_OK;
}
NS_IMETHODIMP
nsXPCComponents_Utils::GetJSEngineTelemetryValue(JSContext* cx, MutableHandleValue rval)
{
RootedObject obj(cx, JS_NewPlainObject(cx));
if (!obj)
return NS_ERROR_OUT_OF_MEMORY;
unsigned attrs = JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT;
size_t i = JS_SetProtoCalled(cx);
RootedValue v(cx, DoubleValue(i));
if (!JS_DefineProperty(cx, obj, "setProto", v, attrs))
return NS_ERROR_OUT_OF_MEMORY;
i = JS_GetCustomIteratorCount(cx);
v.setDouble(i);
if (!JS_DefineProperty(cx, obj, "customIter", v, attrs))
return NS_ERROR_OUT_OF_MEMORY;
rval.setObject(*obj);
return NS_OK;
}
bool
xpc::CloneInto(JSContext* aCx, HandleValue aValue, HandleValue aScope,
HandleValue aOptions, MutableHandleValue aCloned)

6
js/xpconnect/src/XPCShellImpl.cpp

@ -1236,11 +1236,6 @@ XRE_XPCShellMain(int argc, char** argv, char** envp)
mozilla::LogModule::Init();
// A initializer to initialize histogram collection
// used by telemetry.
UniquePtr<base::StatisticsRecorder> telStats =
MakeUnique<base::StatisticsRecorder>();
if (PR_GetEnv("MOZ_CHAOSMODE")) {
ChaosFeature feature = ChaosFeature::Any;
long featureInt = strtol(PR_GetEnv("MOZ_CHAOSMODE"), nullptr, 16);
@ -1535,7 +1530,6 @@ XRE_XPCShellMain(int argc, char** argv, char** envp)
bogus = nullptr;
#endif
telStats = nullptr;
appDir = nullptr;
appFile = nullptr;
dirprovider.ClearGREDirs();

6
js/xpconnect/src/XPCWrappedNativeJSOps.cpp

@ -937,9 +937,9 @@ const js::ObjectOps XPC_WN_ObjectOpsWithEnumerate = {
// |this| object for a given method (often to the detriment of proper
// call/apply). When these tricks were removed, a fair amount of chrome
// code broke, because it was relying on being able to grab methods off
// some XPCOM object (like the nsITelemetry service) and invoke them without
// a proper |this|. So, if it's quite clear that we're in this situation and
// about to use a |this| argument that just won't work, fix things up.
// some XPCOM object and invoke them without a proper |this|. So, if it's
// quite clear that we're in this situation and about to use a |this|
// argument that just won't work, fix things up.
//
// This hack is only useful for getters/setters if someone sets an XPCOM object
// as the prototype for a vanilla JS object and expects the XPCOM attributes to

9
layout/tools/reftest/reftest-preferences.js

@ -71,15 +71,6 @@ user_pref("dom.allow_XUL_XBL_for_file", true);
// their protocol with the inner URI of the view-source URI
user_pref("security.view-source.reachable-from-inner-protocol", true);
// Ensure that telemetry is disabled, so we don't connect to the telemetry
// server in the middle of the tests.
user_pref("toolkit.telemetry.enabled", false);
user_pref("toolkit.telemetry.unified", false);
// Likewise for safebrowsing.
user_pref("browser.safebrowsing.phishing.enabled", false);
user_pref("browser.safebrowsing.malware.enabled", false);
user_pref("browser.safebrowsing.forbiddenURIs.enabled", false);
user_pref("browser.safebrowsing.blockedURIs.enabled", false);
// Likewise for tracking protection.
user_pref("privacy.trackingprotection.enabled", false);
user_pref("privacy.trackingprotection.pbmode.enabled", false);

11
mailnews/db/gloda/modules/datastore.js

@ -1030,17 +1030,6 @@ var GlodaDatastore = {
var dbConnection;
// Report about the size of the database through telemetry (if there's a
// database, naturally).
if (dbFile.exists()) {
try {
let h = Services.telemetry.getHistogramById("THUNDERBIRD_GLODA_SIZE_MB");
h.add(dbFile.fileSize/1048576);
} catch (e) {
this._log.warn("Couldn't report telemetry", e);
}
}
// Create the file if it does not exist
if (!dbFile.exists()) {
this._log.debug("Creating database because it doesn't exist.");

19
mailnews/db/gloda/modules/indexer.js

@ -1006,10 +1006,6 @@ var GlodaIndexer = {
// make ourselves less responsive by drawing out the period of time we
// are dominating the main thread.
this._perfIndexStopwatch.start();
// For telemetry purposes, we want to know how many messages we've been
// processing during that batch, and how long it took, pauses included.
let t0 = Date.now();
this._indexedMessageCount = 0;
batchCount = 0;
while (batchCount < this._indexTokens) {
if ((this._callbackHandle.activeIterator === null) &&
@ -1150,21 +1146,6 @@ var GlodaIndexer = {
}
}
// All pauses have been taken, how effective were we? Report!
// XXX: there's possibly a lot of fluctuation since we go through here
// every 5 messages or even less
if (this._indexedMessageCount > 0) {
let delta = (Date.now() - t0)/1000; // in seconds
let v = Math.round(this._indexedMessageCount/delta);
try {
let h = Services.telemetry
.getHistogramById("THUNDERBIRD_INDEXING_RATE_MSG_PER_S");
h.add(v);
} catch (e) {
this._log.warn("Couldn't report telemetry", e, v);
}
}
if (batchCount > 0) {
let totalTime = this._perfIndexStopwatch.realTimeSeconds * 1000;
let timePerToken = totalTime / batchCount;

4
mailnews/local/src/nsPop3Sink.cpp

@ -724,13 +724,13 @@ nsresult nsPop3Sink::WriteLineToMailbox(const nsACString& buffer)
nsString folderName;
if (localFolder)
localFolder->GetPrettiestName(folderName);
// This merits a console message, it's poor man's telemetry.
// This merits a console message.
MsgLogToConsole4(
NS_LITERAL_STRING("Unexpected file position change detected") +
(folderName.IsEmpty() ? EmptyString() : NS_LITERAL_STRING(" in folder ")) +
(folderName.IsEmpty() ? EmptyString() : folderName) + NS_LITERAL_STRING(". "
"If you can reliably reproduce this, please report the steps "
"you used to dev-apps-thunderbird@lists.mozilla.org or to bug 1308335 at bugzilla.mozilla.org. "
"you used to the application maintainer. "
"Resolving this problem will allow speeding up message downloads."),
NS_LITERAL_STRING(__FILE__), __LINE__, nsIScriptError::errorFlag);
#ifdef DEBUG

25
modules/libpref/Preferences.cpp

@ -88,8 +88,6 @@ static nsresult pref_InitInitialObjects(void);
static nsresult pref_LoadPrefsInDirList(const char *listId);
static nsresult ReadExtensionPrefs(nsIFile *aFile);
static const char kTelemetryPref[] = "toolkit.telemetry.enabled";
static const char kOldTelemetryPref[] = "toolkit.telemetry.enabledPreRelease";
static const char kChannelPref[] = "app.update.channel";
static const char kPrefFileHeader[] =
@ -644,12 +642,6 @@ Preferences::ReadUserPrefs(nsIFile *aFile)
// Ignore all errors related to it, so we retain 'rv' value :-|
(void) UseUserPrefFile();
// Migrate the old prerelease telemetry pref
if (!Preferences::GetBool(kOldTelemetryPref, true)) {
Preferences::SetBool(kTelemetryPref, false);
Preferences::ClearUser(kOldTelemetryPref);
}
NotifyServiceObservers(NS_PREFSERVICE_READ_TOPIC_ID);
} else {
rv = ReadAndOwnUserPrefFile(aFile);
@ -1336,23 +1328,6 @@ static nsresult pref_InitInitialObjects()
rv = pref_LoadPrefsInDirList(NS_APP_PREFS_DEFAULTS_DIR_LIST);
NS_ENSURE_SUCCESS(rv, rv);
// Set up the correct default for toolkit.telemetry.enabled.
// If this build has MOZ_TELEMETRY_ON_BY_DEFAULT *or* we're on the beta
// channel, telemetry is on by default, otherwise not. This is necessary
// so that beta users who are testing final release builds don't flipflop
// defaults.
if (Preferences::GetDefaultType(kTelemetryPref) == nsIPrefBranch::PREF_INVALID) {
bool prerelease = false;
#ifdef MOZ_TELEMETRY_ON_BY_DEFAULT
prerelease = true;
#else
if (Preferences::GetDefaultCString(kChannelPref).EqualsLiteral("beta")) {
prerelease = true;
}
#endif
PREF_SetBoolPref(kTelemetryPref, prerelease, true);
}
NS_CreateServicesFromCategory(NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID,
nullptr, NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID);

6
modules/libpref/goanna.js

@ -1,8 +1,2 @@
#include ../../netwerk/base/security-prefs.js
#include init/all.js
#ifdef MOZ_DATA_REPORTING
#include ../../toolkit/components/telemetry/datareporting-prefs.js
#endif
#ifdef MOZ_SERVICES_HEALTHREPORT
#include ../../toolkit/components/telemetry/healthreport-prefs.js
#endif

16
modules/libpref/init/all.js

@ -891,19 +891,6 @@ pref("toolkit.scrollbox.verticalScrollDistance", 3);
pref("toolkit.scrollbox.horizontalScrollDistance", 5);
pref("toolkit.scrollbox.clickToScroll.scrollDelay", 150);
// Telemetry settings.
// Server to submit telemetry pings to.
pref("toolkit.telemetry.server", "");
// Telemetry server owner. Please change if you set toolkit.telemetry.server to a different server
pref("toolkit.telemetry.server_owner", "");
// Information page about telemetry (temporary ; will be about:telemetry in the end)
pref("toolkit.telemetry.infoURL", "");
// Determines whether full SQL strings are returned when they might contain sensitive info
// i.e. dynamically constructed SQL strings or SQL executed by addons against addon DBs
pref("toolkit.telemetry.debugSlowSql", false);
// Whether to use the unified telemetry behavior, requires a restart.
pref("toolkit.telemetry.unified", false);
// Identity module
pref("toolkit.identity.enabled", false);
pref("toolkit.identity.debug", false);
@ -979,9 +966,6 @@ pref("devtools.gcli.imgurUploadURL", "https://api.imgur.com/3/image");
// GCLI commands directory
pref("devtools.commands.dir", "");
// Allows setting the performance marks for which telemetry metrics will be recorded.
pref("devtools.telemetry.supported_performance_marks", "contentInteractive,navigationInteractive,navigationLoaded,visuallyLoaded,fullyLoaded,mediaEnumerated,scanEnd");
// Deprecation warnings after DevTools file migration.
pref("devtools.migration.warnings", true);

3
mozglue/misc/TimeStamp.cpp

@ -69,8 +69,7 @@ TimeStamp::ProcessCreation(bool& aIsInconsistent)
if ((ts > sInitOnce.mFirstTimeStamp) || (uptime == 0)) {
/* If the process creation timestamp was inconsistent replace it with
* the first one instead and notify that a telemetry error was
* detected. */
* the first one instead. */
aIsInconsistent = true;
ts = sInitOnce.mFirstTimeStamp;
}

7
netwerk/base/Predictor.cpp

@ -492,13 +492,6 @@ Predictor::GetParallelSpeculativeConnectLimit(
return NS_OK;
}
NS_IMETHODIMP
Predictor::GetIsFromPredictor(bool *isFromPredictor)
{
*isFromPredictor = true;
return NS_OK;
}
NS_IMETHODIMP
Predictor::GetAllow1918(bool *allow1918)
{

15
netwerk/base/nsIAuthModule.idl

@ -1,4 +1,3 @@
/* vim:set ts=4 sw=4 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/. */
@ -29,20 +28,6 @@ interface nsIAuthModule : nsISupports
*/
const unsigned long REQ_PROXY_AUTH = (1 << 2);
/**
* Flags used for telemetry.
*/
const unsigned long NTLM_MODULE_SAMBA_AUTH_PROXY = 0;
const unsigned long NTLM_MODULE_SAMBA_AUTH_DIRECT = 1;
const unsigned long NTLM_MODULE_WIN_API_PROXY = 2;
const unsigned long NTLM_MODULE_WIN_API_DIRECT = 3;
const unsigned long NTLM_MODULE_GENERIC_PROXY = 4;
const unsigned long NTLM_MODULE_GENERIC_DIRECT = 5;
const unsigned long NTLM_MODULE_KERBEROS_PROXY = 6;
const unsigned long NTLM_MODULE_KERBEROS_DIRECT = 7;
/** Other flags may be defined in the future */
/**
* Called to initialize an auth module. The other methods cannot be called
* unless this method succeeds.

3
netwerk/base/nsIBrowserSearchService.idl

@ -464,8 +464,7 @@ interface nsIBrowserSearchService : nsISupports
attribute nsISearchEngine currentEngine;
/**
* Gets a representation of the default engine in an anonymized JSON
* string suitable for recording in the Telemetry environment.
* Gets a representation of the default engine.
*
* @return an object containing anonymized info about the default engine:
* name, loadPath, submissionURL (for default engines).

6
netwerk/base/nsISpeculativeConnect.idl

@ -64,12 +64,6 @@ interface nsISpeculativeConnectionOverrider : nsISupports
*/
[infallible] readonly attribute boolean ignoreIdle;
/*
* Used by the Predictor to gather telemetry data on speculative connection
* usage.
*/
[infallible] readonly attribute boolean isFromPredictor;
/**
* by default speculative connections are not made to RFC 1918 addresses
*/

2
netwerk/base/security-prefs.js

@ -75,7 +75,7 @@ pref("security.OCSP.require", false);
pref("security.OCSP.GET.enabled", false);
pref("security.pki.cert_short_lifetime_in_days", 10);
// NB: Changes to this pref affect CERT_CHAIN_SHA1_POLICY_STATUS telemetry.
// NB: Changes to this pref affect CERT_CHAIN_SHA1_POLICY_STATUS.
// See the comment in CertVerifier.cpp.
// 3 = only allow SHA-1 for certificates issued by an imported root.
pref("security.pki.sha1_enforcement_level", 3);

2
netwerk/cache/nsDiskCache.h vendored

@ -24,8 +24,6 @@ public:
enum { kData, kMetaData };
// Stores the reason why the cache is corrupt.
// Note: I'm only listing the enum values explicitly for easy mapping when
// looking at telemetry data.
enum CorruptCacheInfo {
kNotCorrupt = 0,
kInvalidArgPointer = 1,

2
netwerk/cache2/CacheFileMetadata.cpp

@ -21,7 +21,7 @@
namespace mozilla {
namespace net {
#define kMinMetadataRead 1024 // TODO find optimal value from telemetry
#define kMinMetadataRead 1024 // TODO find optimal value
#define kAlignSize 4096
// Most of the cache entries fit into one chunk due to current chunk size. Make

7
netwerk/protocol/http/AlternateServices.cpp

@ -1061,13 +1061,6 @@ AltSvcOverride::GetParallelSpeculativeConnectLimit(
return NS_OK;
}
NS_IMETHODIMP
AltSvcOverride::GetIsFromPredictor(bool *isFromPredictor)
{
*isFromPredictor = false;
return NS_OK;
}
NS_IMETHODIMP
AltSvcOverride::GetAllow1918(bool *allow)
{

38
netwerk/protocol/http/nsHttpChannel.cpp

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:set expandtab ts=4 sw=4 sts=4 cin: */
/* 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/. */
@ -5829,8 +5828,6 @@ nsHttpChannel::HandleBeginConnectContinue()
nsresult
nsHttpChannel::BeginConnectContinue()
{
nsresult rv;
// Check if request was cancelled during suspend AFTER on-modify-request or
// on-useragent.
if (mCanceled) {
@ -6652,41 +6649,6 @@ nsHttpChannel::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult st
}
}
// HTTP_CHANNEL_DISPOSITION TELEMETRY
enum ChannelDisposition
{
kHttpCanceled = 0,
kHttpDisk = 1,
kHttpNetOK = 2,
kHttpNetEarlyFail = 3,
kHttpNetLateFail = 4,
kHttpsCanceled = 8,
kHttpsDisk = 9,
kHttpsNetOK = 10,
kHttpsNetEarlyFail = 11,
kHttpsNetLateFail = 12
} chanDisposition = kHttpCanceled;
// HTTP 0.9 is more likely to be an error than really 0.9, so count it that way
if (mCanceled) {
chanDisposition = kHttpCanceled;
} else if (!mUsedNetwork) {
chanDisposition = kHttpDisk;
} else if (NS_SUCCEEDED(status) &&
mResponseHead &&
mResponseHead->Version() != NS_HTTP_VERSION_0_9) {
chanDisposition = kHttpNetOK;
} else if (!mTransferSize) {
chanDisposition = kHttpNetEarlyFail;
} else {
chanDisposition = kHttpNetLateFail;
}
if (IsHTTPS()) {
// shift http to https disposition enums
chanDisposition = static_cast<ChannelDisposition>(chanDisposition + kHttpsCanceled);
}
LOG((" nsHttpChannel::OnStopRequest ChannelDisposition %d\n", chanDisposition));
// if needed, check cache entry has all data we expect
if (mCacheEntry && mCachePump &&
mConcurrentCacheAccess && contentComplete) {

2
netwerk/protocol/http/nsHttpConnection.h

@ -378,7 +378,7 @@ private:
// for the end of
// the handsake.
int64_t mContentBytesWritten0RTT;
bool mEarlyDataNegotiated; //Only used for telemetry
bool mEarlyDataNegotiated;
nsCString mEarlyNegotiatedALPN;
bool mDid0RTTSpdy;

15
netwerk/protocol/http/nsHttpConnectionMgr.cpp

@ -1,4 +1,3 @@
/* vim:set ts=4 sw=4 sts=4 et cin: */
/* 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/. */
@ -393,7 +392,6 @@ public: // intentional!
bool mOverridesOK;
uint32_t mParallelSpeculativeConnectLimit;
bool mIgnoreIdle;
bool mIsFromPredictor;
bool mAllow1918;
private:
@ -447,7 +445,6 @@ nsHttpConnectionMgr::SpeculativeConnect(nsHttpConnectionInfo *ci,
args->mParallelSpeculativeConnectLimit =
overrider->GetParallelSpeculativeConnectLimit();
args->mIgnoreIdle = overrider->GetIgnoreIdle();
args->mIsFromPredictor = overrider->GetIsFromPredictor();
args->mAllow1918 = overrider->GetAllow1918();
}
@ -1285,7 +1282,7 @@ nsHttpConnectionMgr::MakeNewConnection(nsConnectionEntry *ent,
if (AtActiveConnectionLimit(ent, trans->Caps()))
return NS_ERROR_NOT_AVAILABLE;
nsresult rv = CreateTransport(ent, trans, trans->Caps(), false, false, true);
nsresult rv = CreateTransport(ent, trans, trans->Caps(), false, true);
if (NS_FAILED(rv)) {
/* hard failure */
LOG(("nsHttpConnectionMgr::MakeNewConnection [ci = %s trans = %p] "
@ -1946,7 +1943,6 @@ nsHttpConnectionMgr::CreateTransport(nsConnectionEntry *ent,
nsAHttpTransaction *trans,
uint32_t caps,
bool speculative,
bool isFromPredictor,
bool allow1918)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
@ -1955,10 +1951,6 @@ nsHttpConnectionMgr::CreateTransport(nsConnectionEntry *ent,
if (speculative) {
sock->SetSpeculative(true);
sock->SetAllow1918(allow1918);
if (isFromPredictor) {
sock->SetIsFromPredictor(true);
}
}
// The socket stream holds the reference to the half open
@ -2884,13 +2876,11 @@ nsHttpConnectionMgr::OnMsgSpeculativeConnect(int32_t, ARefBase *param)
uint32_t parallelSpeculativeConnectLimit =
gHttpHandler->ParallelSpeculativeConnectLimit();
bool ignoreIdle = false;
bool isFromPredictor = false;
bool allow1918 = false;
if (args->mOverridesOK) {
parallelSpeculativeConnectLimit = args->mParallelSpeculativeConnectLimit;
ignoreIdle = args->mIgnoreIdle;
isFromPredictor = args->mIsFromPredictor;
allow1918 = args->mAllow1918;
}
@ -2900,7 +2890,7 @@ nsHttpConnectionMgr::OnMsgSpeculativeConnect(int32_t, ARefBase *param)
!ent->mIdleConns.Length()) &&
!(keepAlive && RestrictConnections(ent)) &&
!AtActiveConnectionLimit(ent, args->mTrans->Caps())) {
CreateTransport(ent, args->mTrans, args->mTrans->Caps(), true, isFromPredictor, allow1918);
CreateTransport(ent, args->mTrans, args->mTrans->Caps(), true, allow1918);
} else {
LOG(("OnMsgSpeculativeConnect Transport "
"not created due to existing connection count\n"));
@ -2949,7 +2939,6 @@ nsHalfOpenSocket::nsHalfOpenSocket(nsConnectionEntry *ent,
, mDispatchedMTransaction(false)
, mCaps(caps)
, mSpeculative(false)
, mIsFromPredictor(false)
, mAllow1918(true)
, mHasConnected(false)
, mPrimaryConnectedOK(false)

11
netwerk/protocol/http/nsHttpConnectionMgr.h

@ -1,4 +1,3 @@
/* vim:set ts=4 sw=4 sts=4 et cin: */
/* 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/. */
@ -435,9 +434,6 @@ private:
bool IsSpeculative() { return mSpeculative; }
void SetSpeculative(bool val) { mSpeculative = val; }
bool IsFromPredictor() { return mIsFromPredictor; }
void SetIsFromPredictor(bool val) { mIsFromPredictor = val; }
bool Allow1918() { return mAllow1918; }
void SetAllow1918(bool val) { mAllow1918 = val; }
@ -462,11 +458,6 @@ private:
// more connections that are needed.)
bool mSpeculative;
// mIsFromPredictor is set if the socket originated from the network
// Predictor. It is used to gather telemetry data on used speculative
// connections from the predictor.
bool mIsFromPredictor;
bool mAllow1918;
TimeStamp mPrimarySynStarted;
@ -532,7 +523,7 @@ private:
nsresult EnsureSocketThreadTarget();
void ClosePersistentConnections(nsConnectionEntry *ent);
nsresult CreateTransport(nsConnectionEntry *, nsAHttpTransaction *,
uint32_t, bool, bool, bool);
uint32_t, bool, bool);
void AddActiveConn(nsHttpConnection *, nsConnectionEntry *);
void DecrementActiveConnCount(nsHttpConnection *);
void StartedConnect();

4
netwerk/protocol/http/nsHttpHandler.cpp

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:set ts=4 sw=4 sts=4 et cin: */
/* 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/. */
@ -1505,8 +1504,7 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
}
}
// toggle to true anytime a token bucket related pref is changed.. that
// includes telemetry and allow-experiments because of the abtest profile
// toggle to true anytime a token bucket related pref is changed.
bool requestTokenBucketUpdated = false;
// "security.ssl3.ecdhe_rsa_aes_128_gcm_sha256" is the required h2 interop

31
netwerk/protocol/websocket/WebSocketChannel.cpp

@ -2985,35 +2985,6 @@ WebSocketChannel::StartPinging()
}
void
WebSocketChannel::ReportConnectionTelemetry()
{
// 3 bits are used. high bit is for wss, middle bit for failed,
// and low bit for proxy..
// 0 - 7 : ws-ok-plain, ws-ok-proxy, ws-failed-plain, ws-failed-proxy,
// wss-ok-plain, wss-ok-proxy, wss-failed-plain, wss-failed-proxy
bool didProxy = false;
nsCOMPtr<nsIProxyInfo> pi;
nsCOMPtr<nsIProxiedChannel> pc = do_QueryInterface(mChannel);
if (pc)
pc->GetProxyInfo(getter_AddRefs(pi));
if (pi) {
nsAutoCString proxyType;
pi->GetType(proxyType);
if (!proxyType.IsEmpty() &&
!proxyType.EqualsLiteral("direct"))
didProxy = true;
}
uint8_t value = (mEncrypted ? (1 << 2) : 0) |
(!mGotUpgradeOK ? (1 << 1) : 0) |
(didProxy ? (1 << 0) : 0);
LOG(("WebSocketChannel::ReportConnectionTelemetry() %p %d", this, value));
}
// nsIDNSListener
NS_IMETHODIMP
@ -3896,8 +3867,6 @@ WebSocketChannel::OnStopRequest(nsIRequest *aRequest,
this, aRequest, mHttpChannel.get(), aStatusCode));
MOZ_ASSERT(NS_IsMainThread(), "not main thread");
ReportConnectionTelemetry();
// This is the end of the HTTP upgrade transaction, the
// upgraded streams live on

3
netwerk/protocol/websocket/WebSocketChannel.h

@ -146,7 +146,7 @@ private:
void GeneratePong(uint8_t *payload, uint32_t len);
void GeneratePing();
nsresult OnNetworkChangedTargetThread();
nsresult OnNetworkChangedTargetThread();
nsresult OnNetworkChanged();
nsresult StartPinging();
@ -158,7 +158,6 @@ private:
nsresult DoAdmissionDNS();
nsresult StartWebsocketData();
uint16_t ResultToCloseCode(nsresult resultCode);
void ReportConnectionTelemetry();
void StopSession(nsresult reason);
void AbortSession(nsresult reason);

2
parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/Tokenizer.java

@ -902,7 +902,7 @@ public class Tokenizer implements Locator {
// CPPONLY: if (strBufLen == strBuf.length) {
// CPPONLY: if (!EnsureBufferSpace(1)) {
// CPPONLY: assert false: "RELEASE: Unable to recover from buffer reallocation failure";
// CPPONLY: } // TODO: Add telemetry when outer if fires but inner does not
// CPPONLY: }
// CPPONLY: }
strBuf[strBufLen++] = c;
}

13
security/certverifier/CertVerifier.cpp

@ -434,8 +434,7 @@ CertVerifier::VerifyCert(CERTCertificate* cert, SECCertificateUsage usage,
// chosen by the server.
// These configurations are in order of most restrictive to least
// restrictive. This enables us to gather telemetry on the expected
// results of setting the default policy to a particular configuration.
// restrictive.
SHA1Mode sha1ModeConfigurations[] = {
SHA1Mode::Forbidden,
SHA1Mode::ImportedRoot,
@ -474,8 +473,7 @@ CertVerifier::VerifyCert(CERTCertificate* cert, SECCertificateUsage usage,
// (mSHA1Mode) is more restrictive than the SHA1 mode option we're on.
// (To put it another way, only attempt verification if the SHA1 mode
// option we're on is as restrictive or more restrictive than
// mSHA1Mode.) This allows us to gather telemetry information while
// still enforcing the mode set by preferences.
// mSHA1Mode.)
if (SHA1ModeMoreRestrictiveThanGivenMode(sha1ModeConfigurations[i])) {
continue;
}
@ -555,8 +553,7 @@ CertVerifier::VerifyCert(CERTCertificate* cert, SECCertificateUsage usage,
// (mSHA1Mode) is more restrictive than the SHA1 mode option we're on.
// (To put it another way, only attempt verification if the SHA1 mode
// option we're on is as restrictive or more restrictive than
// mSHA1Mode.) This allows us to gather telemetry information while
// still enforcing the mode set by preferences.
// mSHA1Mode.)
if (SHA1ModeMoreRestrictiveThanGivenMode(sha1ModeConfigurations[j])) {
continue;
}
@ -612,10 +609,6 @@ CertVerifier::VerifyCert(CERTCertificate* cert, SECCertificateUsage usage,
if (keySizeStatus) {
*keySizeStatus = KeySizeStatus::AlreadyBad;
}
// The telemetry probe CERT_CHAIN_SHA1_POLICY_STATUS gives us feedback on
// the result of setting a specific policy. However, we don't want noise
// from users who have manually set the policy to something other than the
// default, so we only collect for ImportedRoot (which is the default).
if (sha1ModeResult && mSHA1Mode == SHA1Mode::ImportedRoot) {
*sha1ModeResult = SHA1ModeResult::Failed;
}

3
security/certverifier/CertVerifier.h

@ -44,7 +44,6 @@ namespace mozilla { namespace psm {
typedef mozilla::pkix::Result Result;
// These values correspond to the CERT_CHAIN_KEY_SIZE_STATUS telemetry.
enum class KeySizeStatus {
NeverChecked = 0,
LargeMinimumSucceeded = 1,
@ -52,7 +51,6 @@ enum class KeySizeStatus {
AlreadyBad = 3,
};
// These values correspond to the CERT_CHAIN_SHA1_POLICY_STATUS telemetry.
enum class SHA1ModeResult {
NeverChecked = 0,
SucceededWithoutSHA1 = 1,
@ -92,7 +90,6 @@ public:
// TLS feature request_status should be ignored
static const Flags FLAG_TLS_IGNORE_STATUS_REQUEST;
// These values correspond to the SSL_OCSP_STAPLING telemetry.
enum OCSPStaplingStatus {
OCSP_STAPLING_NEVER_CHECKED = 0,
OCSP_STAPLING_GOOD = 1,

2
security/certverifier/OCSPVerificationTrustDomain.cpp

@ -57,7 +57,7 @@ OCSPVerificationTrustDomain::CheckSignatureDigestAlgorithm(
// The reason for wrapping the NSSCertDBTrustDomain in an
// OCSPVerificationTrustDomain is to allow us to bypass the weaker signature
// algorithm check - thus all allowable signature digest algorithms should
// always be accepted. This is only needed while we gather telemetry on SHA-1.
// always be accepted.
return Success;
}

2
security/manager/ssl/nsCertOverrideService.h

@ -163,8 +163,6 @@ protected:
SECOidTag mOidTagForStoringNewHashes;
nsCString mDottedOidForStoringNewHashes;
void CountPermanentOverrideTelemetry();
void RemoveAllFromMemory();
nsresult Read();
nsresult Write();

1
security/manager/ssl/nsNSSCallbacks.cpp

@ -41,7 +41,6 @@ extern LazyLogModule gPIPNSSLog;
namespace {
// Bits in bit mask for SSL_REASONS_FOR_NOT_FALSE_STARTING telemetry probe
// These bits are numbered so that the least subtle issues have higher values.
// This should make it easier for us to interpret the results.
const uint32_t NPN_NOT_NEGOTIATED = 64;

13
startupcache/StartupCache.cpp vendored

@ -596,13 +596,6 @@ StartupCache::ResetStartupWriteTimer()
return NS_OK;
}
nsresult
StartupCache::RecordAgesAlways()
{
gPostFlushAgeAction = RECORD_AGE;
return NS_OK;
}
// StartupCacheDebugOutputStream implementation
#ifdef DEBUG
NS_IMPL_ISUPPORTS(StartupCacheDebugOutputStream, nsIObjectOutputStream,
@ -798,11 +791,5 @@ StartupCacheWrapper::GetObserver(nsIObserver** obv) {
return NS_OK;
}
nsresult
StartupCacheWrapper::RecordAgesAlways() {
StartupCache *sc = StartupCache::GetSingleton();
return sc ? sc->RecordAgesAlways() : NS_ERROR_NOT_INITIALIZED;
}
} // namespace scache
} // namespace mozilla

2
startupcache/StartupCache.h vendored

@ -129,8 +129,6 @@ public:
nsresult GetDebugObjectOutputStream(nsIObjectOutputStream* aStream,
nsIObjectOutputStream** outStream);
nsresult RecordAgesAlways();
static StartupCache* GetSingleton();
static void DeleteSingleton();

4
startupcache/nsIStartupCache.idl vendored

@ -55,10 +55,6 @@ interface nsIStartupCache : nsISupports
boolean startupWriteComplete();
void resetStartupWriteTimer();
/* Instruct clients to always post cache ages to Telemetry, even in
cases where it would not normally make sense. */
void recordAgesAlways();
/* Allows clients to simulate the behavior of ObserverService. */
readonly attribute nsIObserver observer;
};

50
startupcache/test/TestStartupCache.cpp vendored

@ -410,54 +410,10 @@ int main(int argc, char** argv)
int rv = 0;
nsresult scrv;
// Register TestStartupCacheTelemetry
nsCOMPtr<nsIFile> manifest;
scrv = NS_GetSpecialDirectory(NS_GRE_DIR,
getter_AddRefs(manifest));
if (NS_FAILED(scrv)) {
fail("NS_XPCOM_CURRENT_PROCESS_DIR");
return 1;
}
#ifdef XP_MACOSX
nsCOMPtr<nsIFile> tempManifest;
manifest->Clone(getter_AddRefs(tempManifest));
manifest->AppendNative(
NS_LITERAL_CSTRING("TestStartupCacheTelemetry.manifest"));
bool exists;
manifest->Exists(&exists);
if (!exists) {
// Workaround for bug 1080338 in mozharness.
manifest = tempManifest.forget();
manifest->SetNativeLeafName(NS_LITERAL_CSTRING("MacOS"));
manifest->AppendNative(
NS_LITERAL_CSTRING("TestStartupCacheTelemetry.manifest"));
}
#else
manifest->AppendNative(
NS_LITERAL_CSTRING("TestStartupCacheTelemetry.manifest"));
#endif
XRE_AddManifestLocation(NS_APP_LOCATION, manifest);
nsCOMPtr<nsIObserver> telemetryThing =
do_GetService("@mozilla.org/testing/startup-cache-telemetry.js");
if (!telemetryThing) {
fail("telemetryThing");
return 1;
}
scrv = telemetryThing->Observe(nullptr, "save-initial", nullptr);
if (NS_FAILED(scrv)) {
fail("save-initial");
rv = 1;
}
nsCOMPtr<nsIStartupCache> sc
= do_GetService("@mozilla.org/startupcache/cache;1", &scrv);
if (NS_FAILED(scrv))
rv = 1;
else
sc->RecordAgesAlways();
if (NS_FAILED(TestStartupWriteRead()))
rv = 1;
if (NS_FAILED(TestWriteInvalidateRead()))
@ -470,11 +426,5 @@ int main(int argc, char** argv)
if (NS_FAILED(TestEarlyShutdown()))
rv = 1;
scrv = telemetryThing->Observe(nullptr, "save-initial", nullptr);
if (NS_FAILED(scrv)) {
fail("check-final");
rv = 1;
}
return rv;
}

60
startupcache/test/TestStartupCacheTelemetry.js vendored

@ -1,60 +0,0 @@
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
function shouldHaveChanged(a, b)
{
if (a.length != b.length) {
throw Error("TEST-UNEXPECTED-FAIL: telemetry count array size changed");
}
for (let i = 0; i < a.length; ++i) {
if (a[i] == b[i]) {
continue;
}
return; // something was different, that's all that matters
}
throw Error("TEST-UNEXPECTED-FAIL: telemetry data didn't change");
}
function TestStartupCacheTelemetry() { }
TestStartupCacheTelemetry.prototype = {
classID: Components.ID("{73cbeffd-d6c7-42f0-aaf3-f176430dcfc8}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
saveInitial: function() {
let t = Services.telemetry;
this._age = t.getHistogramById("STARTUP_CACHE_AGE_HOURS").snapshot.counts;
this._invalid = t.getHistogramById("STARTUP_CACHE_INVALID").snapshot.counts;
},
checkFinal: function() {
let t = Services.telemetry;
let newAge = t.getHistogramById("STARTUP_CACHE_AGE_HOURS").snapshot.counts;
shouldHaveChanged(this._age, newAge);
let newInvalid = t.getHistogramById("STARTUP_CACHE_INVALID").snapshot.counts;
shouldHaveChanged(this._invalid, newInvalid);
},
observe: function(subject, topic, data) {
switch (topic) {
case "save-initial":
this.saveInitial();
break;
case "check-final":
this.checkFinal();
break;
default:
throw Error("BADDOG, NO MILKBONE FOR YOU");
}
},
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TestStartupCacheTelemetry]);

2
startupcache/test/TestStartupCacheTelemetry.manifest vendored

@ -1,2 +0,0 @@
component {73cbeffd-d6c7-42f0-aaf3-f176430dcfc8} TestStartupCacheTelemetry.js
contract @mozilla.org/testing/startup-cache-telemetry.js {73cbeffd-d6c7-42f0-aaf3-f176430dcfc8}

4
startupcache/test/moz.build vendored

@ -7,7 +7,3 @@ GeckoCppUnitTests([
'TestStartupCache',
])
EXTRA_COMPONENTS += [
'TestStartupCacheTelemetry.js',
'TestStartupCacheTelemetry.manifest',
]

3
widget/nsIGfxInfo.idl

@ -205,8 +205,7 @@ interface nsIGfxInfo : nsISupports
[implicit_jscontext]
jsval getFeatureLog();
// Returns an object containing information about graphics features. It is
// intended to be directly included into the Telemetry environment.
// Returns an object containing information about graphics features.
//
// "layers":
// {

4
widget/windows/WinUtils.cpp

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sts=2 sw=2 et cin: */
/* 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/. */
@ -1983,8 +1982,7 @@ WinUtils::SanitizePath(const wchar_t* aInputPath, nsAString& aOutput)
/**
* This function provides an array of (system path, substitution) pairs that are
* considered to be acceptable with respect to privacy, for the purposes of
* submitting within telemetry or crash reports.
* considered to be acceptable with respect to privacy.
*
* The substitution string's void flag may be set. If it is, no subsitution is
* necessary. Otherwise, the consumer should replace the system path with the

6
xpcom/base/nsIMemoryReporter.idl

@ -158,8 +158,7 @@ interface nsIMemoryReporter : nsISupports
*
* If |anonymize| is true, the memory reporter should anonymize any
* privacy-sensitive details in memory report paths, by replacing them with a
* string such as "<anonymized>". Anonymized memory reports may be sent
* automatically via crash reports or telemetry.
* string such as "<anonymized>".
*
* The following things are considered privacy-sensitive.
*
@ -312,8 +311,7 @@ interface nsIMemoryReporterManager : nsISupports
* registered with it as a black box. However, there are some
* "distinguished" amounts (as could be reported by a memory reporter) that
* the manager provides as attributes, because they are sufficiently
* interesting that we want external code (e.g. telemetry) to be able to rely
* on them.
* interesting that we want external code to be able to rely on them.
*
* Note that these are not reporters and so getReports() does not look at
* them. However, distinguished amounts can be embedded in a reporter.

3
xpcom/build/nsXULAppAPI.h

@ -486,9 +486,6 @@ XRE_API(bool,
XRE_API(void,
XRE_InstallX11ErrorHandler, ())
XRE_API(void,
XRE_TelemetryAccumulate, (int aID, uint32_t aSample))
XRE_API(void,
XRE_StartupTimelineRecord, (int aEvent, mozilla::TimeStamp aWhen))

10
xpcom/glue/FileUtils.h

@ -96,7 +96,7 @@ bool fallocate(PRFileDesc* aFD, int64_t aLength);
/**
* Use readahead to preload shared libraries into the file cache before loading.