Bug 1620705 - Don't send "memory-pressure" if ContentChild::mShuttingDown. r=smaug
authorAndrew McCreight <continuation@gmail.com>
Mon, 09 Mar 2020 18:41:34 +0000
changeset 517647 5481f3606f3bd294ca1afdb79833155f10b851ea
parent 517646 a2c3bd0e1fbabeefd166762789ef04c1d35ed80c
child 517648 f6f182f7b3da53732b6a76516bb0b698a9851883
push id37199
push useropoprus@mozilla.com
push dateTue, 10 Mar 2020 03:43:44 +0000
treeherdermozilla-central@6f21f98dcfcd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1620705
milestone75.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 1620705 - Don't send "memory-pressure" if ContentChild::mShuttingDown. r=smaug Shutting down the process is going to free more memory than anything else we could do, so don't delay it. Differential Revision: https://phabricator.services.mozilla.com/D66082
dom/ipc/ContentChild.cpp
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -2657,17 +2657,17 @@ mozilla::ipc::IPCResult ContentChild::Re
              "We have no permissionManager in the Content process !");
 
   permissionManager->RemoveAllFromIPC();
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentChild::RecvFlushMemory(const nsString& reason) {
   nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
-  if (os) {
+  if (!mShuttingDown && os) {
     os->NotifyObservers(nullptr, "memory-pressure", reason.get());
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentChild::RecvActivateA11y(
     const uint32_t& aMainChromeTid, const uint32_t& aMsaaID) {
 #ifdef ACCESSIBILITY