mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1038961: Patch 1 - Send GMP plugin crashes to observer, and implement PluginID system r=cpearce,jib
This commit is contained in:
parent
b0645f3f41
commit
4ac7943b4f
@ -14,6 +14,8 @@
|
||||
#include "nsIRunnable.h"
|
||||
#include "mozIGeckoMediaPluginService.h"
|
||||
#include "mozilla/unused.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "mtransport/runnable_utils.h"
|
||||
|
||||
#include "mozilla/dom/CrashReporterParent.h"
|
||||
using mozilla::dom::CrashReporterParent;
|
||||
@ -321,16 +323,37 @@ GMPParent::GetCrashID(nsString& aResult)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
GMPNotifyObservers(nsAString& aData)
|
||||
{
|
||||
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
||||
if (obs) {
|
||||
nsString temp(aData);
|
||||
obs->NotifyObservers(nullptr, "gmp-plugin-crash", temp.get());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
GMPParent::ActorDestroy(ActorDestroyReason aWhy)
|
||||
{
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
if (AbnormalShutdown == aWhy) {
|
||||
nsString dumpID;
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
GetCrashID(dumpID);
|
||||
#endif
|
||||
// now do something with the crash ID, bug 1038961
|
||||
nsString id;
|
||||
// use the parent address to identify it
|
||||
// We could use any unique-to-the-parent value
|
||||
id.AppendInt(reinterpret_cast<uint64_t>(this));
|
||||
id.Append(NS_LITERAL_STRING(" "));
|
||||
AppendUTF8toUTF16(mDisplayName, id);
|
||||
id.Append(NS_LITERAL_STRING(" "));
|
||||
id.Append(dumpID);
|
||||
|
||||
// NotifyObservers is mainthread-only
|
||||
NS_DispatchToMainThread(WrapRunnableNM(&GMPNotifyObservers, id),
|
||||
NS_DISPATCH_NORMAL);
|
||||
}
|
||||
#endif
|
||||
// warn us off trying to close again
|
||||
mState = GMPStateClosing;
|
||||
CloseActive();
|
||||
|
@ -42,6 +42,7 @@ public:
|
||||
virtual nsresult Reset() MOZ_OVERRIDE;
|
||||
virtual nsresult Drain() MOZ_OVERRIDE;
|
||||
virtual nsresult DecodingComplete() MOZ_OVERRIDE;
|
||||
virtual const uint64_t ParentID() MOZ_OVERRIDE { return reinterpret_cast<uint64_t>(mPlugin.get()); }
|
||||
|
||||
// GMPSharedMemManager
|
||||
virtual void CheckThread();
|
||||
|
@ -28,6 +28,7 @@ public:
|
||||
virtual nsresult Reset() = 0;
|
||||
virtual nsresult Drain() = 0;
|
||||
virtual nsresult DecodingComplete() = 0;
|
||||
virtual const uint64_t ParentID() = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -43,6 +43,7 @@ public:
|
||||
virtual GMPErr SetRates(uint32_t aNewBitRate, uint32_t aFrameRate) MOZ_OVERRIDE;
|
||||
virtual GMPErr SetPeriodicKeyFrames(bool aEnable) MOZ_OVERRIDE;
|
||||
virtual void EncodingComplete() MOZ_OVERRIDE;
|
||||
virtual const uint64_t ParentID() MOZ_OVERRIDE { return reinterpret_cast<uint64_t>(mPlugin.get()); }
|
||||
|
||||
// GMPSharedMemManager
|
||||
virtual void CheckThread();
|
||||
|
@ -35,6 +35,7 @@ public:
|
||||
virtual GMPErr SetRates(uint32_t aNewBitRate, uint32_t aFrameRate) = 0;
|
||||
virtual GMPErr SetPeriodicKeyFrames(bool aEnable) = 0;
|
||||
virtual void EncodingComplete() = 0;
|
||||
virtual const uint64_t ParentID() = 0;
|
||||
};
|
||||
|
||||
#endif // GMPVideoEncoderProxy_h_
|
||||
|
@ -33,17 +33,24 @@
|
||||
#include "GMPVideoDecoderProxy.h"
|
||||
#include "GMPVideoEncoderProxy.h"
|
||||
|
||||
#include "WebrtcGmpVideoCodec.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class WebrtcGmpCrashReporter {
|
||||
public:
|
||||
virtual const uint64_t CrashID() = 0;
|
||||
};
|
||||
|
||||
class WebrtcGmpVideoEncoder : public WebrtcVideoEncoder,
|
||||
public GMPVideoEncoderCallbackProxy
|
||||
public GMPVideoEncoderCallbackProxy,
|
||||
public WebrtcGmpCrashReporter
|
||||
{
|
||||
public:
|
||||
WebrtcGmpVideoEncoder();
|
||||
virtual ~WebrtcGmpVideoEncoder() {}
|
||||
|
||||
// Implement CrashReporter
|
||||
virtual const uint64_t CrashID() { return mGMP ? mGMP->ParentID() : 0; }
|
||||
|
||||
// Implement VideoEncoder interface.
|
||||
virtual int32_t InitEncode(const webrtc::VideoCodec* aCodecSettings,
|
||||
int32_t aNumberOfCores,
|
||||
@ -90,12 +97,16 @@ private:
|
||||
|
||||
|
||||
class WebrtcGmpVideoDecoder : public WebrtcVideoDecoder,
|
||||
public GMPVideoDecoderCallback
|
||||
public GMPVideoDecoderCallback,
|
||||
public WebrtcGmpCrashReporter
|
||||
{
|
||||
public:
|
||||
WebrtcGmpVideoDecoder();
|
||||
virtual ~WebrtcGmpVideoDecoder() {}
|
||||
|
||||
// Implement CrashReporter
|
||||
virtual const uint64_t CrashID() { return mGMP ? mGMP->ParentID() : 0; }
|
||||
|
||||
// Implement VideoDecoder interface.
|
||||
virtual int32_t InitDecode(const webrtc::VideoCodec* aCodecSettings,
|
||||
int32_t aNumberOfCores);
|
||||
|
Loading…
Reference in New Issue
Block a user