Bug 1578700 - Rename a variable to better follow our coding style. r=smaug a=RyanVM
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 04 Sep 2019 21:47:57 +0000
changeset 555323 84589f69c57b55729d932ce6c06ba853c7cfd5e0
parent 555322 27d3f22ee1be2611b8c4ae5074a4865635d43218
child 555324 cbb2a9654a653c4c825eb42a926654d4ccf7359f
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, RyanVM
bugs1578700
milestone70.0
Bug 1578700 - Rename a variable to better follow our coding style. r=smaug a=RyanVM It's a constant, not a global. This matches both the Mozilla and Google coding styles so should hopefully be uncontroversial. Differential Revision: https://phabricator.services.mozilla.com/D44643
dom/base/Document.cpp
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -14397,33 +14397,34 @@ bool Document::InlineScriptAllowedByCSP(
         0,              // aColumnNumber
         &allowsInlineScript);
     NS_ENSURE_SUCCESS(rv, true);
   }
   return allowsInlineScript;
 }
 
 void Document::ReportUseCounters() {
-  static const bool sDebugUseCounters = false;
+  static const bool kDebugUseCounters = false;
+
   if (mReportedUseCounters) {
     return;
   }
 
   mReportedUseCounters = true;
 
   if (Telemetry::HistogramUseCounterCount > 0 &&
       (IsContentDocument() || IsResourceDoc())) {
     nsCOMPtr<nsIURI> uri;
     NodePrincipal()->GetURI(getter_AddRefs(uri));
     if (!uri || uri->SchemeIs("about") || uri->SchemeIs("chrome") ||
         uri->SchemeIs("resource")) {
       return;
     }
 
-    if (sDebugUseCounters) {
+    if (kDebugUseCounters) {
       nsCString spec = uri->GetSpecOrDefault();
 
       // URIs can be rather long for data documents, so truncate them to
       // some reasonable length.
       spec.Truncate(std::min(128U, spec.Length()));
       printf("-- Use counters for %s --\n", spec.get());
     }
 
@@ -14459,17 +14460,17 @@ void Document::ReportUseCounters() {
     for (int32_t c = 0; c < eUseCounter_Count; ++c) {
       UseCounter uc = static_cast<UseCounter>(c);
 
       Telemetry::HistogramID id = static_cast<Telemetry::HistogramID>(
           Telemetry::HistogramFirstUseCounter + uc * 2);
       bool value = GetUseCounter(uc);
 
       if (value) {
-        if (sDebugUseCounters) {
+        if (kDebugUseCounters) {
           const char* name = Telemetry::GetHistogramName(id);
           if (name) {
             printf("  %s", name);
           } else {
             printf("  #%d", id);
           }
           printf(": %d\n", value);
         }
@@ -14478,17 +14479,17 @@ void Document::ReportUseCounters() {
       }
 
       if (IsTopLevelContentDocument()) {
         id = static_cast<Telemetry::HistogramID>(
             Telemetry::HistogramFirstUseCounter + uc * 2 + 1);
         value = GetUseCounter(uc) || GetChildDocumentUseCounter(uc);
 
         if (value) {
-          if (sDebugUseCounters) {
+          if (kDebugUseCounters) {
             const char* name = Telemetry::GetHistogramName(id);
             if (name) {
               printf("  %s", name);
             } else {
               printf("  #%d", id);
             }
             printf(": %d\n", value);
           }