Bug 1547698 - Remove unused IPC methods for taking minidumps r=froydnj
authorGabriele Svelto <gsvelto@mozilla.com>
Tue, 14 May 2019 14:06:19 +0000
changeset 533267 ef9124d5d07fc1799ab0aa19a23998f119b43732
parent 533266 74c8824ac224b33b6617c9c3b54f08eb944be2a4
child 533268 9497f265bed403af04ae44dc5f5fb16f530dff3d
push id11276
push userrgurzau@mozilla.com
push dateMon, 20 May 2019 13:11:24 +0000
treeherdermozilla-beta@847755a7c325 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1547698
milestone68.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 1547698 - Remove unused IPC methods for taking minidumps r=froydnj This removes the XRE_TakeMinidumpForChild() which does not need to be exposed anymore in the XUL API as well as IToplevelProtocol::TakeMinidump() which was simply unused. Differential Revision: https://phabricator.services.mozilla.com/D31062
ipc/glue/CrashReporterHost.cpp
ipc/glue/ProtocolUtils.cpp
ipc/glue/ProtocolUtils.h
toolkit/xre/nsEmbedFunctions.cpp
xpcom/build/nsXULAppAPI.h
--- a/ipc/glue/CrashReporterHost.cpp
+++ b/ipc/glue/CrashReporterHost.cpp
@@ -72,18 +72,18 @@ bool CrashReporterHost::GenerateCrashRep
   return FinalizeCrashReport();
 }
 
 RefPtr<nsIFile> CrashReporterHost::TakeCrashedChildMinidump(
     base::ProcessId aPid, uint32_t* aOutSequence) {
   MOZ_ASSERT(!HasMinidump());
 
   RefPtr<nsIFile> crashDump;
-  if (!XRE_TakeMinidumpForChild(aPid, getter_AddRefs(crashDump),
-                                aOutSequence)) {
+  if (!CrashReporter::TakeMinidumpForChild(aPid, getter_AddRefs(crashDump),
+                                           aOutSequence)) {
     return nullptr;
   }
   if (!AdoptMinidump(crashDump)) {
     return nullptr;
   }
   return crashDump.get();
 }
 
--- a/ipc/glue/ProtocolUtils.cpp
+++ b/ipc/glue/ProtocolUtils.cpp
@@ -599,21 +599,16 @@ void IToplevelProtocol::SetOtherProcessI
   if (recordreplay::IsRecordingOrReplaying() &&
       aOtherPid == recordreplay::child::MiddlemanProcessId()) {
     mOtherPid = recordreplay::child::ParentProcessId();
   } else {
     mOtherPid = aOtherPid;
   }
 }
 
-bool IToplevelProtocol::TakeMinidump(nsIFile** aDump, uint32_t* aSequence) {
-  MOZ_RELEASE_ASSERT(GetSide() == ParentSide);
-  return XRE_TakeMinidumpForChild(OtherPid(), aDump, aSequence);
-}
-
 bool IToplevelProtocol::Open(mozilla::ipc::Transport* aTransport,
                              base::ProcessId aOtherPid, MessageLoop* aThread,
                              mozilla::ipc::Side aSide) {
   SetOtherProcessId(aOtherPid);
   return GetIPCChannel()->Open(aTransport, aThread, aSide);
 }
 
 bool IToplevelProtocol::Open(MessageChannel* aChannel,
--- a/ipc/glue/ProtocolUtils.h
+++ b/ipc/glue/ProtocolUtils.h
@@ -462,18 +462,16 @@ class IToplevelProtocol : public IProtoc
 
   Transport* GetTransport() const { return mTrans.get(); }
 
   ProtocolId GetProtocolId() const { return mProtocolId; }
 
   base::ProcessId OtherPid() const final;
   void SetOtherProcessId(base::ProcessId aOtherPid);
 
-  bool TakeMinidump(nsIFile** aDump, uint32_t* aSequence);
-
   virtual void OnChannelClose() = 0;
   virtual void OnChannelError() = 0;
   virtual void ProcessingError(Result aError, const char* aMsgName) {}
   virtual void OnChannelConnected(int32_t peer_pid) {}
 
   bool Open(mozilla::ipc::Transport* aTransport, base::ProcessId aOtherPid,
             MessageLoop* aThread = nullptr,
             mozilla::ipc::Side aSide = mozilla::ipc::UnknownSide);
--- a/toolkit/xre/nsEmbedFunctions.cpp
+++ b/toolkit/xre/nsEmbedFunctions.cpp
@@ -257,24 +257,16 @@ void XRE_SetProcessType(const char* aPro
   for (int i = 0; i < (int)ArrayLength(kGeckoProcessTypeString); ++i) {
     if (!strcmp(kGeckoProcessTypeString[i], aProcessTypeString)) {
       sChildProcessType = static_cast<GeckoProcessType>(i);
       return;
     }
   }
 }
 
-// FIXME/bug 539522: this out-of-place function is stuck here because
-// IPDL wants access to this crashreporter interface, and
-// crashreporter is built in such a way to make that awkward
-bool XRE_TakeMinidumpForChild(uint32_t aChildPid, nsIFile** aDump,
-                              uint32_t* aSequence) {
-  return CrashReporter::TakeMinidumpForChild(aChildPid, aDump, aSequence);
-}
-
 bool
 #if defined(XP_WIN)
 XRE_SetRemoteExceptionHandler(const char* aPipe /*= 0*/,
                               uintptr_t aCrashTimeAnnotationFile)
 #else
 XRE_SetRemoteExceptionHandler(const char* aPipe /*= 0*/)
 #endif
 {
--- a/xpcom/build/nsXULAppAPI.h
+++ b/xpcom/build/nsXULAppAPI.h
@@ -396,20 +396,16 @@ struct XRE_AndroidChildFds {
 };
 
 XRE_API(void, XRE_SetAndroidChildFds,
         (JNIEnv * env, const XRE_AndroidChildFds& fds))
 #endif  // defined(MOZ_WIDGET_ANDROID)
 
 XRE_API(void, XRE_SetProcessType, (const char* aProcessTypeString))
 
-// Used in the "master" parent process hosting the crash server
-XRE_API(bool, XRE_TakeMinidumpForChild,
-        (uint32_t aChildPid, nsIFile** aDump, uint32_t* aSequence))
-
 // Used in child processes.
 #if defined(XP_WIN)
 // Uses uintptr_t, even though it's really a HANDLE, because including
 // <windows.h> here caused compilation issues.
 XRE_API(bool, XRE_SetRemoteExceptionHandler,
         (const char* aPipe, uintptr_t aCrashTimeAnnotationFile))
 #else
 XRE_API(bool, XRE_SetRemoteExceptionHandler, (const char* aPipe))