From 03fa12d6854f491b666aaeb2a1390921613db7e1 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Fri, 1 Nov 2019 13:43:15 +0000 Subject: [PATCH] Bug 1593162 - Remove the expired telemetry probes added in bug 1127552; r=edgar Differential Revision: https://phabricator.services.mozilla.com/D51335 --HG-- extra : moz-landing-system : lando --- dom/fetch/Fetch.cpp | 5 ----- dom/fetch/FetchDriver.cpp | 3 --- dom/fetch/FetchTypes.ipdlh | 1 - dom/fetch/InternalRequest.cpp | 6 +----- dom/fetch/InternalRequest.h | 10 ---------- dom/fetch/Request.cpp | 7 ------- dom/serviceworkers/FetchEventOpChild.cpp | 1 - dom/serviceworkers/ServiceWorkerPrivate.cpp | 3 --- toolkit/components/telemetry/Histograms.json | 14 -------------- .../components/telemetry/histogram-allowlists.json | 4 ---- 10 files changed, 1 insertion(+), 53 deletions(-) diff --git a/dom/fetch/Fetch.cpp b/dom/fetch/Fetch.cpp index 4d15d2a85617..7ab925722616 100644 --- a/dom/fetch/Fetch.cpp +++ b/dom/fetch/Fetch.cpp @@ -36,7 +36,6 @@ #include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/URLSearchParams.h" #include "mozilla/net/CookieSettings.h" -#include "mozilla/Telemetry.h" #include "BodyExtractor.h" #include "EmptyBody.h" @@ -508,8 +507,6 @@ already_AddRefed FetchRequest(nsIGlobalObject* aGlobal, } } - Telemetry::Accumulate(Telemetry::FETCH_IS_MAINTHREAD, 1); - RefPtr resolver = new MainThreadFetchResolver( p, observer, signalImpl, request->MozErrors()); RefPtr fetch = new FetchDriver( @@ -526,8 +523,6 @@ already_AddRefed FetchRequest(nsIGlobalObject* aGlobal, WorkerPrivate* worker = GetCurrentThreadWorkerPrivate(); MOZ_ASSERT(worker); - Telemetry::Accumulate(Telemetry::FETCH_IS_MAINTHREAD, 0); - if (worker->IsServiceWorker()) { r->SetSkipServiceWorker(); } diff --git a/dom/fetch/FetchDriver.cpp b/dom/fetch/FetchDriver.cpp index 1af22a11a646..185f4e69d9c3 100644 --- a/dom/fetch/FetchDriver.cpp +++ b/dom/fetch/FetchDriver.cpp @@ -369,9 +369,6 @@ nsresult FetchDriver::Fetch(AbortSignalImpl* aSignalImpl, mObserver = aObserver; - Telemetry::Accumulate(Telemetry::SERVICE_WORKER_REQUEST_PASSTHROUGH, - mRequest->WasCreatedByFetchEvent()); - // FIXME(nsm): Deal with HSTS. MOZ_RELEASE_ASSERT(!mRequest->IsSynchronous(), diff --git a/dom/fetch/FetchTypes.ipdlh b/dom/fetch/FetchTypes.ipdlh index e3d92c844589..8b127bee504b 100644 --- a/dom/fetch/FetchTypes.ipdlh +++ b/dom/fetch/FetchTypes.ipdlh @@ -39,7 +39,6 @@ struct IPCInternalRequest { RequestRedirect requestRedirect; nsString integrity; nsCString fragment; - bool createdByFetchEvent; PrincipalInfo? principalInfo; }; diff --git a/dom/fetch/InternalRequest.cpp b/dom/fetch/InternalRequest.cpp index 853682a3390c..52d59fe01abe 100644 --- a/dom/fetch/InternalRequest.cpp +++ b/dom/fetch/InternalRequest.cpp @@ -52,7 +52,6 @@ already_AddRefed InternalRequest::GetRequestConstructorCopy( copy->mCredentialsMode = mCredentialsMode; copy->mCacheMode = mCacheMode; copy->mRedirectMode = mRedirectMode; - copy->mCreatedByFetchEvent = mCreatedByFetchEvent; copy->mContentPolicyTypeOverridden = mContentPolicyTypeOverridden; copy->mPreferredAlternativeDataType = mPreferredAlternativeDataType; @@ -166,7 +165,6 @@ InternalRequest::InternalRequest(const InternalRequest& aOther) mSynchronous(aOther.mSynchronous), mUnsafeRequest(aOther.mUnsafeRequest), mUseURLCredentials(aOther.mUseURLCredentials), - mCreatedByFetchEvent(aOther.mCreatedByFetchEvent), mContentPolicyTypeOverridden(aOther.mContentPolicyTypeOverridden) { // NOTE: does not copy body stream... use the fallible Clone() for that } @@ -188,8 +186,7 @@ InternalRequest::InternalRequest(const IPCInternalRequest& aIPCRequest) mCacheMode(aIPCRequest.cacheMode()), mRedirectMode(aIPCRequest.requestRedirect()), mIntegrity(aIPCRequest.integrity()), - mFragment(aIPCRequest.fragment()), - mCreatedByFetchEvent(aIPCRequest.createdByFetchEvent()) { + mFragment(aIPCRequest.fragment()) { if (aIPCRequest.principalInfo()) { mPrincipalInfo = MakeUnique( aIPCRequest.principalInfo().ref()); @@ -231,7 +228,6 @@ void InternalRequest::ToIPC( aIPCRequest->requestRedirect() = mRedirectMode; aIPCRequest->integrity() = mIntegrity; aIPCRequest->fragment() = mFragment; - aIPCRequest->createdByFetchEvent() = mCreatedByFetchEvent; if (mPrincipalInfo) { aIPCRequest->principalInfo().emplace(*mPrincipalInfo); diff --git a/dom/fetch/InternalRequest.h b/dom/fetch/InternalRequest.h index f6249c601de0..ba2b729338f8 100644 --- a/dom/fetch/InternalRequest.h +++ b/dom/fetch/InternalRequest.h @@ -308,12 +308,6 @@ class InternalRequest final { already_AddRefed GetRequestConstructorCopy( nsIGlobalObject* aGlobal, ErrorResult& aRv) const; - bool WasCreatedByFetchEvent() const { return mCreatedByFetchEvent; } - - void SetCreatedByFetchEvent() { mCreatedByFetchEvent = true; } - - void ClearCreatedByFetchEvent() { mCreatedByFetchEvent = false; } - bool IsNavigationRequest() const; bool IsWorkerRequest() const; @@ -415,10 +409,6 @@ class InternalRequest final { MOZ_INIT_OUTSIDE_CTOR bool mSynchronous; MOZ_INIT_OUTSIDE_CTOR bool mUnsafeRequest; MOZ_INIT_OUTSIDE_CTOR bool mUseURLCredentials; - // This is only set when a Request object is created by a fetch event. We - // use it to check if Service Workers are simply fetching intercepted Request - // objects without modifying them. - bool mCreatedByFetchEvent = false; // This is only set when Request.overrideContentPolicyType() has been set. // It is illegal to pass such a Request object to a fetch() method unless // if the caller has chrome privileges. diff --git a/dom/fetch/Request.cpp b/dom/fetch/Request.cpp index 02dea6248953..b0d62d147732 100644 --- a/dom/fetch/Request.cpp +++ b/dom/fetch/Request.cpp @@ -437,12 +437,10 @@ already_AddRefed Request::Constructor(const GlobalObject& aGlobal, request->SetPrincipalInfo(std::move(principalInfo)); if (mode != RequestMode::EndGuard_) { - request->ClearCreatedByFetchEvent(); request->SetMode(mode); } if (credentials != RequestCredentials::EndGuard_) { - request->ClearCreatedByFetchEvent(); request->SetCredentialsMode(credentials); } @@ -456,7 +454,6 @@ already_AddRefed Request::Constructor(const GlobalObject& aGlobal, aRv.ThrowTypeError(modeString); return nullptr; } - request->ClearCreatedByFetchEvent(); request->SetCacheMode(cache); } @@ -488,7 +485,6 @@ already_AddRefed Request::Constructor(const GlobalObject& aGlobal, } // Step 14.2 - request->ClearCreatedByFetchEvent(); request->SetMethod(outMethod); } @@ -501,7 +497,6 @@ already_AddRefed Request::Constructor(const GlobalObject& aGlobal, if (aRv.Failed()) { return nullptr; } - request->ClearCreatedByFetchEvent(); headers = h->GetInternalHeaders(); } else { headers = new InternalHeaders(*requestHeaders); @@ -571,8 +566,6 @@ already_AddRefed Request::Constructor(const GlobalObject& aGlobal, return nullptr; } - request->ClearCreatedByFetchEvent(); - if (hasCopiedBody) { request->SetBody(nullptr, 0); } diff --git a/dom/serviceworkers/FetchEventOpChild.cpp b/dom/serviceworkers/FetchEventOpChild.cpp index a847f0608189..f09945b8d486 100644 --- a/dom/serviceworkers/FetchEventOpChild.cpp +++ b/dom/serviceworkers/FetchEventOpChild.cpp @@ -326,7 +326,6 @@ nsresult GetIPCInternalRequest(nsIInterceptedChannel* aChannel, requestRedirect, requestCredentials, referrer, referrerPolicy, contentPolicyType, integrity); internalRequest->SetBody(uploadStream, uploadStreamContentLength); - internalRequest->SetCreatedByFetchEvent(); nsAutoCString alternativeDataType; if (cacheInfoChannel && diff --git a/dom/serviceworkers/ServiceWorkerPrivate.cpp b/dom/serviceworkers/ServiceWorkerPrivate.cpp index 76cbb9016752..a08201716ac1 100644 --- a/dom/serviceworkers/ServiceWorkerPrivate.cpp +++ b/dom/serviceworkers/ServiceWorkerPrivate.cpp @@ -1429,9 +1429,6 @@ class FetchEventRunnable : public ExtendableFunctionalEventWorkerRunnable, mRequestMode, mRequestRedirect, mRequestCredentials, mReferrer, mReferrerPolicy, mContentPolicyType, mIntegrity); internalReq->SetBody(mUploadStream, mUploadStreamContentLength); - // For Telemetry, note that this Request object was created by a Fetch - // event. - internalReq->SetCreatedByFetchEvent(); nsCOMPtr channel; nsresult rv = mInterceptedChannel->GetChannel(getter_AddRefs(channel)); diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 26526204cdde..fbbf402bbcc7 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -597,13 +597,6 @@ "releaseChannelCollection": "opt-out", "description": "GPU Device Reset Reason (ok, hung, removed, reset, internal error, invalid call, out of memory)" }, - "FETCH_IS_MAINTHREAD": { - "record_in_processes": ["main", "content"], - "products": ["firefox", "fennec", "geckoview"], - "expires_in_version": "50", - "kind": "boolean", - "description": "Was Fetch request initiated from the main thread?" - }, "FORCED_DEVICE_RESET_REASON": { "record_in_processes": ["main", "content", "gpu"], "products": ["firefox", "fennec", "geckoview"], @@ -12202,13 +12195,6 @@ "description": "Time (in ms) measured between when the fetch handler finished executing and when we reset the network channel." }, - "SERVICE_WORKER_REQUEST_PASSTHROUGH": { - "record_in_processes": ["main", "content"], - "products": ["firefox", "fennec", "geckoview"], - "expires_in_version": "50", - "kind": "boolean", - "description": "Intercepted fetch sending back same Request object. File bugs in Core::DOM in case of a Telemetry regression." - }, "ONBEFOREUNLOAD_PROMPT_ACTION" : { "record_in_processes": ["main", "content"], "products": ["firefox", "fennec", "geckoview"], diff --git a/toolkit/components/telemetry/histogram-allowlists.json b/toolkit/components/telemetry/histogram-allowlists.json index 80c7b73b6a4e..6171ecf8c1a9 100644 --- a/toolkit/components/telemetry/histogram-allowlists.json +++ b/toolkit/components/telemetry/histogram-allowlists.json @@ -134,7 +134,6 @@ "FENNEC_TABQUEUE_QUEUESIZE", "FENNEC_TOPSITES_LOADER_TIME_MS", "FENNEC_WAS_KILLED", - "FETCH_IS_MAINTHREAD", "FONTLIST_INITFACENAMELISTS", "FONTLIST_INITOTHERFAMILYNAMES", "FONTLIST_INITOTHERFAMILYNAMES_NO_DEFERRING", @@ -355,7 +354,6 @@ "SERVICE_WORKER_LIFE_TIME", "SERVICE_WORKER_REGISTRATIONS", "SERVICE_WORKER_REGISTRATION_LOADING", - "SERVICE_WORKER_REQUEST_PASSTHROUGH", "SERVICE_WORKER_SPAWN_ATTEMPTS", "SERVICE_WORKER_UPDATED", "SERVICE_WORKER_WAS_SPAWNED", @@ -587,7 +585,6 @@ "FENNEC_TABQUEUE_QUEUESIZE", "FENNEC_TOPSITES_LOADER_TIME_MS", "FENNEC_WAS_KILLED", - "FETCH_IS_MAINTHREAD", "FIND_PLUGINS", "FONTLIST_INITFACENAMELISTS", "FONTLIST_INITOTHERFAMILYNAMES", @@ -904,7 +901,6 @@ "SERVICE_WORKER_LIFE_TIME", "SERVICE_WORKER_REGISTRATIONS", "SERVICE_WORKER_REGISTRATION_LOADING", - "SERVICE_WORKER_REQUEST_PASSTHROUGH", "SERVICE_WORKER_SPAWN_ATTEMPTS", "SERVICE_WORKER_UPDATED", "SERVICE_WORKER_WAS_SPAWNED",