Bug 1634779 - pt 2. Partially revert Bug 1603006 r=kmag
[gecko.git] / dom / ipc / nsIHangReport.idl
bloba35be9ea6ada1febd7515ad1e35a957c9297ee81
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
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 "nsISupports.idl"
9 webidl FrameLoader;
10 webidl Element;
12 /**
13 * When a content process hangs, Gecko notifies "process-hang-report" observers
14 * and passes an nsIHangReport for the subject parameter. There is at most one
15 * nsIHangReport associated with a given content process. As long as the content
16 * process stays stuck, the "process-hang-report" observer will continue to be
17 * notified at regular intervals (approximately once per second). The content
18 * process will continue to run uninhibitedly during this time.
21 [scriptable, uuid(5fcffbb9-be62-49b1-b8a1-36e820787a74)]
22 interface nsIHangReport : nsISupports
24 const unsigned long SLOW_SCRIPT = 1;
25 const unsigned long PLUGIN_HANG = 2;
27 // The type of hang being reported: SLOW_SCRIPT or PLUGIN_HANG.
28 readonly attribute unsigned long hangType;
30 // For SLOW_SCRIPT reports, these fields contain information about the
31 // slow script.
32 // Only valid for SLOW_SCRIPT reports.
33 readonly attribute Element scriptBrowser;
34 readonly attribute ACString scriptFileName;
35 readonly attribute AString addonId;
37 // For PLUGIN_HANGs, this field contains information about the plugin.
38 // Only valid for PLUGIN_HANG reports.
39 readonly attribute ACString pluginName;
41 // Called by front end code when user ignores or cancels
42 // the notification.
43 void userCanceled();
45 // Terminate the slow script if it is still running.
46 // Only valid for SLOW_SCRIPT reports.
47 void terminateScript();
49 // Terminate all scripts on the global that triggered the slow script
50 // warning.
51 // Only valid for SLOW_SCRIPT reports.
52 void terminateGlobal();
54 // Terminate the plugin if it is still hung.
55 // Only valid for PLUGIN_HANG reports.
56 void terminatePlugin();
58 // Ask the content process to start up the slow script debugger.
59 // Only valid for SLOW_SCRIPT reports.
60 void beginStartingDebugger();
62 // Inform the content process that the slow script debugger has finished
63 // spinning up. The content process will run a nested event loop until this
64 // method is called.
65 // Only valid for SLOW_SCRIPT reports.
66 void endStartingDebugger();
68 // Inquire whether the report is for a content process loaded by the given
69 // frameloader.
70 bool isReportForBrowser(in FrameLoader aFrameLoader);