Bug 1573842 - Don't report use counters for resource document; r=smaug a=RyanVM
☠☠ backed out by 35588046b8f9 ☠ ☠
authorEdgar Chen <echen@mozilla.com>
Thu, 15 Aug 2019 13:34:57 +0000
changeset 545155 e2097b17e4657f5eeec57d7db7fdd5a2121c6ff9
parent 545154 432eb4511c02efd5652016ccf08065f1d0966a98
child 545156 f27beeba6968f35a785fa2557967c0e5324d06c6
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, RyanVM
bugs1573842
milestone69.0
Bug 1573842 - Don't report use counters for resource document; r=smaug a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D41976
dom/base/Document.cpp
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -14464,17 +14464,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 || MightBeAboutOrChromeScheme(uri)) {
+    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.