xpcom/system/nsICrashReporter.idl

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #include "nsISupports.idl"
     7 interface nsIFile;
     8 interface nsIURL;
    10 /**
    11  * Provides access to crash reporting functionality.
    12  *
    13  * @status UNSTABLE - This interface is not frozen and will probably change in
    14  *                    future releases.
    15  */
    17 [scriptable, uuid(a2080795-e54c-4ecb-b001-bdc08a2021dd)]
    18 interface nsICrashReporter : nsISupports
    19 {
    20   /**
    21    * Get the enabled status of the crash reporter.
    22    */
    23   readonly attribute boolean enabled;
    25   /**
    26    * Enable or disable crash reporting at runtime. Not available to script
    27    * because the JS engine relies on proper exception handler chaining.
    28    */
    29   [noscript]
    30   void setEnabled(in bool enabled);
    32   /**
    33    * Get or set the URL to which crash reports will be submitted.
    34    * Only https and http URLs are allowed, as the submission is handled
    35    * by OS-native networking libraries.
    36    *
    37    * @throw NS_ERROR_NOT_INITIALIZED if crash reporting is not initialized
    38    * @throw NS_ERROR_INVALID_ARG on set if a non-http(s) URL is assigned
    39    * @throw NS_ERROR_FAILURE on get if no URL is set
    40    */
    41   attribute nsIURL serverURL;
    43   /**
    44    * Get or set the path on the local system to which minidumps will be
    45    * written when a crash happens.
    46    *
    47    * @throw NS_ERROR_NOT_INITIALIZED if crash reporting is not initialized
    48    */
    49   attribute nsIFile minidumpPath;
    51   /**
    52    * Add some extra data to be submitted with a crash report.
    53    *
    54    * @param key
    55    *        Name of the data to be added.
    56    * @param data
    57    *        Data to be added.
    58    *
    59    * @throw NS_ERROR_NOT_INITIALIZED if crash reporting not initialized
    60    * @throw NS_ERROR_INVALID_ARG if key or data contain invalid characters.
    61    *                             Invalid characters for key are '=' and
    62    *                             '\n'.  Invalid character for data is '\0'.
    63    */
    64   void annotateCrashReport(in ACString key, in ACString data);
    66   /**
    67    * Append some data to the "Notes" field, to be submitted with a crash report.
    68    * Unlike annotateCrashReport, this method will append to existing data.
    69    *
    70    * @param data
    71    *        Data to be added.
    72    *
    73    * @throw NS_ERROR_NOT_INITIALIZED if crash reporting not initialized
    74    * @throw NS_ERROR_INVALID_ARG if data contains invalid characters.
    75    *                             The only invalid character is '\0'.
    76    */
    77   void appendAppNotesToCrashReport(in ACString data);
    79   /**
    80    * Register a given memory range to be included in the crash report.
    81    *
    82    * @param ptr
    83    *        The starting address for the bytes.
    84    * @param size
    85    *        The number of bytes to include.
    86    *
    87    * @throw NS_ERROR_NOT_INITIALIZED if crash reporting not initialized
    88    * @throw NS_ERROR_NOT_IMPLEMENTED if unavailable on the current OS
    89    */
    90   void registerAppMemory(in unsigned long long ptr, in unsigned long long size);
    92   /**
    93    * Write a minidump immediately, with the user-supplied exception
    94    * information. This is implemented on Windows only, because
    95    * SEH (structured exception handling) exists on Windows only.
    96    *
    97    * @param aExceptionInfo  EXCEPTION_INFO* provided by Window's SEH
    98    */
    99   [noscript] void writeMinidumpForException(in voidPtr aExceptionInfo);
   101   /**
   102    * Append note containing an Obj-C exception's info.
   103    *
   104    * @param aException  NSException object to append note for
   105    */
   106   [noscript] void appendObjCExceptionInfoToAppNotes(in voidPtr aException);
   108   /**
   109    * User preference for submitting crash reports.
   110    */
   111   attribute boolean submitReports;
   113   /**
   114    * Cause the crash reporter to re-evaluate where crash events should go.
   115    *
   116    * This should be called during application startup and whenever profiles
   117    * change.
   118    */
   119   void UpdateCrashEventsDir();
   120 };

mercurial