Bug 1570089 Part 3 - Generate replaying process crash reports when requested by the middleman, r=mccr8.
authorBrian Hackett <bhackett1024@gmail.com>
Sun, 04 Aug 2019 16:50:37 +0000
changeset 486118 6b5eb4429f83354e9fbe02876f569e8de5c21c3d
parent 486117 28b46b8166ee83421f5210655188d633db62e4cd
child 486119 6d39582362deeadbe989577e16b5ee570441d410
push id36390
push usercbrindusan@mozilla.com
push dateMon, 05 Aug 2019 09:54:13 +0000
treeherdermozilla-central@d681969e4480 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1570089
milestone70.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 1570089 Part 3 - Generate replaying process crash reports when requested by the middleman, r=mccr8. Depends on D39926 Differential Revision: https://phabricator.services.mozilla.com/D39927
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
dom/ipc/PContent.ipdl
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -1891,16 +1891,35 @@ mozilla::ipc::IPCResult ContentParent::R
   if (!mReplayingChildren[aChannelId]->LaunchAndWaitForProcessHandle(
           extraArgs)) {
     return IPC_FAIL_NO_REASON(this);
   }
 
   return IPC_OK();
 }
 
+mozilla::ipc::IPCResult ContentParent::RecvGenerateReplayCrashReport(
+    const uint32_t& aChannelId) {
+  if (aChannelId >= mReplayingChildren.length()) {
+    return IPC_FAIL(this, "invalid channel ID");
+  }
+
+  GeckoChildProcessHost* child = mReplayingChildren[aChannelId];
+  if (!child) {
+    return IPC_FAIL(this, "invalid channel ID");
+  }
+
+  if (mCrashReporter) {
+    ProcessId pid = base::GetProcId(child->GetChildProcessHandle());
+    mCrashReporter->GenerateCrashReport(pid);
+  }
+
+  return IPC_OK();
+}
+
 jsipc::CPOWManager* ContentParent::GetCPOWManager() {
   if (PJavaScriptParent* p =
           LoneManagedOrNullAsserts(ManagedPJavaScriptParent())) {
     return CPOWManagerFor(p);
   }
   return nullptr;
 }
 
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -298,16 +298,18 @@ class ContentParent final : public PCont
 
   // Let managees query if it is safe to send messages.
   bool IsDestroyed() const { return !mIPCOpen; }
 
   mozilla::ipc::IPCResult RecvOpenRecordReplayChannel(
       const uint32_t& channelId, FileDescriptor* connection);
   mozilla::ipc::IPCResult RecvCreateReplayingProcess(
       const uint32_t& aChannelId);
+  mozilla::ipc::IPCResult RecvGenerateReplayCrashReport(
+      const uint32_t& aChannelId);
 
   mozilla::ipc::IPCResult RecvCreateGMPService();
 
   mozilla::ipc::IPCResult RecvLoadPlugin(
       const uint32_t& aPluginId, nsresult* aRv, uint32_t* aRunID,
       Endpoint<PPluginModuleParent>* aEndpoint);
 
   mozilla::ipc::IPCResult RecvMaybeReloadPlugins();
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -812,16 +812,17 @@ child:
     async RegisterBrowsingContextGroup(BrowsingContextInitializer[] aInits);
 
 parent:
     async InitBackground(Endpoint<PBackgroundParent> aEndpoint);
 
     sync OpenRecordReplayChannel(uint32_t channelId)
         returns (FileDescriptor connection);
     async CreateReplayingProcess(uint32_t channelId);
+    async GenerateReplayCrashReport(uint32_t channelId);
 
     async CreateGMPService();
 
     async InitStreamFilter(uint64_t channelId, nsString addonId)
         returns (Endpoint<PStreamFilterChild> aEndpoint);
 
     /**
      * This call connects the content process to a plugin process. This call