Bug 1348273 - Convert the media-related annotations; r?cpearce
MozReview-Commit-ID: 4QRgwAHN0w5
--- a/dom/media/gmp/GMPChild.cpp
+++ b/dom/media/gmp/GMPChild.cpp
@@ -549,18 +549,19 @@ ToCString(const nsTArray<Pair<nsCString,
mozilla::ipc::IPCResult
GMPChild::AnswerStartPlugin(const nsString& aAdapter)
{
LOGD("%s", __FUNCTION__);
nsCString libPath;
if (!GetUTF8LibPath(libPath)) {
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("GMPLibraryPath"),
- NS_ConvertUTF16toUTF8(mPluginPath));
+ CrashReporter::AnnotateCrashReport(
+ CrashReporter::Annotation::GMPLibraryPath,
+ NS_ConvertUTF16toUTF8(mPluginPath));
#ifdef XP_WIN
return IPC_FAIL(
this,
nsPrintfCString("Failed to get lib path with error(%d).", GetLastError())
.get());
#else
return IPC_FAIL(
@@ -604,18 +605,19 @@ GMPChild::AnswerStartPlugin(const nsStri
}
if (!mGMPLoader->Load(libPath.get(),
libPath.Length(),
platformAPI,
adapter)) {
NS_WARNING("Failed to load GMP");
delete platformAPI;
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("GMPLibraryPath"),
- NS_ConvertUTF16toUTF8(mPluginPath));
+ CrashReporter::AnnotateCrashReport(
+ CrashReporter::Annotation::GMPLibraryPath,
+ NS_ConvertUTF16toUTF8(mPluginPath));
#ifdef XP_WIN
return IPC_FAIL(
this,
nsPrintfCString("Failed to load GMP with error(%d).", GetLastError())
.get());
#else
return IPC_FAIL(
--- a/dom/media/gmp/GMPParent.cpp
+++ b/dom/media/gmp/GMPParent.cpp
@@ -459,20 +459,23 @@ GMPParent::EnsureProcessLoaded()
nsresult rv = LoadProcess();
return NS_SUCCEEDED(rv);
}
void
GMPParent::WriteExtraDataForMinidump()
{
- mCrashReporter->AddNote(NS_LITERAL_CSTRING("GMPPlugin"), NS_LITERAL_CSTRING("1"));
- mCrashReporter->AddNote(NS_LITERAL_CSTRING("PluginFilename"), NS_ConvertUTF16toUTF8(mName));
- mCrashReporter->AddNote(NS_LITERAL_CSTRING("PluginName"), mDisplayName);
- mCrashReporter->AddNote(NS_LITERAL_CSTRING("PluginVersion"), mVersion);
+ mCrashReporter->AddAnnotation(CrashReporter::Annotation::GMPPlugin, true);
+ mCrashReporter->AddAnnotation(CrashReporter::Annotation::PluginFilename,
+ NS_ConvertUTF16toUTF8(mName));
+ mCrashReporter->AddAnnotation(CrashReporter::Annotation::PluginName,
+ mDisplayName);
+ mCrashReporter->AddAnnotation(CrashReporter::Annotation::PluginVersion,
+ mVersion);
}
bool
GMPParent::GetCrashID(nsString& aResult)
{
if (!mCrashReporter) {
return false;
}
--- a/toolkit/crashreporter/CrashAnnotations.yaml
+++ b/toolkit/crashreporter/CrashAnnotations.yaml
@@ -227,16 +227,26 @@ FlashProcessDump:
type: string
GetHGlobalFromStreamFailure:
description: >
Error returned when invoking GetHGlobalFromStreamFailure() during the
creation of an IPC stream proxy.
type: string
+GMPLibraryPath:
+ description: >
+ Holds the path to the GMP plugin library.
+ type: string
+
+GMPPlugin:
+ description: >
+ Set to 1 if the GMP plugin is enabled.
+ type: boolean
+
GPUProcessLaunchCount:
description: >
Number of times the GPU process was launched.
type: integer
GPUProcessStatus:
description: >
Status of the GPU process, can be set to "Running" or "Destroyed"