Bug 1573842 - Don't report use counters for resource document; r=smaug
authorEdgar Chen <echen@mozilla.com>
Thu, 15 Aug 2019 13:34:57 +0000
changeset 488234 8bc7660d5f16c2f14fa673bac5a7d178a48b48c8
parent 488233 5128445df0de7cd28f6bf0f603b90e4af186dc68
child 488235 b3194a6ba51e91aefe3933da163e6ba622b0c9f7
push id113904
push userncsoregi@mozilla.com
push dateThu, 15 Aug 2019 19:41:00 +0000
treeherdermozilla-inbound@b283a7ef186c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1573842
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1573842 - Don't report use counters for resource document; r=smaug Differential Revision: https://phabricator.services.mozilla.com/D41976
dom/base/Document.cpp
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -14394,17 +14394,18 @@ void Document::ReportUseCounters(UseCoun
   if (aKind == UseCounterReportKind::eIncludeExternalResources) {
     EnumerateExternalResources(ReportExternalResourceUseCounters, nullptr);
   }
 
   if (Telemetry::HistogramUseCounterCount > 0 &&
       (IsContentDocument() || IsResourceDoc())) {
     nsCOMPtr<nsIURI> uri;
     NodePrincipal()->GetURI(getter_AddRefs(uri));
-    if (!uri || uri->SchemeIs("about") || uri->SchemeIs("chrome")) {
+    if (!uri || uri->SchemeIs("about") || uri->SchemeIs("chrome") ||
+        uri->SchemeIs("resource")) {
       return;
     }
 
     if (sDebugUseCounters) {
       nsCString spec = uri->GetSpecOrDefault();
 
       // URIs can be rather long for data documents, so truncate them to
       // some reasonable length.