Remove all C++ Telemetry Accumulation calls.

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

View file

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