Bug 1240651 - Annotate addonId into crash report (r=bholley)

This commit is contained in:
Yoshi Huang 2016-01-29 15:19:56 -08:00 committed by Bill McCloskey
parent 9b81d55962
commit c024457878
3 changed files with 17 additions and 2 deletions

View File

@ -7,6 +7,9 @@
#include "mozilla/BasePrincipal.h"
#include "nsDocShell.h"
#ifdef MOZ_CRASHREPORTER
#include "nsExceptionHandler.h"
#endif
#include "nsIAddonPolicyService.h"
#include "nsIContentSecurityPolicy.h"
#include "nsIObjectInputStream.h"
@ -121,7 +124,13 @@ OriginAttributes::CreateSuffix(nsACString& aStr) const
}
if (!mAddonId.IsEmpty()) {
MOZ_RELEASE_ASSERT(mAddonId.FindCharInSet(dom::quota::QuotaManager::kReplaceChars) == kNotFound);
if (mAddonId.FindCharInSet(dom::quota::QuotaManager::kReplaceChars) != kNotFound) {
#ifdef MOZ_CRASHREPORTER
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Crash_AddonId"),
NS_ConvertUTF16toUTF8(mAddonId));
#endif
MOZ_CRASH();
}
params->Set(NS_LITERAL_STRING("addonId"), mAddonId);
}

View File

@ -32,8 +32,13 @@ EXPORTS.mozilla = [
'BasePrincipal.h'
]
UNIFIED_SOURCES += [
SOURCES += [
# Compile this separately since nsExceptionHandler.h conflicts
# with something from nsNullPrincipal.cpp.
'BasePrincipal.cpp',
]
UNIFIED_SOURCES += [
'DomainPolicy.cpp',
'nsJSPrincipals.cpp',
'nsNullPrincipal.cpp',

View File

@ -27,6 +27,7 @@
#include "nsXPIDLString.h"
#include "nsCRT.h"
#include "nsCRTGlue.h"
#include "nsDocShell.h"
#include "nsError.h"
#include "nsDOMCID.h"
#include "nsIXPConnect.h"