summaryrefslogtreecommitdiffstats
path: root/toolkit/components/backgroundhangmonitor/nsIHangDetails.idl
blob: f9c6ba2de06b31e747386b415c1e853ec45b9003 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* 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"

%{ C++
namespace mozilla {
class HangDetails;
}
%}

[ref] native HangDetailsRef(mozilla::HangDetails);

/**
 * A scriptable interface for getting information about a BHR detected hang.
 * This is the type of the subject of the "bhr-thread-hang" observer topic.
 */
[scriptable, uuid(23d63fff-38d6-4003-9c57-2c90aca1180a)]
interface nsIHangDetails : nsISupports
{
  /**
   * The hang was persisted to disk as a permahang, so we can clear the
   * permahang file once we submit this.
   */
  readonly attribute bool wasPersisted;

  /**
   * The detected duration of the hang in milliseconds.
   */
  readonly attribute double duration;

  /**
   * The name of the thread which hung.
   */
  readonly attribute ACString thread;

  /**
   * The name of the runnable which hung if it hung on the main thread.
   */
  readonly attribute ACString runnableName;

  /**
   * The type of process which produced the hang. This should be either:
   * "default", "content", or "gpu".
   */
  readonly attribute ACString process;

  /**
   * The remote type of the content process which produced the hang.
   */
  readonly attribute AUTF8String remoteType;

  /**
   * Returns the stack which was captured by BHR. The offset is encoded as a hex
   * string, as it can contain numbers larger than JS can hold losslessly.
   *
   * This value takes the following form:
   * [ [moduleIndex, offset], ... ]
   */
  [implicit_jscontext] readonly attribute jsval stack;

  /**
   * Returns the modules which were captured by BHR.
   *
   * This value takes the following form:
   * [ ["fileName", "BreakpadId"], ... ]
   */
  [implicit_jscontext] readonly attribute jsval modules;

  /**
   * The hang annotations which were captured when the hang occured. This
   * attribute is a JS object of key-value pairs.
   */
  [implicit_jscontext] readonly attribute jsval annotations;
};