[mq]: bug-1543030 draft
authorJan Varga <jan.varga@gmail.com>
Sat, 18 May 2019 10:18:37 +0200
changeset 2008612 6861192ac08a38c5c39f63de3856e7b2cb137dca
parent 2008611 b4cb17cc1280ed17b454d5bd10a756868b765fd9
child 2008613 e89baae86dd17f23d1764499177255d9cf826bf7
push id363926
push userjvarga@mozilla.com
push dateSat, 18 May 2019 08:19:45 +0000
treeherdertry@e89baae86dd1 [default view] [failures only]
bugs1543030
milestone68.0a1
[mq]: bug-1543030
dom/ipc/ContentParent.cpp
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -1358,16 +1358,22 @@ void ContentParent::ShutDownProcess(Shut
     static_cast<ScriptableCPInfo*>(mScriptableHelper.get())->ProcessDied();
     mScriptableHelper = nullptr;
   }
 
   // Shutting down by sending a shutdown message works differently than the
   // other methods. We first call Shutdown() in the child. After the child is
   // ready, it calls FinishShutdown() on us. Then we close the channel.
   if (aMethod == SEND_SHUTDOWN_MESSAGE) {
+    using mozilla::dom::quota::QuotaManagerService;
+
+    if (QuotaManagerService* qms = QuotaManagerService::GetOrCreate()) {
+      qms->AbortOperationsForProcess(mChildID);
+    }
+
     if (const char* directory =
             recordreplay::parent::SaveAllRecordingsDirectory()) {
       // Save a recording for the child process before it shuts down.
       static int sNumSavedRecordings;
       nsCOMPtr<nsIFile> file;
       if (!NS_FAILED(NS_NewNativeLocalFile(nsDependentCString(directory), false,
                                            getter_AddRefs(file))) &&
           !NS_FAILED(file->AppendNative(
@@ -1387,22 +1393,16 @@ void ContentParent::ShutDownProcess(Shut
         StartForceKillTimer();
       }
     }
     // If call was not successful, the channel must have been broken
     // somehow, and we will clean up the error in ActorDestroy.
     return;
   }
 
-  using mozilla::dom::quota::QuotaManagerService;
-
-  if (QuotaManagerService* qms = QuotaManagerService::GetOrCreate()) {
-    qms->AbortOperationsForProcess(mChildID);
-  }
-
   // If Close() fails with an error, we'll end up back in this function, but
   // with aMethod = CLOSE_CHANNEL_WITH_ERROR.
 
   if (aMethod == CLOSE_CHANNEL && !mCalledClose) {
     // Close() can only be called once: It kicks off the destruction
     // sequence.
     mCalledClose = true;
     Close();