diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /toolkit/crashreporter/nsExceptionHandler.h | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/crashreporter/nsExceptionHandler.h')
-rw-r--r-- | toolkit/crashreporter/nsExceptionHandler.h | 47 |
1 files changed, 30 insertions, 17 deletions
diff --git a/toolkit/crashreporter/nsExceptionHandler.h b/toolkit/crashreporter/nsExceptionHandler.h index f81cc07c8c..2564737137 100644 --- a/toolkit/crashreporter/nsExceptionHandler.h +++ b/toolkit/crashreporter/nsExceptionHandler.h @@ -18,12 +18,12 @@ #include "CrashAnnotations.h" -#include <stddef.h> -#include <stdint.h> #include "nsError.h" #include "nsString.h" #include "nsXULAppAPI.h" #include "prio.h" +#include <stddef.h> +#include <stdint.h> #if defined(XP_WIN) # ifdef WIN32_LEAN_AND_MEAN @@ -95,30 +95,42 @@ nsresult SetMinidumpPath(const nsAString& aPath); // child processes. Annotations added in the main process will be included in // child process crashes too unless the child process sets its own annotations. // If it does the child-provided annotation overrides the one set in the parent. -nsresult AnnotateCrashReport(Annotation key, bool data); -nsresult AnnotateCrashReport(Annotation key, int data); -nsresult AnnotateCrashReport(Annotation key, unsigned int data); -nsresult AnnotateCrashReport(Annotation key, const nsACString& data); -nsresult AppendToCrashReportAnnotation(Annotation key, const nsACString& data); -nsresult RemoveCrashReportAnnotation(Annotation key); +const bool* RegisterAnnotationBool(Annotation aKey, const bool* aData); +const uint32_t* RegisterAnnotationU32(Annotation aKey, const uint32_t* aData); +const uint64_t* RegisterAnnotationU64(Annotation aKey, const uint64_t* aData); +const size_t* RegisterAnnotationUSize(Annotation aKey, const size_t* aData); +const char* RegisterAnnotationCString(Annotation aKey, const char* aData); +const nsCString* RegisterAnnotationNSCString(Annotation aKey, + const nsCString* aData); + +nsresult RecordAnnotationBool(Annotation aKey, bool aData); +nsresult RecordAnnotationU32(Annotation aKey, uint32_t aData); +nsresult RecordAnnotationU64(Annotation aKey, uint64_t aData); +nsresult RecordAnnotationUSize(Annotation aKey, size_t aData); +nsresult RecordAnnotationCString(Annotation aKey, const char* aData); +nsresult RecordAnnotationNSCString(Annotation aKey, const nsACString& aData); +nsresult RecordAnnotationNSString(Annotation aKey, const nsAString& aData); +nsresult UnrecordAnnotation(Annotation aKey); + nsresult AppendAppNotesToCrashReport(const nsACString& data); // RAII class for setting a crash annotation during a limited scope of time. // Will reset the named annotation to its previous value when destroyed. // -// This type's behavior is identical to that of AnnotateCrashReport(). -class MOZ_RAII AutoAnnotateCrashReport final { +// This type's behavior is identical to that of RecordAnnotation(). +class MOZ_RAII AutoRecordAnnotation final { public: - AutoAnnotateCrashReport(Annotation key, bool data); - AutoAnnotateCrashReport(Annotation key, int data); - AutoAnnotateCrashReport(Annotation key, unsigned int data); - AutoAnnotateCrashReport(Annotation key, const nsACString& data); - ~AutoAnnotateCrashReport(); + AutoRecordAnnotation(Annotation key, bool data); + AutoRecordAnnotation(Annotation key, int data); + AutoRecordAnnotation(Annotation key, unsigned int data); + AutoRecordAnnotation(Annotation key, const nsACString& data); + ~AutoRecordAnnotation(); #ifdef MOZ_CRASHREPORTER private: Annotation mKey; - nsCString mPrevious; + const nsCString mCurrent; + const nsCString* mPrevious; #endif }; @@ -143,7 +155,8 @@ void GetAnnotation(uint32_t childPid, Annotation annotation, nsACString& outStr); // Functions for working with minidumps and .extras -typedef mozilla::EnumeratedArray<Annotation, Annotation::Count, nsCString> +typedef mozilla::EnumeratedArray<Annotation, nsCString, + size_t(Annotation::Count)> AnnotationTable; void DeleteMinidumpFilesForID( const nsAString& aId, |