Backed out changeset 0b6c4c95323e (bug 1380081)

This commit is contained in:
Sebastian Hengst 2017-08-11 09:28:16 +02:00
parent 8e97249c63
commit 41113ae3fc
7 changed files with 12 additions and 79 deletions

View File

@ -5383,19 +5383,3 @@ ContentParent::RecvDeviceReset()
return IPC_OK();
}
mozilla::ipc::IPCResult
ContentParent::RecvBHRThreadHang(const HangDetails& aDetails)
{
nsCOMPtr<nsIObserverService> 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<nsIHangDetails> hangDetails =
new nsHangDetails(HangDetails(aDetails));
obs->NotifyObservers(hangDetails, "bhr-thread-hang", nullptr);
}
return IPC_OK();
}

View File

@ -1149,9 +1149,6 @@ private:
nsTArray<ChildEventData>&& 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);

View File

@ -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);

View File

@ -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<nsIObserverService> 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<nsIHangDetails> hangDetails =
new nsHangDetails(HangDetails(aDetails));
obs->NotifyObservers(hangDetails, "bhr-thread-hang", nullptr);
}
return IPC_OK();
}
class DeferredDeleteGPUChild : public Runnable
{
public:

View File

@ -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,

View File

@ -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

View File

@ -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<mozilla::HangDetails>::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);
}
}
}