2015-01-17 05:34:47 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
|
|
|
/* 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"
|
|
|
|
|
2018-04-07 01:32:25 +03:00
|
|
|
webidl FrameLoader;
|
2018-04-27 06:36:10 +03:00
|
|
|
webidl Element;
|
2018-04-07 01:32:25 +03:00
|
|
|
|
2015-01-17 05:34:47 +03:00
|
|
|
/**
|
|
|
|
* When a content process hangs, Gecko notifies "process-hang-report" observers
|
|
|
|
* and passes an nsIHangReport for the subject parameter. There is at most one
|
|
|
|
* nsIHangReport associated with a given content process. As long as the content
|
|
|
|
* process stays stuck, the "process-hang-report" observer will continue to be
|
|
|
|
* notified at regular intervals (approximately once per second). The content
|
|
|
|
* process will continue to run uninhibitedly during this time.
|
|
|
|
*/
|
|
|
|
|
2015-11-02 15:37:25 +03:00
|
|
|
[scriptable, uuid(5fcffbb9-be62-49b1-b8a1-36e820787a74)]
|
2015-01-17 05:34:47 +03:00
|
|
|
interface nsIHangReport : nsISupports
|
|
|
|
{
|
|
|
|
const unsigned long SLOW_SCRIPT = 1;
|
|
|
|
const unsigned long PLUGIN_HANG = 2;
|
|
|
|
|
|
|
|
// The type of hang being reported: SLOW_SCRIPT or PLUGIN_HANG.
|
|
|
|
readonly attribute unsigned long hangType;
|
|
|
|
|
|
|
|
// For SLOW_SCRIPT reports, these fields contain information about the
|
|
|
|
// slow script.
|
|
|
|
// Only valid for SLOW_SCRIPT reports.
|
2018-04-27 06:36:10 +03:00
|
|
|
readonly attribute Element scriptBrowser;
|
2015-01-17 05:34:47 +03:00
|
|
|
readonly attribute ACString scriptFileName;
|
2017-08-18 06:17:51 +03:00
|
|
|
readonly attribute AString addonId;
|
2015-01-17 05:34:47 +03:00
|
|
|
|
|
|
|
// For PLUGIN_HANGs, this field contains information about the plugin.
|
|
|
|
// Only valid for PLUGIN_HANG reports.
|
|
|
|
readonly attribute ACString pluginName;
|
|
|
|
|
2015-06-11 20:25:45 +03:00
|
|
|
// Called by front end code when user ignores or cancels
|
|
|
|
// the notification.
|
|
|
|
void userCanceled();
|
|
|
|
|
2015-01-17 05:34:47 +03:00
|
|
|
// Terminate the slow script if it is still running.
|
|
|
|
// Only valid for SLOW_SCRIPT reports.
|
|
|
|
void terminateScript();
|
|
|
|
|
2017-04-17 00:01:16 +03:00
|
|
|
// Terminate all scripts on the global that triggered the slow script
|
|
|
|
// warning.
|
|
|
|
// Only valid for SLOW_SCRIPT reports.
|
|
|
|
void terminateGlobal();
|
|
|
|
|
2015-01-17 05:34:47 +03:00
|
|
|
// Terminate the plugin if it is still hung.
|
|
|
|
// Only valid for PLUGIN_HANG reports.
|
|
|
|
void terminatePlugin();
|
|
|
|
|
|
|
|
// Ask the content process to start up the slow script debugger.
|
|
|
|
// Only valid for SLOW_SCRIPT reports.
|
|
|
|
void beginStartingDebugger();
|
|
|
|
|
|
|
|
// Inform the content process that the slow script debugger has finished
|
|
|
|
// spinning up. The content process will run a nested event loop until this
|
|
|
|
// method is called.
|
|
|
|
// Only valid for SLOW_SCRIPT reports.
|
|
|
|
void endStartingDebugger();
|
|
|
|
|
|
|
|
// Inquire whether the report is for a content process loaded by the given
|
2018-04-07 01:32:25 +03:00
|
|
|
// frameloader.
|
|
|
|
bool isReportForBrowser(in FrameLoader aFrameLoader);
|
2015-01-17 05:34:47 +03:00
|
|
|
};
|