Backed out changeset 42a4e28e6210 (bug 1361661)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Mon, 22 May 2017 20:40:17 +0200
changeset 408143 f77ffc9600cda7a294790ba566727fb9ee43b856
parent 408142 ab92a04574be7bf18202df0f0814b4216eefbcfd
child 408144 b06174a13f445de7eebaa26601648cb0de258d83
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1361661
milestone55.0a1
backs out42a4e28e621049fe2398e3b7ddf5c6f69fb1ed5a
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
Backed out changeset 42a4e28e6210 (bug 1361661)
toolkit/components/telemetry/TelemetryCommon.cpp
toolkit/components/telemetry/TelemetryCommon.h
toolkit/components/telemetry/TelemetryEvent.cpp
toolkit/components/telemetry/TelemetryEvent.h
toolkit/components/telemetry/TelemetryHistogram.cpp
toolkit/components/telemetry/TelemetryHistogram.h
toolkit/components/telemetry/TelemetryScalar.cpp
toolkit/components/telemetry/TelemetryScalar.h
toolkit/components/telemetry/tests/gtest/TestScalars.cpp
toolkit/components/telemetry/tests/unit/test_ChildEvents.js
toolkit/components/telemetry/tests/unit/test_ChildScalars.js
toolkit/components/telemetry/tests/unit/test_TelemetryEvents.js
toolkit/components/telemetry/tests/unit/test_TelemetryScalars.js
--- a/toolkit/components/telemetry/TelemetryCommon.cpp
+++ b/toolkit/components/telemetry/TelemetryCommon.cpp
@@ -6,17 +6,16 @@
 
 #include "nsITelemetry.h"
 #include "nsVersionComparator.h"
 #include "mozilla/TimeStamp.h"
 #include "nsIConsoleService.h"
 #include "nsThreadUtils.h"
 
 #include "TelemetryCommon.h"
-#include "TelemetryProcessData.h"
 
 #include <cstring>
 
 namespace mozilla {
 namespace Telemetry {
 namespace Common {
 
 bool
@@ -74,22 +73,16 @@ CanRecordInProcess(RecordedProcessType p
   // We can use (1 << ProcessType) due to the way RecordedProcessType is defined.
   bool canRecordProcess =
     !!(processes & static_cast<RecordedProcessType>(1 << processType));
 
   return canRecordProcess ||
          ((processType != GeckoProcessType_Default) && recordAllChild);
 }
 
-bool
-CanRecordInProcess(RecordedProcessType processes, ProcessID processId)
-{
-  return CanRecordInProcess(processes, GetGeckoProcessType(processId));
-}
-
 nsresult
 MsSinceProcessStart(double* aResult)
 {
   bool error;
   *aResult = (TimeStamp::NowLoRes() -
               TimeStamp::ProcessCreation(&error)).ToMilliseconds();
   if (error) {
     return NS_ERROR_NOT_AVAILABLE;
@@ -114,25 +107,11 @@ LogToBrowserConsole(uint32_t aLogLevel, 
     return;
   }
 
   nsCOMPtr<nsIScriptError> error(do_CreateInstance(NS_SCRIPTERROR_CONTRACTID));
   error->Init(aMsg, EmptyString(), EmptyString(), 0, 0, aLogLevel, "chrome javascript");
   console->LogMessage(error);
 }
 
-const char*
-GetNameForProcessID(ProcessID process)
-{
-  MOZ_ASSERT(process < ProcessID::Count);
-  return ProcessIDToString[static_cast<uint32_t>(process)];
-}
-
-GeckoProcessType
-GetGeckoProcessType(ProcessID process)
-{
-  MOZ_ASSERT(process < ProcessID::Count);
-  return ProcessIDToGeckoProcessType[static_cast<uint32_t>(process)];
-}
-
 } // namespace Common
 } // namespace Telemetry
 } // namespace mozilla
--- a/toolkit/components/telemetry/TelemetryCommon.h
+++ b/toolkit/components/telemetry/TelemetryCommon.h
@@ -6,17 +6,16 @@
 #ifndef TelemetryCommon_h__
 #define TelemetryCommon_h__
 
 #include "nsTHashtable.h"
 #include "jsapi.h"
 #include "nsIScriptError.h"
 #include "nsXULAppAPI.h"
 #include "mozilla/TypedEnumBits.h"
-#include "mozilla/TelemetryProcessEnums.h"
 
 namespace mozilla {
 namespace Telemetry {
 namespace Common {
 
 enum class RecordedProcessType : uint32_t {
   Main       = (1 << GeckoProcessType_Default),  // Also known as "parent process"
   Content    = (1 << GeckoProcessType_Content),
@@ -58,17 +57,16 @@ AutoHashtable<EntryType>::ReflectIntoJS(
   }
   return true;
 }
 
 bool IsExpiredVersion(const char* aExpiration);
 bool IsInDataset(uint32_t aDataset, uint32_t aContainingDataset);
 bool CanRecordDataset(uint32_t aDataset, bool aCanRecordBase, bool aCanRecordExtended);
 bool CanRecordInProcess(RecordedProcessType aProcesses, GeckoProcessType aProcess);
-bool CanRecordInProcess(RecordedProcessType aProcesses, ProcessID aProcess);
 
 /**
  * Return the number of milliseconds since process start using monotonic
  * timestamps (unaffected by system clock changes).
  *
  * @return NS_OK on success, NS_ERROR_NOT_AVAILABLE if TimeStamp doesn't have the data.
  */
 nsresult MsSinceProcessStart(double* aResult);
@@ -77,26 +75,13 @@ nsresult MsSinceProcessStart(double* aRe
  * Dumps a log message to the Browser Console using the provided level.
  *
  * @param aLogLevel The level to use when displaying the message in the browser console
  *        (e.g. nsIScriptError::warningFlag, ...).
  * @param aMsg The text message to print to the console.
  */
 void LogToBrowserConsole(uint32_t aLogLevel, const nsAString& aMsg);
 
-/**
- * Get the name string for a ProcessID.
- * This is the name we use for the Telemetry payloads.
- */
-const char* GetNameForProcessID(ProcessID process);
-
-/**
- * Get the GeckoProcessType for a ProcessID.
- * Telemetry distinguishes between more process types than the GeckoProcessType,
- * so the mapping is not direct.
- */
-GeckoProcessType GetGeckoProcessType(ProcessID process);
-
 } // namespace Common
 } // namespace Telemetry
 } // namespace mozilla
 
 #endif // TelemetryCommon_h__
--- a/toolkit/components/telemetry/TelemetryEvent.cpp
+++ b/toolkit/components/telemetry/TelemetryEvent.cpp
@@ -34,20 +34,18 @@ using mozilla::StaticAutoPtr;
 using mozilla::TimeStamp;
 using mozilla::Telemetry::Common::AutoHashtable;
 using mozilla::Telemetry::Common::IsExpiredVersion;
 using mozilla::Telemetry::Common::CanRecordDataset;
 using mozilla::Telemetry::Common::IsInDataset;
 using mozilla::Telemetry::Common::MsSinceProcessStart;
 using mozilla::Telemetry::Common::LogToBrowserConsole;
 using mozilla::Telemetry::Common::CanRecordInProcess;
-using mozilla::Telemetry::Common::GetNameForProcessID;
 using mozilla::Telemetry::EventExtraEntry;
 using mozilla::Telemetry::ChildEventData;
-using mozilla::Telemetry::ProcessID;
 
 namespace TelemetryIPCAccumulator = mozilla::TelemetryIPCAccumulator;
 
 ////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////
 //
 // Naming: there are two kinds of functions in this file:
 //
@@ -275,17 +273,17 @@ nsClassHashtable<nsUint32HashKey, EventR
 ////////////////////////////////////////////////////////////////////////
 //
 // PRIVATE: thread-safe helpers for event recording.
 
 namespace {
 
 bool
 CanRecordEvent(const StaticMutexAutoLock& lock, const CommonEventInfo& info,
-               ProcessID process)
+               GeckoProcessType process)
 {
   if (!gCanRecordBase) {
     return false;
   }
 
   if (!CanRecordDataset(info.dataset, gCanRecordBase, gCanRecordExtended)) {
     return false;
   }
@@ -293,38 +291,38 @@ CanRecordEvent(const StaticMutexAutoLock
   if (!CanRecordInProcess(info.record_in_processes, process)) {
     return false;
   }
 
   return gEnabledCategories.GetEntry(info.category_offset);
 }
 
 EventRecordArray*
-GetEventRecordsForProcess(const StaticMutexAutoLock& lock, ProcessID processType)
+GetEventRecordsForProcess(const StaticMutexAutoLock& lock, GeckoProcessType processType)
 {
   EventRecordArray* eventRecords = nullptr;
-  if (!gEventRecords.Get(uint32_t(processType), &eventRecords)) {
+  if (!gEventRecords.Get(processType, &eventRecords)) {
     eventRecords = new EventRecordArray();
-    gEventRecords.Put(uint32_t(processType), eventRecords);
+    gEventRecords.Put(processType, eventRecords);
   }
   return eventRecords;
 }
 
 bool
 GetEventId(const StaticMutexAutoLock& lock, const nsACString& category,
            const nsACString& method, const nsACString& object,
            uint32_t* eventId)
 {
   MOZ_ASSERT(eventId);
   const nsCString& name = UniqueEventName(category, method, object);
   return gEventNameIDMap.Get(name, eventId);
 }
 
 RecordEventResult
-RecordEvent(const StaticMutexAutoLock& lock, ProcessID processType,
+RecordEvent(const StaticMutexAutoLock& lock, GeckoProcessType processType,
             double timestamp, const nsACString& category,
             const nsACString& method, const nsACString& object,
             const Maybe<nsCString>& value, const ExtraArray& extra)
 {
   EventRecordArray* eventRecords = GetEventRecordsForProcess(lock, processType);
 
   // Apply hard limit on event count in storage.
   if (eventRecords->Length() >= kMaxEventRecords) {
@@ -574,17 +572,17 @@ TelemetryEvent::SetCanRecordBase(bool b)
 
 void
 TelemetryEvent::SetCanRecordExtended(bool b) {
   StaticMutexAutoLock locker(gTelemetryEventsMutex);
   gCanRecordExtended = b;
 }
 
 nsresult
-TelemetryEvent::RecordChildEvents(ProcessID aProcessType,
+TelemetryEvent::RecordChildEvents(GeckoProcessType aProcessType,
                                   const nsTArray<mozilla::Telemetry::ChildEventData>& aEvents)
 {
   MOZ_ASSERT(XRE_IsParentProcess());
   StaticMutexAutoLock locker(gTelemetryEventsMutex);
   for (uint32_t i = 0; i < aEvents.Length(); ++i) {
     const mozilla::Telemetry::ChildEventData e = aEvents[i];
 
     // Timestamps from child processes are absolute. We fix them up here to be
@@ -702,17 +700,17 @@ TelemetryEvent::RecordEvent(const nsACSt
     }
 
     // Get the current time.
     double timestamp = -1;
     if (NS_WARN_IF(NS_FAILED(MsSinceProcessStart(&timestamp)))) {
       return NS_ERROR_FAILURE;
     }
 
-    res = ::RecordEvent(lock, ProcessID::Parent, timestamp, aCategory, aMethod, aObject, value, extra);
+    res = ::RecordEvent(lock, GeckoProcessType_Default, timestamp, aCategory, aMethod, aObject, value, extra);
   }
 
   // Trigger warnings or errors where needed.
   switch (res) {
     case RecordEventResult::UnknownEvent: {
       JS_ReportErrorASCII(cx, R"(Unknown event: ["%s", "%s", "%s"])",
                           PromiseFlatCString(aCategory).get(),
                           PromiseFlatCString(aMethod).get(),
@@ -765,17 +763,17 @@ TelemetryEvent::CreateSnapshots(uint32_t
         const EventInfo& info = gEventInfo[record.EventId()];
 
         if (IsInDataset(info.common_info.dataset, aDataset)) {
           events.AppendElement(record);
         }
       }
 
       if (events.Length()) {
-        const char* processName = GetNameForProcessID(ProcessID(iter.Key()));
+        const char* processName = XRE_ChildProcessTypeToString(GeckoProcessType(iter.Key()));
         processEvents.AppendElement(mozilla::MakePair(processName, events));
       }
     }
 
     if (aClear) {
       gEventRecords.Clear();
     }
   }
--- a/toolkit/components/telemetry/TelemetryEvent.h
+++ b/toolkit/components/telemetry/TelemetryEvent.h
@@ -2,17 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef TelemetryEvent_h__
 #define TelemetryEvent_h__
 
 #include "mozilla/TelemetryEventEnums.h"
-#include "mozilla/TelemetryProcessEnums.h"
 
 namespace mozilla {
 namespace Telemetry {
   struct ChildEventData;
 }
 }
 
 // This module is internal to Telemetry. It encapsulates Telemetry's
@@ -33,17 +32,17 @@ nsresult RecordEvent(const nsACString& a
                      const nsACString& aObject, JS::HandleValue aValue,
                      JS::HandleValue aExtra, JSContext* aCx,
                      uint8_t optional_argc);
 void SetEventRecordingEnabled(const nsACString& aCategory, bool aEnabled);
 nsresult CreateSnapshots(uint32_t aDataset, bool aClear, JSContext* aCx,
                          uint8_t optional_argc, JS::MutableHandleValue aResult);
 
 // Record events from child processes.
-nsresult RecordChildEvents(mozilla::Telemetry::ProcessID aProcessType,
+nsresult RecordChildEvents(GeckoProcessType aProcessType,
                            const nsTArray<mozilla::Telemetry::ChildEventData>& aEvents);
 
 // Only to be used for testing.
 void ClearEvents();
 
 size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
 
 } // namespace TelemetryEvent
--- a/toolkit/components/telemetry/TelemetryHistogram.cpp
+++ b/toolkit/components/telemetry/TelemetryHistogram.cpp
@@ -32,17 +32,16 @@ using base::StatisticsRecorder;
 using base::BooleanHistogram;
 using base::CountHistogram;
 using base::FlagHistogram;
 using base::LinearHistogram;
 using mozilla::StaticMutex;
 using mozilla::StaticMutexAutoLock;
 using mozilla::Telemetry::Accumulation;
 using mozilla::Telemetry::KeyedAccumulation;
-using mozilla::Telemetry::ProcessID;
 using mozilla::Telemetry::Common::LogToBrowserConsole;
 
 namespace TelemetryIPCAccumulator = mozilla::TelemetryIPCAccumulator;
 
 ////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////
 //
 // Naming: there are two kinds of functions in this file:
@@ -98,17 +97,16 @@ namespace TelemetryIPCAccumulator = mozi
 //
 // PRIVATE TYPES
 
 #define EXPIRED_ID "__expired__"
 #define SUBSESSION_HISTOGRAM_PREFIX "sub#"
 #define KEYED_HISTOGRAM_NAME_SEPARATOR "#"
 #define CONTENT_HISTOGRAM_SUFFIX "#content"
 #define GPU_HISTOGRAM_SUFFIX "#gpu"
-#define EXTENSION_HISTOGRAM_SUFFIX "#extension"
 
 namespace {
 
 using mozilla::Telemetry::Common::AutoHashtable;
 using mozilla::Telemetry::Common::IsExpiredVersion;
 using mozilla::Telemetry::Common::CanRecordDataset;
 using mozilla::Telemetry::Common::IsInDataset;
 
@@ -382,54 +380,49 @@ internal_HistogramGet(const char *name, 
     NS_ASSERTION(false, "Invalid histogram type");
     return NS_ERROR_INVALID_ARG;
   }
   return NS_OK;
 }
 
 // Read the process type from the given histogram name. The process type, if
 // one exists, is embedded in a suffix.
-mozilla::Telemetry::ProcessID
+GeckoProcessType
 GetProcessFromName(const nsACString& aString)
 {
   if (StringEndsWith(aString, NS_LITERAL_CSTRING(CONTENT_HISTOGRAM_SUFFIX))) {
-    return ProcessID::Content;
+    return GeckoProcessType_Content;
   }
   if (StringEndsWith(aString, NS_LITERAL_CSTRING(GPU_HISTOGRAM_SUFFIX))) {
-    return ProcessID::Gpu;
+    return GeckoProcessType_GPU;
   }
-  if (StringEndsWith(aString, NS_LITERAL_CSTRING(EXTENSION_HISTOGRAM_SUFFIX))) {
-    return ProcessID::Extension;
-  }
-  return ProcessID::Parent;
+  return GeckoProcessType_Default;
 }
 
 const char*
-SuffixForProcessType(mozilla::Telemetry::ProcessID aProcessType)
+SuffixForProcessType(GeckoProcessType aProcessType)
 {
   switch (aProcessType) {
-    case ProcessID::Parent:
+    case GeckoProcessType_Default:
       return nullptr;
-    case ProcessID::Content:
+    case GeckoProcessType_Content:
       return CONTENT_HISTOGRAM_SUFFIX;
-    case ProcessID::Gpu:
+    case GeckoProcessType_GPU:
       return GPU_HISTOGRAM_SUFFIX;
-    case ProcessID::Extension:
-      return EXTENSION_HISTOGRAM_SUFFIX;
     default:
       MOZ_ASSERT_UNREACHABLE("unknown process type");
       return nullptr;
   }
 }
 
 CharPtrEntryType*
 internal_GetHistogramMapEntry(const char* aName)
 {
   nsDependentCString name(aName);
-  ProcessID process = GetProcessFromName(name);
+  GeckoProcessType process = GetProcessFromName(name);
   const char* suffix = SuffixForProcessType(process);
   if (!suffix) {
     return gHistogramMap.GetEntry(aName);
   }
 
   auto root = Substring(name, 0, name.Length() - strlen(suffix));
   return gHistogramMap.GetEntry(PromiseFlatCString(root).get());
 }
@@ -446,39 +439,34 @@ internal_GetHistogramEnumId(const char *
     return NS_ERROR_INVALID_ARG;
   }
   *id = entry->mData;
   return NS_OK;
 }
 
 // O(1) histogram lookup by numeric id
 nsresult
-internal_GetHistogramByEnumId(mozilla::Telemetry::HistogramID id, Histogram **ret,
-                              ProcessID aProcessType)
+internal_GetHistogramByEnumId(mozilla::Telemetry::HistogramID id, Histogram **ret, GeckoProcessType aProcessType)
 {
   static Histogram* knownHistograms[mozilla::Telemetry::HistogramCount] = {0};
   static Histogram* knownContentHistograms[mozilla::Telemetry::HistogramCount] = {0};
   static Histogram* knownGPUHistograms[mozilla::Telemetry::HistogramCount] = {0};
-  static Histogram* knownExtensionHistograms[mozilla::Telemetry::HistogramCount] = {0};
 
   Histogram** knownList = nullptr;
 
   switch (aProcessType) {
-  case ProcessID::Parent:
+  case GeckoProcessType_Default:
     knownList = knownHistograms;
     break;
-  case ProcessID::Content:
+  case GeckoProcessType_Content:
     knownList = knownContentHistograms;
     break;
-  case ProcessID::Gpu:
+  case GeckoProcessType_GPU:
     knownList = knownGPUHistograms;
     break;
-  case ProcessID::Extension:
-    knownList = knownExtensionHistograms;
-    break;
   default:
     MOZ_ASSERT_UNREACHABLE("unknown process type");
     return NS_ERROR_FAILURE;
   }
 
   Histogram* h = knownList[id];
   if (h) {
     *ret = h;
@@ -528,17 +516,17 @@ internal_GetHistogramByName(const nsACSt
 {
   mozilla::Telemetry::HistogramID id;
   nsresult rv
     = internal_GetHistogramEnumId(PromiseFlatCString(name).get(), &id);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
-  ProcessID process = GetProcessFromName(name);
+  GeckoProcessType process = GetProcessFromName(name);
   rv = internal_GetHistogramByEnumId(id, ret, process);
   if (NS_FAILED(rv))
     return rv;
 
   return NS_OK;
 }
 
 
@@ -569,17 +557,17 @@ internal_CloneHistogram(const nsACString
 
   Histogram::SampleSet ss;
   existing.SnapshotSample(&ss);
   clone->AddSampleSet(ss);
 
   return clone;
 }
 
-ProcessID
+GeckoProcessType
 GetProcessFromName(const std::string& aString)
 {
   nsDependentCString string(aString.c_str(), aString.length());
   return GetProcessFromName(string);
 }
 
 Histogram*
 internal_GetSubsessionHistogram(Histogram& existing)
@@ -589,34 +577,30 @@ internal_GetSubsessionHistogram(Histogra
     = internal_GetHistogramEnumId(existing.histogram_name().c_str(), &id);
   if (NS_FAILED(rv) || gHistograms[id].keyed) {
     return nullptr;
   }
 
   static Histogram* subsession[mozilla::Telemetry::HistogramCount] = {};
   static Histogram* subsessionContent[mozilla::Telemetry::HistogramCount] = {};
   static Histogram* subsessionGPU[mozilla::Telemetry::HistogramCount] = {};
-  static Histogram* subsessionExtension[mozilla::Telemetry::HistogramCount] = {};
 
   Histogram** cache = nullptr;
 
-  ProcessID process = GetProcessFromName(existing.histogram_name());
+  GeckoProcessType process = GetProcessFromName(existing.histogram_name());
   switch (process) {
-  case ProcessID::Parent:
+  case GeckoProcessType_Default:
     cache = subsession;
     break;
-  case ProcessID::Content:
+  case GeckoProcessType_Content:
     cache = subsessionContent;
     break;
-  case ProcessID::Gpu:
+  case GeckoProcessType_GPU:
     cache = subsessionGPU;
     break;
-  case ProcessID::Extension:
-    cache = subsessionExtension;
-    break;
   default:
     MOZ_ASSERT_UNREACHABLE("unknown process type");
     return nullptr;
   }
 
   if (Histogram* cached = cache[id]) {
     return cached;
   }
@@ -1159,34 +1143,34 @@ internal_SetHistogramRecordingEnabled(mo
     const nsDependentCString id(gHistograms[aID].id());
     KeyedHistogram* keyed = internal_GetKeyedHistogramById(id);
     if (keyed) {
       keyed->SetRecordingEnabled(aEnabled);
       return;
     }
   } else {
     Histogram *h;
-    nsresult rv = internal_GetHistogramByEnumId(aID, &h, ProcessID::Parent);
+    nsresult rv = internal_GetHistogramByEnumId(aID, &h, GeckoProcessType_Default);
     if (NS_SUCCEEDED(rv)) {
       h->SetRecordingEnabled(aEnabled);
       return;
     }
   }
 
   MOZ_ASSERT(false, "Telemetry::SetHistogramRecordingEnabled(...) id not found");
 }
 
 bool
 internal_RemoteAccumulate(mozilla::Telemetry::HistogramID aId, uint32_t aSample)
 {
   if (XRE_IsParentProcess()) {
     return false;
   }
   Histogram *h;
-  nsresult rv = internal_GetHistogramByEnumId(aId, &h, ProcessID::Parent);
+  nsresult rv = internal_GetHistogramByEnumId(aId, &h, GeckoProcessType_Default);
   if (NS_SUCCEEDED(rv) && !h->IsRecordingEnabled()) {
     return true;
   }
   TelemetryIPCAccumulator::AccumulateChildHistogram(aId, aSample);
   return true;
 }
 
 bool
@@ -1209,17 +1193,17 @@ internal_RemoteAccumulate(mozilla::Telem
 
 void internal_Accumulate(mozilla::Telemetry::HistogramID aHistogram, uint32_t aSample)
 {
   if (!internal_CanRecordBase() ||
       internal_RemoteAccumulate(aHistogram, aSample)) {
     return;
   }
   Histogram *h;
-  nsresult rv = internal_GetHistogramByEnumId(aHistogram, &h, ProcessID::Parent);
+  nsresult rv = internal_GetHistogramByEnumId(aHistogram, &h, GeckoProcessType_Default);
   if (NS_SUCCEEDED(rv)) {
     internal_HistogramAdd(*h, aSample, gHistograms[aHistogram].dataset);
   }
 }
 
 void
 internal_Accumulate(mozilla::Telemetry::HistogramID aID,
                     const nsCString& aKey, uint32_t aSample)
@@ -1261,32 +1245,32 @@ internal_Accumulate(KeyedHistogram& aKey
 
   mozilla::Telemetry::HistogramID id;
   if (NS_SUCCEEDED(aKeyed.GetEnumId(id))) {
     internal_RemoteAccumulate(id, aKey, aSample);
   }
 }
 
 void
-internal_AccumulateChild(ProcessID aProcessType, mozilla::Telemetry::HistogramID aId, uint32_t aSample)
+internal_AccumulateChild(GeckoProcessType aProcessType, mozilla::Telemetry::HistogramID aId, uint32_t aSample)
 {
   if (!internal_CanRecordBase()) {
     return;
   }
   Histogram* h;
   nsresult rv = internal_GetHistogramByEnumId(aId, &h, aProcessType);
   if (NS_SUCCEEDED(rv)) {
     internal_HistogramAdd(*h, aSample, gHistograms[aId].dataset);
   } else {
     NS_WARNING("NS_FAILED GetHistogramByEnumId for CHILD");
   }
 }
 
 void
-internal_AccumulateChildKeyed(ProcessID aProcessType, mozilla::Telemetry::HistogramID aId,
+internal_AccumulateChildKeyed(GeckoProcessType aProcessType, mozilla::Telemetry::HistogramID aId,
                               const nsCString& aKey, uint32_t aSample)
 {
   if (!gInitDone || !internal_CanRecordBase()) {
     return;
   }
 
   const char* suffix = SuffixForProcessType(aProcessType);
   if (!suffix) {
@@ -1872,22 +1856,16 @@ void TelemetryHistogram::InitializeGloba
                                               h.min, h.max, h.bucketCount, h.dataset));
 
 
       nsCString gpuId(id);
       gpuId.AppendLiteral(GPU_HISTOGRAM_SUFFIX);
       gKeyedHistograms.Put(gpuId,
                            new KeyedHistogram(id, expiration, h.histogramType,
                                               h.min, h.max, h.bucketCount, h.dataset));
-
-      nsCString extensionId(id);
-      extensionId.AppendLiteral(EXTENSION_HISTOGRAM_SUFFIX);
-      gKeyedHistograms.Put(extensionId,
-                           new KeyedHistogram(id, expiration, h.histogramType,
-                                              h.min, h.max, h.bucketCount, h.dataset));
     }
   }
 
   // Some Telemetry histograms depend on the value of C++ constants and hardcode
   // their values in Histograms.json.
   // We add static asserts here for those values to match so that future changes
   // don't go unnoticed.
   // TODO: Compare explicitly with gHistograms[<histogram id>].bucketCount here
@@ -2066,17 +2044,17 @@ TelemetryHistogram::AccumulateCategorica
   uint32_t labelId = 0;
   if (NS_FAILED(gHistograms[aId].label_id(label.get(), &labelId))) {
     return;
   }
   internal_Accumulate(aId, labelId);
 }
 
 void
-TelemetryHistogram::AccumulateChild(ProcessID aProcessType,
+TelemetryHistogram::AccumulateChild(GeckoProcessType aProcessType,
                                     const nsTArray<Accumulation>& aAccumulations)
 {
   MOZ_ASSERT(XRE_IsParentProcess());
 
   StaticMutexAutoLock locker(gTelemetryHistogramMutex);
   if (!internal_CanRecordBase()) {
     return;
   }
@@ -2085,17 +2063,17 @@ TelemetryHistogram::AccumulateChild(Proc
       MOZ_ASSERT_UNREACHABLE("Histogram usage requires valid ids.");
       continue;
     }
     internal_AccumulateChild(aProcessType, aAccumulations[i].mId, aAccumulations[i].mSample);
   }
 }
 
 void
-TelemetryHistogram::AccumulateChildKeyed(ProcessID aProcessType,
+TelemetryHistogram::AccumulateChildKeyed(GeckoProcessType aProcessType,
                                          const nsTArray<KeyedAccumulation>& aAccumulations)
 {
   MOZ_ASSERT(XRE_IsParentProcess());
   StaticMutexAutoLock locker(gTelemetryHistogramMutex);
   if (!internal_CanRecordBase()) {
     return;
   }
   for (uint32_t i = 0; i < aAccumulations.Length(); ++i) {
@@ -2181,21 +2159,24 @@ TelemetryHistogram::CreateHistogramSnaps
     }
     const uint32_t type = gHistograms[i].histogramType;
     if (type == nsITelemetry::HISTOGRAM_FLAG ||
         type == nsITelemetry::HISTOGRAM_COUNT) {
       Histogram *h;
       mozilla::DebugOnly<nsresult> rv;
       mozilla::Telemetry::HistogramID id = mozilla::Telemetry::HistogramID(i);
 
-      for (uint32_t process = 0; process < static_cast<uint32_t>(ProcessID::Count); ++process) {
-        if ((ProcessID(process) == ProcessID::Gpu) && !includeGPUProcess) {
-          continue;
-        }
-        rv = internal_GetHistogramByEnumId(id, &h, ProcessID(process));
+      rv = internal_GetHistogramByEnumId(id, &h, GeckoProcessType_Default);
+      MOZ_ASSERT(NS_SUCCEEDED(rv));
+
+      rv = internal_GetHistogramByEnumId(id, &h, GeckoProcessType_Content);
+      MOZ_ASSERT(NS_SUCCEEDED(rv));
+
+      if (includeGPUProcess) {
+        rv = internal_GetHistogramByEnumId(id, &h, GeckoProcessType_GPU);
         MOZ_ASSERT(NS_SUCCEEDED(rv));
       }
     }
   }
 
   StatisticsRecorder::Histograms hs;
   StatisticsRecorder::GetHistograms(&hs);
 
@@ -2204,29 +2185,28 @@ TelemetryHistogram::CreateHistogramSnaps
   // depend on histogram enumeration order.
   //
   // Of course, we hope that all of these corruption-statistics
   // histograms are not themselves corrupt...
   internal_IdentifyCorruptHistograms(hs);
 
   // OK, now we can actually reflect things.
   JS::Rooted<JSObject*> hobj(cx);
+  GeckoProcessType const processTypes[] = { GeckoProcessType_Default, GeckoProcessType_Content, GeckoProcessType_GPU };
+  size_t numProcessTypes = (includeGPUProcess ? 3 : 2);
   for (size_t i = 0; i < mozilla::Telemetry::HistogramCount; ++i) {
     if (gHistograms[i].keyed) {
       continue;
     }
 
     Histogram* h = nullptr;
     mozilla::Telemetry::HistogramID id = mozilla::Telemetry::HistogramID(i);
 
-    for (uint32_t process = 0; process < static_cast<uint32_t>(ProcessID::Count); ++process) {
-      if ((ProcessID(process) == ProcessID::Gpu) && !includeGPUProcess) {
-        continue;
-      }
-      nsresult rv = internal_GetHistogramByEnumId(id, &h, ProcessID(process));
+    for (size_t type = 0; type < numProcessTypes; ++type) {
+      nsresult rv = internal_GetHistogramByEnumId(id, &h, processTypes[type]);
       if (NS_WARN_IF(NS_FAILED(rv)) || !internal_ShouldReflectHistogram(h) ||
         internal_IsEmpty(h) || internal_IsExpired(h)) {
         continue;
       }
 
       Histogram* original = h;
 #if !defined(MOZ_WIDGET_ANDROID)
       if (subsession) {
--- a/toolkit/components/telemetry/TelemetryHistogram.h
+++ b/toolkit/components/telemetry/TelemetryHistogram.h
@@ -2,17 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef TelemetryHistogram_h__
 #define TelemetryHistogram_h__
 
 #include "mozilla/TelemetryHistogramEnums.h"
-#include "mozilla/TelemetryProcessEnums.h"
 
 #include "mozilla/TelemetryComms.h"
 #include "nsXULAppAPI.h"
 
 // This module is internal to Telemetry.  It encapsulates Telemetry's
 // histogram accumulation and storage logic.  It should only be used by
 // Telemetry.cpp.  These functions should not be used anywhere else.
 // For the public interface to Telemetry functionality, see Telemetry.h.
@@ -41,19 +40,19 @@ nsresult SetHistogramRecordingEnabled(co
 void Accumulate(mozilla::Telemetry::HistogramID aHistogram, uint32_t aSample);
 void Accumulate(mozilla::Telemetry::HistogramID aID, const nsCString& aKey,
                                             uint32_t aSample);
 void Accumulate(const char* name, uint32_t sample);
 void Accumulate(const char* name, const nsCString& key, uint32_t sample);
 
 void AccumulateCategorical(mozilla::Telemetry::HistogramID aId, const nsCString& aLabel);
 
-void AccumulateChild(mozilla::Telemetry::ProcessID aProcessType,
+void AccumulateChild(GeckoProcessType aProcessType,
                      const nsTArray<mozilla::Telemetry::Accumulation>& aAccumulations);
-void AccumulateChildKeyed(mozilla::Telemetry::ProcessID aProcessType,
+void AccumulateChildKeyed(GeckoProcessType aProcessType,
                           const nsTArray<mozilla::Telemetry::KeyedAccumulation>& aAccumulations);
 
 nsresult
 GetHistogramById(const nsACString &name, JSContext *cx,
                  JS::MutableHandle<JS::Value> ret);
 
 nsresult
 GetKeyedHistogramById(const nsACString &name, JSContext *cx,
--- a/toolkit/components/telemetry/TelemetryScalar.cpp
+++ b/toolkit/components/telemetry/TelemetryScalar.cpp
@@ -25,20 +25,18 @@
 
 using mozilla::StaticMutex;
 using mozilla::StaticMutexAutoLock;
 using mozilla::Telemetry::Common::AutoHashtable;
 using mozilla::Telemetry::Common::IsExpiredVersion;
 using mozilla::Telemetry::Common::CanRecordDataset;
 using mozilla::Telemetry::Common::IsInDataset;
 using mozilla::Telemetry::Common::LogToBrowserConsole;
-using mozilla::Telemetry::Common::GetNameForProcessID;
 using mozilla::Telemetry::ScalarActionType;
 using mozilla::Telemetry::ScalarVariant;
-using mozilla::Telemetry::ProcessID;
 
 namespace TelemetryIPCAccumulator = mozilla::TelemetryIPCAccumulator;
 
 ////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////
 //
 // Naming: there are two kinds of functions in this file:
 //
@@ -996,18 +994,17 @@ internal_GetEnumByScalarName(const nsACS
  * @param aRes The output variable that stores scalar object.
  * @return
  *   NS_ERROR_INVALID_ARG if the scalar id is unknown.
  *   NS_ERROR_NOT_AVAILABLE if the scalar is expired.
  *   NS_OK if the scalar was found. If that's the case, aResult contains a
  *   valid pointer to a scalar type.
  */
 nsresult
-internal_GetScalarByEnum(mozilla::Telemetry::ScalarID aId,
-                         ProcessID aProcessStorage,
+internal_GetScalarByEnum(mozilla::Telemetry::ScalarID aId, GeckoProcessType aProcessStorage,
                          ScalarBase** aRet)
 {
   if (!IsValidEnumId(aId)) {
     MOZ_ASSERT(false, "Requested a scalar with an invalid id.");
     return NS_ERROR_INVALID_ARG;
   }
 
   const uint32_t id = static_cast<uint32_t>(aId);
@@ -1084,17 +1081,17 @@ internal_UpdateScalar(const nsACString& 
       return sr;
     }
     TelemetryIPCAccumulator::RecordChildScalarAction(id, aType, variantValue.ref());
     return ScalarResult::Ok;
   }
 
   // Finally get the scalar.
   ScalarBase* scalar = nullptr;
-  rv = internal_GetScalarByEnum(id, ProcessID::Parent, &scalar);
+  rv = internal_GetScalarByEnum(id, GeckoProcessType_Default, &scalar);
   if (NS_FAILED(rv)) {
     // Don't throw on expired scalars.
     if (rv == NS_ERROR_NOT_AVAILABLE) {
       return ScalarResult::Ok;
     }
     return ScalarResult::UnknownScalar;
   }
 
@@ -1133,18 +1130,17 @@ namespace {
  * @return
  *   NS_ERROR_INVALID_ARG if the scalar id is unknown or a this is a keyed string
  *                        scalar.
  *   NS_ERROR_NOT_AVAILABLE if the scalar is expired.
  *   NS_OK if the scalar was found. If that's the case, aResult contains a
  *   valid pointer to a scalar type.
  */
 nsresult
-internal_GetKeyedScalarByEnum(mozilla::Telemetry::ScalarID aId,
-                              ProcessID aProcessStorage,
+internal_GetKeyedScalarByEnum(mozilla::Telemetry::ScalarID aId, GeckoProcessType aProcessStorage,
                               KeyedScalar** aRet)
 {
   if (!IsValidEnumId(aId)) {
     MOZ_ASSERT(false, "Requested a keyed scalar with an invalid id.");
     return NS_ERROR_INVALID_ARG;
   }
 
   const uint32_t id = static_cast<uint32_t>(aId);
@@ -1227,17 +1223,17 @@ internal_UpdateKeyedScalar(const nsACStr
       return sr;
     }
     TelemetryIPCAccumulator::RecordChildKeyedScalarAction(id, aKey, aType, variantValue.ref());
     return ScalarResult::Ok;
   }
 
   // Finally get the scalar.
   KeyedScalar* scalar = nullptr;
-  rv = internal_GetKeyedScalarByEnum(id, ProcessID::Parent, &scalar);
+  rv = internal_GetKeyedScalarByEnum(id, GeckoProcessType_Default, &scalar);
   if (NS_FAILED(rv)) {
     // Don't throw on expired scalars.
     if (rv == NS_ERROR_NOT_AVAILABLE) {
       return ScalarResult::Ok;
     }
     return ScalarResult::UnknownScalar;
   }
 
@@ -1415,17 +1411,17 @@ TelemetryScalar::Add(mozilla::Telemetry:
   // Accumulate in the child process if needed.
   if (!XRE_IsParentProcess()) {
     TelemetryIPCAccumulator::RecordChildScalarAction(aId, ScalarActionType::eAdd,
                                                      ScalarVariant(aValue));
     return;
   }
 
   ScalarBase* scalar = nullptr;
-  nsresult rv = internal_GetScalarByEnum(aId, ProcessID::Parent, &scalar);
+  nsresult rv = internal_GetScalarByEnum(aId, GeckoProcessType_Default, &scalar);
   if (NS_FAILED(rv)) {
     return;
   }
 
   scalar->AddValue(aValue);
 }
 
 /**
@@ -1454,17 +1450,17 @@ TelemetryScalar::Add(mozilla::Telemetry:
   // Accumulate in the child process if needed.
   if (!XRE_IsParentProcess()) {
     TelemetryIPCAccumulator::RecordChildKeyedScalarAction(
       aId, aKey, ScalarActionType::eAdd, ScalarVariant(aValue));
     return;
   }
 
   KeyedScalar* scalar = nullptr;
-  nsresult rv = internal_GetKeyedScalarByEnum(aId, ProcessID::Parent, &scalar);
+  nsresult rv = internal_GetKeyedScalarByEnum(aId, GeckoProcessType_Default, &scalar);
   if (NS_FAILED(rv)) {
     return;
   }
 
   scalar->AddValue(aKey, aValue);
 }
 
 /**
@@ -1563,17 +1559,17 @@ TelemetryScalar::Set(mozilla::Telemetry:
   // Accumulate in the child process if needed.
   if (!XRE_IsParentProcess()) {
     TelemetryIPCAccumulator::RecordChildScalarAction(aId, ScalarActionType::eSet,
                                                      ScalarVariant(aValue));
     return;
   }
 
   ScalarBase* scalar = nullptr;
-  nsresult rv = internal_GetScalarByEnum(aId, ProcessID::Parent, &scalar);
+  nsresult rv = internal_GetScalarByEnum(aId, GeckoProcessType_Default, &scalar);
   if (NS_FAILED(rv)) {
     return;
   }
 
   scalar->SetValue(aValue);
 }
 
 /**
@@ -1600,17 +1596,17 @@ TelemetryScalar::Set(mozilla::Telemetry:
   // Accumulate in the child process if needed.
   if (!XRE_IsParentProcess()) {
     TelemetryIPCAccumulator::RecordChildScalarAction(aId, ScalarActionType::eSet,
                                                      ScalarVariant(nsString(aValue)));
     return;
   }
 
   ScalarBase* scalar = nullptr;
-  nsresult rv = internal_GetScalarByEnum(aId, ProcessID::Parent, &scalar);
+  nsresult rv = internal_GetScalarByEnum(aId, GeckoProcessType_Default, &scalar);
   if (NS_FAILED(rv)) {
     return;
   }
 
   scalar->SetValue(aValue);
 }
 
 /**
@@ -1637,17 +1633,17 @@ TelemetryScalar::Set(mozilla::Telemetry:
   // Accumulate in the child process if needed.
   if (!XRE_IsParentProcess()) {
     TelemetryIPCAccumulator::RecordChildScalarAction(aId, ScalarActionType::eSet,
                                                      ScalarVariant(aValue));
     return;
   }
 
   ScalarBase* scalar = nullptr;
-  nsresult rv = internal_GetScalarByEnum(aId, ProcessID::Parent, &scalar);
+  nsresult rv = internal_GetScalarByEnum(aId, GeckoProcessType_Default, &scalar);
   if (NS_FAILED(rv)) {
     return;
   }
 
   scalar->SetValue(aValue);
 }
 
 /**
@@ -1676,17 +1672,17 @@ TelemetryScalar::Set(mozilla::Telemetry:
   // Accumulate in the child process if needed.
   if (!XRE_IsParentProcess()) {
     TelemetryIPCAccumulator::RecordChildKeyedScalarAction(
       aId, aKey, ScalarActionType::eSet, ScalarVariant(aValue));
     return;
   }
 
   KeyedScalar* scalar = nullptr;
-  nsresult rv = internal_GetKeyedScalarByEnum(aId, ProcessID::Parent, &scalar);
+  nsresult rv = internal_GetKeyedScalarByEnum(aId, GeckoProcessType_Default, &scalar);
   if (NS_FAILED(rv)) {
     return;
   }
 
   scalar->SetValue(aKey, aValue);
 }
 
 /**
@@ -1715,17 +1711,17 @@ TelemetryScalar::Set(mozilla::Telemetry:
   // Accumulate in the child process if needed.
   if (!XRE_IsParentProcess()) {
     TelemetryIPCAccumulator::RecordChildKeyedScalarAction(
       aId, aKey, ScalarActionType::eSet, ScalarVariant(aValue));
     return;
   }
 
   KeyedScalar* scalar = nullptr;
-  nsresult rv = internal_GetKeyedScalarByEnum(aId, ProcessID::Parent, &scalar);
+  nsresult rv = internal_GetKeyedScalarByEnum(aId, GeckoProcessType_Default, &scalar);
   if (NS_FAILED(rv)) {
     return;
   }
 
   scalar->SetValue(aKey, aValue);
 }
 
 /**
@@ -1824,17 +1820,17 @@ TelemetryScalar::SetMaximum(mozilla::Tel
   // Accumulate in the child process if needed.
   if (!XRE_IsParentProcess()) {
     TelemetryIPCAccumulator::RecordChildScalarAction(aId, ScalarActionType::eSetMaximum,
                                                      ScalarVariant(aValue));
     return;
   }
 
   ScalarBase* scalar = nullptr;
-  nsresult rv = internal_GetScalarByEnum(aId, ProcessID::Parent, &scalar);
+  nsresult rv = internal_GetScalarByEnum(aId, GeckoProcessType_Default, &scalar);
   if (NS_FAILED(rv)) {
     return;
   }
 
   scalar->SetMaximum(aValue);
 }
 
 /**
@@ -1863,17 +1859,17 @@ TelemetryScalar::SetMaximum(mozilla::Tel
   // Accumulate in the child process if needed.
   if (!XRE_IsParentProcess()) {
     TelemetryIPCAccumulator::RecordChildKeyedScalarAction(
       aId, aKey, ScalarActionType::eSetMaximum, ScalarVariant(aValue));
     return;
   }
 
   KeyedScalar* scalar = nullptr;
-  nsresult rv = internal_GetKeyedScalarByEnum(aId, ProcessID::Parent, &scalar);
+  nsresult rv = internal_GetKeyedScalarByEnum(aId, GeckoProcessType_Default, &scalar);
   if (NS_FAILED(rv)) {
     return;
   }
 
   scalar->SetMaximum(aKey, aValue);
 }
 
 /**
@@ -1943,17 +1939,18 @@ TelemetryScalar::CreateSnapshots(unsigne
       // The map already takes care of freeing the allocated memory.
       gScalarStorageMap.Clear();
     }
   }
 
   // Reflect it to JS.
   for (auto iter = scalarsToReflect.Iter(); !iter.Done(); iter.Next()) {
     ScalarArray& processScalars = iter.Data();
-    const char* processName = GetNameForProcessID(ProcessID(iter.Key()));
+    const char* processName =
+      XRE_ChildProcessTypeToString(static_cast<GeckoProcessType>(iter.Key()));
 
     // Create the object that will hold the scalars for this process and add it
     // to the returned root object.
     JS::RootedObject processObj(aCx, JS_NewPlainObject(aCx));
     if (!processObj ||
         !JS_DefineProperty(aCx, root_obj, processName, processObj, JSPROP_ENUMERATE)) {
       return NS_ERROR_FAILURE;
     }
@@ -2046,17 +2043,18 @@ TelemetryScalar::CreateKeyedSnapshots(un
       // The map already takes care of freeing the allocated memory.
       gKeyedScalarStorageMap.Clear();
     }
   }
 
   // Reflect it to JS.
   for (auto iter = scalarsToReflect.Iter(); !iter.Done(); iter.Next()) {
     ScalarArray& processScalars = iter.Data();
-    const char* processName = GetNameForProcessID(ProcessID(iter.Key()));
+    const char* processName =
+      XRE_ChildProcessTypeToString(static_cast<GeckoProcessType>(iter.Key()));
 
     // Create the object that will hold the scalars for this process and add it
     // to the returned root object.
     JS::RootedObject processObj(aCx, JS_NewPlainObject(aCx));
     if (!processObj ||
         !JS_DefineProperty(aCx, root_obj, processName, processObj, JSPROP_ENUMERATE)) {
       return NS_ERROR_FAILURE;
     }
@@ -2143,17 +2141,17 @@ TelemetryScalar::GetScalarSizesOfIncludi
       KeyedScalar* scalar = static_cast<KeyedScalar*>(childIter.Data());
       n += scalar->SizeOfIncludingThis(aMallocSizeOf);
     }
   }
   return n;
 }
 
 void
-TelemetryScalar::UpdateChildData(ProcessID aProcessType,
+TelemetryScalar::UpdateChildData(GeckoProcessType aProcessType,
                                  const nsTArray<mozilla::Telemetry::ScalarAction>& aScalarActions)
 {
   MOZ_ASSERT(XRE_IsParentProcess(),
              "The stored child processes scalar data must be updated from the parent process.");
   StaticMutexAutoLock locker(gTelemetryScalarsMutex);
   if (!internal_CanRecordBase()) {
     return;
   }
@@ -2234,17 +2232,17 @@ TelemetryScalar::UpdateChildData(Process
         }
       default:
         NS_WARNING("Unsupported action coming from scalar child updates.");
     }
   }
 }
 
 void
-TelemetryScalar::UpdateChildKeyedData(ProcessID aProcessType,
+TelemetryScalar::UpdateChildKeyedData(GeckoProcessType aProcessType,
                                       const nsTArray<mozilla::Telemetry::KeyedScalarAction>& aScalarActions)
 {
   MOZ_ASSERT(XRE_IsParentProcess(),
              "The stored child processes keyed scalar data must be updated from the parent process.");
   StaticMutexAutoLock locker(gTelemetryScalarsMutex);
   if (!internal_CanRecordBase()) {
     return;
   }
--- a/toolkit/components/telemetry/TelemetryScalar.h
+++ b/toolkit/components/telemetry/TelemetryScalar.h
@@ -2,17 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef TelemetryScalar_h__
 #define TelemetryScalar_h__
 
 #include "mozilla/TelemetryScalarEnums.h"
-#include "mozilla/TelemetryProcessEnums.h"
+#include "nsXULAppAPI.h" // for GeckoProcessType
 #include "ipc/TelemetryComms.h"
 
 // This module is internal to Telemetry. It encapsulates Telemetry's
 // scalar accumulation and storage logic. It should only be used by
 // Telemetry.cpp. These functions should not be used anywhere else.
 // For the public interface to Telemetry functionality, see Telemetry.h.
 
 namespace TelemetryScalar {
@@ -56,17 +56,17 @@ void Set(mozilla::Telemetry::ScalarID aI
 void SetMaximum(mozilla::Telemetry::ScalarID aId, const nsAString& aKey, uint32_t aValue);
 
 // Only to be used for testing.
 void ClearScalars();
 
 size_t GetMapShallowSizesOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf);
 size_t GetScalarSizesOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
 
-void UpdateChildData(mozilla::Telemetry::ProcessID aProcessType,
+void UpdateChildData(GeckoProcessType aProcessType,
                      const nsTArray<mozilla::Telemetry::ScalarAction>& aScalarActions);
 
-void UpdateChildKeyedData(mozilla::Telemetry::ProcessID aProcessType,
+void UpdateChildKeyedData(GeckoProcessType aProcessType,
                           const nsTArray<mozilla::Telemetry::KeyedScalarAction>& aScalarActions);
 
 } // namespace TelemetryScalar
 
 #endif // TelemetryScalar_h__
--- a/toolkit/components/telemetry/tests/gtest/TestScalars.cpp
+++ b/toolkit/components/telemetry/tests/gtest/TestScalars.cpp
@@ -122,17 +122,17 @@ GetScalarsSnapshot(bool aKeyed, JSContex
   ASSERT_EQ(rv, NS_OK) << "Creating a snapshot of the data must not fail.";
   ASSERT_TRUE(scalarsSnapshot.isObject()) << "The snapshot must be an object.";
 
   // We currently only support scalars from the parent process in the gtests.
   JS::RootedValue parentScalars(aCx);
   JS::RootedObject scalarObj(aCx, &scalarsSnapshot.toObject());
   // Don't complain if no scalars for the parent process can be found. Just
   // return an empty object.
-  Unused << JS_GetProperty(aCx, scalarObj, "parent", &parentScalars);
+  Unused << JS_GetProperty(aCx, scalarObj, "default", &parentScalars);
 
   aResult.set(parentScalars);
 }
 
 } // Anonymous namespace.
 
 // Test that we can properly write unsigned scalars using the C++ API.
 TEST_F(TelemetryTestFixture, ScalarUnsigned) {
--- a/toolkit/components/telemetry/tests/unit/test_ChildEvents.js
+++ b/toolkit/components/telemetry/tests/unit/test_ChildEvents.js
@@ -46,17 +46,17 @@ function run_child_test() {
 /**
  * This function waits until content events are reported into the
  * events snapshot.
  */
 async function waitForContentEvents() {
   await ContentTaskUtils.waitForCondition(() => {
     const snapshot =
       Telemetry.snapshotBuiltinEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
-    return Object.keys(snapshot).includes("content");
+    return Object.keys(snapshot).includes("tab");
   });
 }
 
 add_task(async function() {
   if (!runningInParent) {
     TelemetryController.testSetupContent();
     run_child_test();
     do_send_remote_message(MESSAGE_CHILD_TEST_DONE);
--- a/toolkit/components/telemetry/tests/unit/test_ChildScalars.js
+++ b/toolkit/components/telemetry/tests/unit/test_ChildScalars.js
@@ -120,17 +120,17 @@ function checkContentScalars(processData
 /**
  * This function waits until content scalars are reported into the
  * scalar snapshot.
  */
 async function waitForContentScalars() {
   await ContentTaskUtils.waitForCondition(() => {
     const scalars =
       Telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
-    return Object.keys(scalars).includes("content");
+    return Object.keys(scalars).includes("tab");
   });
 }
 
 add_task(async function() {
   if (!runningInParent) {
     TelemetryController.testSetupContent();
     run_child_test();
     do_send_remote_message(MESSAGE_CHILD_TEST_DONE);
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryEvents.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryEvents.js
@@ -46,36 +46,36 @@ add_task(function* test_recording_state(
   events.forEach(e => Telemetry.recordEvent(...e));
   let snapshot = Telemetry.snapshotBuiltinEvents(OPTIN, true);
   Assert.equal(Object.keys(snapshot).length, 0, "Should not have recorded any events.");
 
   // Enable one test category and see that we record correctly.
   Telemetry.setEventRecordingEnabled("telemetry.test", true);
   events.forEach(e => Telemetry.recordEvent(...e));
   snapshot = Telemetry.snapshotBuiltinEvents(OPTIN, true);
-  Assert.ok(("parent" in snapshot), "Should have entry for main process.");
-  Assert.equal(snapshot.parent.length, 1, "Should have recorded one event.");
-  Assert.equal(snapshot.parent[0][1], "telemetry.test", "Should have recorded one event in telemetry.test");
+  Assert.ok(("default" in snapshot), "Should have entry for main process.");
+  Assert.equal(snapshot.default.length, 1, "Should have recorded one event.");
+  Assert.equal(snapshot.default[0][1], "telemetry.test", "Should have recorded one event in telemetry.test");
 
   // Also enable the other test category and see that we record correctly.
   Telemetry.setEventRecordingEnabled("telemetry.test.second", true);
   events.forEach(e => Telemetry.recordEvent(...e));
   snapshot = Telemetry.snapshotBuiltinEvents(OPTIN, true);
-  Assert.ok(("parent" in snapshot), "Should have entry for main process.");
-  Assert.equal(snapshot.parent.length, 2, "Should have recorded two events.");
-  Assert.equal(snapshot.parent[0][1], "telemetry.test", "Should have recorded one event in telemetry.test");
-  Assert.equal(snapshot.parent[1][1], "telemetry.test.second", "Should have recorded one event in telemetry.test.second");
+  Assert.ok(("default" in snapshot), "Should have entry for main process.");
+  Assert.equal(snapshot.default.length, 2, "Should have recorded two events.");
+  Assert.equal(snapshot.default[0][1], "telemetry.test", "Should have recorded one event in telemetry.test");
+  Assert.equal(snapshot.default[1][1], "telemetry.test.second", "Should have recorded one event in telemetry.test.second");
 
   // Now turn of one category again and check that this works as expected.
   Telemetry.setEventRecordingEnabled("telemetry.test", false);
   events.forEach(e => Telemetry.recordEvent(...e));
   snapshot = Telemetry.snapshotBuiltinEvents(OPTIN, true);
-  Assert.ok(("parent" in snapshot), "Should have entry for main process.");
-  Assert.equal(snapshot.parent.length, 1, "Should have recorded one event.");
-  Assert.equal(snapshot.parent[0][1], "telemetry.test.second", "Should have recorded one event in telemetry.test.second");
+  Assert.ok(("default" in snapshot), "Should have entry for main process.");
+  Assert.equal(snapshot.default.length, 1, "Should have recorded one event.");
+  Assert.equal(snapshot.default[0][1], "telemetry.test.second", "Should have recorded one event in telemetry.test.second");
 });
 
 add_task(function* recording_setup() {
   // Make sure both test categories are enabled for the remaining tests.
   // Otherwise their event recording won't work.
   Telemetry.setEventRecordingEnabled("telemetry.test", true);
   Telemetry.setEventRecordingEnabled("telemetry.test.second", true);
 });
@@ -141,40 +141,40 @@ add_task(function* test_recording() {
       let recordedData = events[i].slice(1);
       let expectedData = expectedEvents[i].event.slice();
       Assert.deepEqual(recordedData, expectedData, "The recorded event data should match.");
     }
   };
 
   // Check that the expected events were recorded.
   let snapshot = Telemetry.snapshotBuiltinEvents(OPTIN, false);
-  Assert.ok(("parent" in snapshot), "Should have entry for main process.");
-  checkEvents(snapshot.parent, expected);
+  Assert.ok(("default" in snapshot), "Should have entry for main process.");
+  checkEvents(snapshot.default, expected);
 
   // Check serializing only opt-out events.
   snapshot = Telemetry.snapshotBuiltinEvents(OPTOUT, false);
-  Assert.ok(("parent" in snapshot), "Should have entry for main process.");
+  Assert.ok(("default" in snapshot), "Should have entry for main process.");
   let filtered = expected.filter(e => e.optout == true);
-  checkEvents(snapshot.parent, filtered);
+  checkEvents(snapshot.default, filtered);
 });
 
 add_task(function* test_clear() {
   Telemetry.clearEvents();
 
   const COUNT = 10;
   for (let i = 0; i < COUNT; ++i) {
     Telemetry.recordEvent("telemetry.test", "test1", "object1");
     Telemetry.recordEvent("telemetry.test.second", "test", "object1");
   }
 
   // Check that events were recorded.
   // The events are cleared by passing the respective flag.
   let snapshot = Telemetry.snapshotBuiltinEvents(OPTIN, true);
-  Assert.ok(("parent" in snapshot), "Should have entry for main process.");
-  Assert.equal(snapshot.parent.length, 2 * COUNT, `Should have recorded ${2 * COUNT} events.`);
+  Assert.ok(("default" in snapshot), "Should have entry for main process.");
+  Assert.equal(snapshot.default.length, 2 * COUNT, `Should have recorded ${2 * COUNT} events.`);
 
   // Now the events should be cleared.
   snapshot = Telemetry.snapshotBuiltinEvents(OPTIN, false);
   Assert.equal(Object.keys(snapshot).length, 0, `Should have cleared the events.`);
 });
 
 add_task(function* test_expiry() {
   Telemetry.clearEvents();
@@ -187,18 +187,18 @@ add_task(function* test_expiry() {
   // Recording call with event that is expired by date.
   Telemetry.recordEvent("telemetry.test", "expired_date", "object1");
   snapshot = Telemetry.snapshotBuiltinEvents(OPTIN, true);
   Assert.equal(Object.keys(snapshot).length, 0, "Should not record event with expired date.");
 
   // Recording call with event that has expiry_version and expiry_date in the future.
   Telemetry.recordEvent("telemetry.test", "not_expired_optout", "object1");
   snapshot = Telemetry.snapshotBuiltinEvents(OPTOUT, true);
-  Assert.ok(("parent" in snapshot), "Should have entry for main process.");
-  Assert.equal(snapshot.parent.length, 1, "Should record event when date and version are not expired.");
+  Assert.ok(("default" in snapshot), "Should have entry for main process.");
+  Assert.equal(snapshot.default.length, 1, "Should record event when date and version are not expired.");
 });
 
 add_task(function* test_invalidParams() {
   Telemetry.clearEvents();
 
   // Recording call with wrong type for value argument.
   Telemetry.recordEvent("telemetry.test", "test1", "object1", 1);
   let snapshot = Telemetry.snapshotBuiltinEvents(OPTIN, true);
@@ -227,18 +227,18 @@ add_task(function* test_storageLimit() {
   let LIMIT = 1000;
   let COUNT = LIMIT + 10;
   for (let i = 0; i < COUNT; ++i) {
     Telemetry.recordEvent("telemetry.test", "test1", "object1", String(i));
   }
 
   // Check that the right events were recorded.
   let snapshot = Telemetry.snapshotBuiltinEvents(OPTIN, true);
-  Assert.ok(("parent" in snapshot), "Should have entry for main process.");
-  let events = snapshot.parent;
+  Assert.ok(("default" in snapshot), "Should have entry for main process.");
+  let events = snapshot.default;
   Assert.equal(events.length, LIMIT, `Should have only recorded ${LIMIT} events`);
   Assert.ok(events.every((e, idx) => e[4] === String(idx)),
             "Should have recorded all events from before hitting the limit.");
 });
 
 add_task(function* test_valueLimits() {
   Telemetry.clearEvents();
 
@@ -270,18 +270,18 @@ add_task(function* test_valueLimits() {
   for (let e of expected) {
     while ((e.length >= 3) && (e[e.length - 1] === null)) {
       e.pop();
     }
   }
 
   // Check that the right events were recorded.
   let snapshot = Telemetry.snapshotBuiltinEvents(OPTIN, true);
-  Assert.ok(("parent" in snapshot), "Should have entry for main process.");
-  let events = snapshot.parent;
+  Assert.ok(("default" in snapshot), "Should have entry for main process.");
+  let events = snapshot.default;
   Assert.equal(events.length, expected.length,
                "Should have recorded the expected number of events");
   for (let i = 0; i < expected.length; ++i) {
     Assert.deepEqual(events[i].slice(1), expected[i],
                      "Should have recorded the expected event data.");
   }
 });
 
@@ -290,14 +290,14 @@ add_task(function* test_unicodeValues() 
 
   // Record string values containing unicode characters.
   let value = "漢語";
   Telemetry.recordEvent("telemetry.test", "test1", "object1", value);
   Telemetry.recordEvent("telemetry.test", "test1", "object1", null, {"key1": value});
 
   // Check that the values were correctly recorded.
   let snapshot = Telemetry.snapshotBuiltinEvents(OPTIN, true);
-  Assert.ok(("parent" in snapshot), "Should have entry for main process.");
-  let events = snapshot.parent;
+  Assert.ok(("default" in snapshot), "Should have entry for main process.");
+  let events = snapshot.default;
   Assert.equal(events.length, 2, "Should have recorded 2 events.");
   Assert.equal(events[0][4], value, "Should have recorded the right value.");
   Assert.equal(events[1][5]["key1"], value, "Should have recorded the right extra value.");
 });
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryScalars.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryScalars.js
@@ -4,18 +4,18 @@
 
 const UINT_SCALAR = "telemetry.test.unsigned_int_kind";
 const STRING_SCALAR = "telemetry.test.string_kind";
 const BOOLEAN_SCALAR = "telemetry.test.boolean_kind";
 const KEYED_UINT_SCALAR = "telemetry.test.keyed_unsigned_int";
 
 function getParentProcessScalars(aChannel, aKeyed = false, aClear = false) {
   const scalars = aKeyed ?
-    Telemetry.snapshotKeyedScalars(aChannel, aClear)["parent"] :
-    Telemetry.snapshotScalars(aChannel, aClear)["parent"];
+    Telemetry.snapshotKeyedScalars(aChannel, aClear)["default"] :
+    Telemetry.snapshotScalars(aChannel, aClear)["default"];
   return scalars || {};
 }
 
 add_task(function* test_serializationFormat() {
   Telemetry.clearScalars();
 
   // Set the scalars to a known value.
   const expectedUint = 3785;