Backed out changeset bcbab342eed8 (bug 1889658) for causing wpt reftest failures...
[gecko.git] / toolkit / crashreporter / nsDummyExceptionHandler.cpp
blobcd76630f3cd88c815824711d34ea061bd030368b
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "nsExceptionHandler.h"
9 namespace CrashReporter {
11 void AnnotateOOMAllocationSize(size_t size) {}
13 void AnnotateTexturesSize(size_t size) {}
15 void AnnotatePendingIPC(size_t aNumOfPendingIPC, uint32_t aTopPendingIPCCount,
16 const char* aTopPendingIPCName,
17 uint32_t aTopPendingIPCType) {}
19 nsresult SetExceptionHandler(nsIFile* aXREDirectory, bool force /*=false*/) {
20 return NS_ERROR_NOT_IMPLEMENTED;
23 bool GetEnabled() { return false; }
25 bool GetMinidumpPath(nsAString& aPath) { return false; }
27 nsresult SetMinidumpPath(const nsAString& aPath) {
28 return NS_ERROR_NOT_IMPLEMENTED;
31 nsresult SetupExtraData(nsIFile* aAppDataDirectory,
32 const nsACString& aBuildID) {
33 return NS_ERROR_NOT_IMPLEMENTED;
36 nsresult UnsetExceptionHandler() { return NS_ERROR_NOT_IMPLEMENTED; }
38 const bool* RegisterAnnotationBool(Annotation aKey, const bool* aData) {
39 return nullptr;
42 const uint32_t* RegisterAnnotationU32(Annotation aKey, const uint32_t* aData) {
43 return nullptr;
46 const uint64_t* RegisterAnnotationU64(Annotation aKey, const uint64_t* aData) {
47 return nullptr;
50 const size_t* RegisterAnnotationUSize(Annotation aKey, const size_t* aData) {
51 return nullptr;
54 const char* RegisterAnnotationCString(Annotation aKey, const char* aData) {
55 return nullptr;
58 const nsCString* RegisterAnnotationNSCString(Annotation aKey,
59 const nsCString* aData) {
60 return nullptr;
63 nsresult RecordAnnotationBool(Annotation aKey, bool aData) {
64 return NS_ERROR_FAILURE;
67 nsresult RecordAnnotationU32(Annotation aKey, uint32_t aData) {
68 return NS_ERROR_FAILURE;
71 nsresult RecordAnnotationU64(Annotation aKey, uint64_t aData) {
72 return NS_ERROR_FAILURE;
75 nsresult RecordAnnotationUSize(Annotation aKey, size_t aData) {
76 return NS_ERROR_FAILURE;
79 nsresult RecordAnnotationCString(Annotation aKey, const char* aData) {
80 return NS_ERROR_FAILURE;
83 nsresult RecordAnnotationNSCString(Annotation aKey, const nsACString& aData) {
84 return NS_ERROR_FAILURE;
87 nsresult RecordAnnotationNSString(Annotation aKey, const nsAString& aData) {
88 return NS_ERROR_FAILURE;
91 nsresult UnrecordAnnotation(Annotation aKey) { return NS_ERROR_FAILURE; }
93 AutoRecordAnnotation::AutoRecordAnnotation(Annotation key, bool data) {}
95 AutoRecordAnnotation::AutoRecordAnnotation(Annotation key, int data) {}
97 AutoRecordAnnotation::AutoRecordAnnotation(Annotation key, unsigned data) {}
99 AutoRecordAnnotation::AutoRecordAnnotation(Annotation key,
100 const nsACString& data) {}
102 AutoRecordAnnotation::~AutoRecordAnnotation() {}
104 void MergeCrashAnnotations(AnnotationTable& aDst, const AnnotationTable& aSrc) {
107 nsresult SetGarbageCollecting(bool collecting) {
108 return NS_ERROR_NOT_IMPLEMENTED;
111 void SetEventloopNestingLevel(uint32_t level) {}
113 void SetMinidumpAnalysisAllThreads() {}
115 nsresult AppendAppNotesToCrashReport(const nsACString& data) {
116 return NS_ERROR_NOT_IMPLEMENTED;
119 bool GetAnnotation(const nsACString& key, nsACString& data) { return false; }
121 void GetAnnotation(uint32_t childPid, Annotation annotation,
122 nsACString& outStr) {
123 return;
126 nsresult RegisterAppMemory(void* ptr, size_t length) {
127 return NS_ERROR_NOT_IMPLEMENTED;
130 nsresult UnregisterAppMemory(void* ptr) { return NS_ERROR_NOT_IMPLEMENTED; }
132 void SetIncludeContextHeap(bool aValue) {}
134 bool GetServerURL(nsACString& aServerURL) { return false; }
136 nsresult SetServerURL(const nsACString& aServerURL) {
137 return NS_ERROR_NOT_IMPLEMENTED;
140 nsresult SetRestartArgs(int argc, char** argv) {
141 return NS_ERROR_NOT_IMPLEMENTED;
144 #ifdef XP_WIN
145 nsresult WriteMinidumpForException(EXCEPTION_POINTERS* aExceptionInfo) {
146 return NS_ERROR_NOT_IMPLEMENTED;
148 #endif
150 #ifdef XP_LINUX
151 bool WriteMinidumpForSigInfo(int signo, siginfo_t* info, void* uc) {
152 return false;
154 #endif
156 #ifdef XP_MACOSX
157 nsresult AppendObjCExceptionInfoToAppNotes(void* inException) {
158 return NS_ERROR_NOT_IMPLEMENTED;
160 #endif
162 nsresult GetSubmitReports(bool* aSubmitReports) {
163 return NS_ERROR_NOT_IMPLEMENTED;
166 nsresult SetSubmitReports(bool aSubmitReports) {
167 return NS_ERROR_NOT_IMPLEMENTED;
170 void SetProfileDirectory(nsIFile* aDir) {}
172 void SetUserAppDataDirectory(nsIFile* aDir) {}
174 void UpdateCrashEventsDir() {}
176 bool GetCrashEventsDir(nsAString& aPath) { return false; }
178 void SetMemoryReportFile(nsIFile* aFile) {}
180 nsresult GetDefaultMemoryReportFile(nsIFile** aFile) {
181 return NS_ERROR_NOT_IMPLEMENTED;
184 void DeleteMinidumpFilesForID(const nsAString& aId,
185 const Maybe<nsString>& aAdditionalMinidump) {}
187 bool GetMinidumpForID(const nsAString& id, nsIFile** minidump,
188 const Maybe<nsString>& aAdditionalMinidump) {
189 return false;
192 bool GetIDFromMinidump(nsIFile* minidump, nsAString& id) { return false; }
194 bool GetExtraFileForID(const nsAString& id, nsIFile** extraFile) {
195 return false;
198 bool GetExtraFileForMinidump(nsIFile* minidump, nsIFile** extraFile) {
199 return false;
202 bool WriteExtraFile(const nsAString& id, const AnnotationTable& annotations) {
203 return false;
206 void OOPInit() {}
208 #if defined(XP_WIN) || defined(XP_MACOSX)
209 const char* GetChildNotificationPipe() { return nullptr; }
210 #endif
212 #ifdef MOZ_CRASHREPORTER_INJECTOR
213 void InjectCrashReporterIntoProcess(DWORD processID,
214 InjectorCrashCallback* cb) {}
216 void UnregisterInjectorCallback(DWORD processID) {}
218 #endif // MOZ_CRASHREPORTER_INJECTOR
220 bool GetLastRunCrashID(nsAString& id) { return false; }
222 #if !defined(XP_WIN) && !defined(XP_MACOSX)
224 bool CreateNotificationPipeForChild(int* childCrashFd, int* childCrashRemapFd) {
225 return false;
228 #endif // !defined(XP_WIN) && !defined(XP_MACOSX)
230 bool SetRemoteExceptionHandler(const char* aCrashPipe) { return false; }
232 bool TakeMinidumpForChild(uint32_t childPid, nsIFile** dump,
233 AnnotationTable& aAnnotations, uint32_t* aSequence) {
234 return false;
237 bool FinalizeOrphanedMinidump(uint32_t aChildPid, GeckoProcessType aType,
238 nsString* aDumpId) {
239 return false;
242 #if defined(XP_WIN)
244 DWORD WINAPI WerNotifyProc(LPVOID aParameter) { return 0; }
246 #endif // defined(XP_WIN)
248 ThreadId CurrentThreadId() { return -1; }
250 bool TakeMinidump(nsIFile** aResult, bool aMoveToPending) { return false; }
252 bool CreateMinidumpsAndPair(ProcessHandle aTargetPid,
253 ThreadId aTargetBlamedThread,
254 const nsACString& aIncomingPairName,
255 AnnotationTable& aTargetAnnotations,
256 nsIFile** aTargetDumpOut) {
257 return false;
260 bool UnsetRemoteExceptionHandler(bool wasSet) { return false; }
262 #if defined(MOZ_WIDGET_ANDROID)
263 void SetNotificationPipeForChild(FileHandle childCrashFd) {}
265 void AddLibraryMapping(const char* library_name, uintptr_t start_address,
266 size_t mapping_length, size_t file_offset) {}
267 #endif
269 } // namespace CrashReporter