nsIHangReport.idl 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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/. */
  6. #include "nsISupports.idl"
  7. interface nsIDOMElement;
  8. interface nsIFrameLoader;
  9. /**
  10. * When a content process hangs, Gecko notifies "process-hang-report" observers
  11. * and passes an nsIHangReport for the subject parameter. There is at most one
  12. * nsIHangReport associated with a given content process. As long as the content
  13. * process stays stuck, the "process-hang-report" observer will continue to be
  14. * notified at regular intervals (approximately once per second). The content
  15. * process will continue to run uninhibitedly during this time.
  16. */
  17. [scriptable, uuid(5fcffbb9-be62-49b1-b8a1-36e820787a74)]
  18. interface nsIHangReport : nsISupports
  19. {
  20. const unsigned long SLOW_SCRIPT = 1;
  21. const unsigned long PLUGIN_HANG = 2;
  22. // The type of hang being reported: SLOW_SCRIPT or PLUGIN_HANG.
  23. readonly attribute unsigned long hangType;
  24. // For SLOW_SCRIPT reports, these fields contain information about the
  25. // slow script.
  26. // Only valid for SLOW_SCRIPT reports.
  27. readonly attribute nsIDOMElement scriptBrowser;
  28. readonly attribute ACString scriptFileName;
  29. readonly attribute unsigned long scriptLineNo;
  30. // For PLUGIN_HANGs, this field contains information about the plugin.
  31. // Only valid for PLUGIN_HANG reports.
  32. readonly attribute ACString pluginName;
  33. // Called by front end code when user ignores or cancels
  34. // the notification.
  35. void userCanceled();
  36. // Terminate the slow script if it is still running.
  37. // Only valid for SLOW_SCRIPT reports.
  38. void terminateScript();
  39. // Terminate the plugin if it is still hung.
  40. // Only valid for PLUGIN_HANG reports.
  41. void terminatePlugin();
  42. // Ask the content process to start up the slow script debugger.
  43. // Only valid for SLOW_SCRIPT reports.
  44. void beginStartingDebugger();
  45. // Inform the content process that the slow script debugger has finished
  46. // spinning up. The content process will run a nested event loop until this
  47. // method is called.
  48. // Only valid for SLOW_SCRIPT reports.
  49. void endStartingDebugger();
  50. // Inquire whether the report is for a content process loaded by the given
  51. // frameloader.
  52. bool isReportForBrowser(in nsIFrameLoader aFrameLoader);
  53. };