This patch changes the crashreporter client code as well as the crash service code to compute a SHA256 hash of a crash' minidump file and add it to the crash ping. The crash service code computes the hash on the fly before handing over the crash to the crash manager; the crash manager will then add it to the crash ping. The crashreporter client on the other hand sends the hash via the ping it generates but it also adds it to the event file so that the crash manager can pick it up and send it along with its own crash ping. On Fennec the crashreporter activity takes care of computing the hash. SHA256 hash computation uses nsICryptoHash in the crash service, the java.security.MessageDigest class in Fennec, the bundled NSS library in the crashreporter when running on Windows and Mac and the system-provided NSS library under Linux. The latter is required because the crashreporter client uses the system curl library which is linked to NSS and which would thus clash with the bundled one if used together. This patch introduces two new methods for the nsICrashService interface: |getMinidumpForID()| and |getExtraFileForID()|, these reliably retrieve the .dmp and .extra files associated with a crash and ensure the files exist before returning. These new methods are used in the CrashService for processing and will become the only way to reliably retrieve those files from a crash ID. MozReview-Commit-ID: 8BKvqj6URcO
33 lines
1.0 KiB
Plaintext
33 lines
1.0 KiB
Plaintext
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
[scriptable, uuid(f60d76e5-62c3-4f58-89f6-b726c2b7bc20)]
|
|
interface nsICrashService : nsISupports
|
|
{
|
|
/**
|
|
* Records the occurrence of a crash.
|
|
*
|
|
* @param processType
|
|
* One of the PROCESS_TYPE constants defined below.
|
|
* @param crashType
|
|
* One of the CRASH_TYPE constants defined below.
|
|
* @param id
|
|
* Crash ID. Likely a UUID.
|
|
*
|
|
* @return {Promise} A promise that resolves after the crash has been stored
|
|
*/
|
|
void addCrash(in long processType, in long crashType, in AString id);
|
|
|
|
const long PROCESS_TYPE_MAIN = 0;
|
|
const long PROCESS_TYPE_CONTENT = 1;
|
|
const long PROCESS_TYPE_PLUGIN = 2;
|
|
const long PROCESS_TYPE_GMPLUGIN = 3;
|
|
const long PROCESS_TYPE_GPU = 4;
|
|
|
|
const long CRASH_TYPE_CRASH = 0;
|
|
const long CRASH_TYPE_HANG = 1;
|
|
};
|