Bug 1647695 - Expose ChildID on frozen nsIHangReport;r=mconley
authorDavid Teller <dteller@mozilla.com>
Mon, 03 Aug 2020 17:34:53 +0000
changeset 544072 d025884043681815fbeda2c785295918a12c368d
parent 544071 3bdd93319474f69d0bfe0825db83185c00d68a84
child 544073 b3e8e9466c0dc1c61aa8848b6c3b9e15851902fc
push id37687
push userapavel@mozilla.com
push dateMon, 10 Aug 2020 21:36:34 +0000
treeherdermozilla-central@ee09cb88af17 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1647695
milestone81.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1647695 - Expose ChildID on frozen nsIHangReport;r=mconley Differential Revision: https://phabricator.services.mozilla.com/D83665
dom/ipc/ProcessHangMonitor.cpp
dom/ipc/nsIHangReport.idl
--- a/dom/ipc/ProcessHangMonitor.cpp
+++ b/dom/ipc/ProcessHangMonitor.cpp
@@ -1209,16 +1209,25 @@ HangMonitoredProcess::UserCanceled() {
 
   if (mActor) {
     uint32_t id = mHangData.get_PluginHangData().pluginId();
     mActor->CleanupPluginHang(id, true);
   }
   return NS_OK;
 }
 
+NS_IMETHODIMP
+HangMonitoredProcess::GetChildID(uint64_t* aChildID) {
+  if (!mContentParent) {
+    return NS_ERROR_NOT_AVAILABLE;
+  }
+  *aChildID = mContentParent->ChildID();
+  return NS_OK;
+}
+
 static bool InterruptCallback(JSContext* cx) {
   if (HangMonitorChild* child = HangMonitorChild::Get()) {
     return child->InterruptCallback();
   }
 
   return true;
 }
 
--- a/dom/ipc/nsIHangReport.idl
+++ b/dom/ipc/nsIHangReport.idl
@@ -35,16 +35,19 @@ interface nsIHangReport : nsISupports
   // Duration of the hang so far.
   readonly attribute double hangDuration;
   readonly attribute AString addonId;
 
   // For PLUGIN_HANGs, this field contains information about the plugin.
   // Only valid for PLUGIN_HANG reports.
   readonly attribute ACString pluginName;
 
+  // The child id of the process in which the hang happened.
+  readonly attribute unsigned long long childID;
+
   // Called by front end code when user ignores or cancels
   // the notification.
   void userCanceled();
 
   // Terminate the slow script if it is still running.
   // Only valid for SLOW_SCRIPT reports.
   void terminateScript();