diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index b13a8b6fdf84..710776d58cb6 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -5383,19 +5383,3 @@ ContentParent::RecvDeviceReset() return IPC_OK(); } - -mozilla::ipc::IPCResult -ContentParent::RecvBHRThreadHang(const HangDetails& aDetails) -{ - nsCOMPtr obs = mozilla::services::GetObserverService(); - if (obs) { - // Copy the HangDetails recieved over the network into a nsIHangDetails, and - // then fire our own observer notification. - // XXX: We should be able to avoid this potentially expensive copy here by - // moving our deserialized argument. - nsCOMPtr hangDetails = - new nsHangDetails(HangDetails(aDetails)); - obs->NotifyObservers(hangDetails, "bhr-thread-hang", nullptr); - } - return IPC_OK(); -} diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index a783456de8ce..254798a98dab 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -1149,9 +1149,6 @@ private: nsTArray&& events) override; virtual mozilla::ipc::IPCResult RecvRecordDiscardedData( const DiscardedData& aDiscardedData) override; - - virtual mozilla::ipc::IPCResult RecvBHRThreadHang( - const HangDetails& aHangDetails) override; public: void SendGetFilesResponseAndForget(const nsID& aID, const GetFilesResponseResult& aResult); diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index e5269f62e9c2..469d1b58a9ee 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -96,7 +96,6 @@ using mozilla::Telemetry::KeyedScalarAction from "mozilla/TelemetryComms.h"; using mozilla::Telemetry::ChildEventData from "mozilla/TelemetryComms.h"; using mozilla::Telemetry::DiscardedData from "mozilla/TelemetryComms.h"; using mozilla::CrossProcessMutexHandle from "mozilla/ipc/CrossProcessMutex.h"; -using mozilla::HangDetails from "mozilla/HangDetails.h"; union ChromeRegistryItem { @@ -1056,8 +1055,6 @@ parent: async FinishMemoryReport(uint32_t aGeneration); async MaybeReloadPlugins(); - - async BHRThreadHang(HangDetails aHangDetails); both: async AsyncMessage(nsString aMessage, CpowEntry[] aCpows, Principal aPrincipal, ClonedMessageData aData); diff --git a/gfx/ipc/GPUChild.cpp b/gfx/ipc/GPUChild.cpp index 72cb3b747698..953f1b6be479 100644 --- a/gfx/ipc/GPUChild.cpp +++ b/gfx/ipc/GPUChild.cpp @@ -20,7 +20,6 @@ #include "mozilla/ipc/CrashReporterHost.h" #include "mozilla/layers/LayerTreeOwnerTracker.h" #include "mozilla/Unused.h" -#include "nsIObserverService.h" #ifdef MOZ_GECKO_PROFILER #include "ProfilerParent.h" @@ -288,22 +287,6 @@ GPUChild::RecvUsedFallback(const Fallback& aFallback, const nsCString& aMessage) return IPC_OK(); } -mozilla::ipc::IPCResult -GPUChild::RecvBHRThreadHang(const HangDetails& aDetails) -{ - nsCOMPtr obs = mozilla::services::GetObserverService(); - if (obs) { - // Copy the HangDetails recieved over the network into a nsIHangDetails, and - // then fire our own observer notification. - // XXX: We should be able to avoid this potentially expensive copy here by - // moving our deserialized argument. - nsCOMPtr hangDetails = - new nsHangDetails(HangDetails(aDetails)); - obs->NotifyObservers(hangDetails, "bhr-thread-hang", nullptr); - } - return IPC_OK(); -} - class DeferredDeleteGPUChild : public Runnable { public: diff --git a/gfx/ipc/GPUChild.h b/gfx/ipc/GPUChild.h index 0f45bc45713f..9e4f6063272f 100644 --- a/gfx/ipc/GPUChild.h +++ b/gfx/ipc/GPUChild.h @@ -60,7 +60,6 @@ public: mozilla::ipc::IPCResult RecvFinishMemoryReport(const uint32_t& aGeneration) override; mozilla::ipc::IPCResult RecvUpdateFeature(const Feature& aFeature, const FeatureFailure& aChange) override; mozilla::ipc::IPCResult RecvUsedFallback(const Fallback& aFallback, const nsCString& aMessage) override; - mozilla::ipc::IPCResult RecvBHRThreadHang(const HangDetails& aDetails) override; bool SendRequestMemoryReport(const uint32_t& aGeneration, const bool& aAnonymize, diff --git a/gfx/ipc/PGPU.ipdl b/gfx/ipc/PGPU.ipdl index bb667cce46ad..120c494f349a 100644 --- a/gfx/ipc/PGPU.ipdl +++ b/gfx/ipc/PGPU.ipdl @@ -23,7 +23,6 @@ using mozilla::Telemetry::ChildEventData from "mozilla/TelemetryComms.h"; using mozilla::Telemetry::DiscardedData from "mozilla/TelemetryComms.h"; using mozilla::gfx::Feature from "gfxFeature.h"; using mozilla::gfx::Fallback from "gfxFallback.h"; -using mozilla::HangDetails from "mozilla/HangDetails.h"; namespace mozilla { namespace gfx { @@ -125,8 +124,6 @@ child: // Notify about:support/Telemetry that a fallback occurred. async UsedFallback(Fallback aFallback, nsCString message); - - async BHRThreadHang(HangDetails aDetails); }; } // namespace gfx diff --git a/toolkit/components/backgroundhangmonitor/HangDetails.cpp b/toolkit/components/backgroundhangmonitor/HangDetails.cpp index 0fc596256bc7..e87ac80a3982 100644 --- a/toolkit/components/backgroundhangmonitor/HangDetails.cpp +++ b/toolkit/components/backgroundhangmonitor/HangDetails.cpp @@ -200,32 +200,6 @@ nsHangDetails::Submit() if (os) { os->NotifyObservers(hangDetails, "bhr-thread-hang", nullptr); } - - // If we're not in the parent process, we might need to transmit our hang - // details to another process, so that they can be reported there. - switch (XRE_GetProcessType()) { - case GeckoProcessType_Content: { - auto cc = dom::ContentChild::GetSingleton(); - if (cc) { - Unused << cc->SendBHRThreadHang(hangDetails->mDetails); - } - break; - } - case GeckoProcessType_GPU: { - auto gp = gfx::GPUParent::GetSingleton(); - if (gp) { - Unused << gp->SendBHRThreadHang(hangDetails->mDetails); - } - break; - } - case GeckoProcessType_Default: - break; - default: - // XXX: Consider handling GeckoProcessType_GMPlugin and - // GeckoProcessType_Plugin? - NS_WARNING("Unsupported BHR process type - discarding hang."); - break; - } }); nsresult rv = SystemGroup::Dispatch(TaskCategory::Other, @@ -266,19 +240,21 @@ ParamTraits::Write(Message* aMsg, const mozilla::HangDetai WriteParam(aMsg, aParam.mPseudoStack); // Write out the annotation information - { - // If we have no annotations, write out a 0-length annotations. - if (!aParam.mAnnotations) { - WriteParam(aMsg, 0); - } + // If we have no annotations, write out a 0-length annotations. + // XXX: Everything about HangAnnotations is awful. + if (!aParam.mAnnotations) { + WriteParam(aMsg, (size_t) 0); + } else { size_t length = aParam.mAnnotations->Count(); WriteParam(aMsg, length); auto enumerator = aParam.mAnnotations->GetEnumerator(); - nsAutoString key; - nsAutoString value; - while (enumerator->Next(key, value)) { - WriteParam(aMsg, key); - WriteParam(aMsg, value); + if (enumerator) { + nsAutoString key; + nsAutoString value; + while (enumerator->Next(key, value)) { + WriteParam(aMsg, key); + WriteParam(aMsg, value); + } } }