Bug 1320533 - Avoid setting up DataStorage in the child process when we're shutting down, hopefully fixing a shutdown hang; r=bkelly a=jcristau
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 21 Dec 2016 11:42:58 -0500
changeset 353341 23eae10f94cb96e2d9abe166e073fb0584c8bc3c
parent 353340 934c375788011ec2d6ab60a019657acdce054e6f
child 353342 c61930c496738e059dca43c650567680f8e748d5
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly, jcristau
bugs1320533
milestone52.0a2
Bug 1320533 - Avoid setting up DataStorage in the child process when we're shutting down, hopefully fixing a shutdown hang; r=bkelly a=jcristau
dom/ipc/ContentParent.cpp
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -2415,16 +2415,22 @@ ContentParent::RecvReadFontList(Infallib
 #endif
   return true;
 }
 
 bool
 ContentParent::RecvReadDataStorageArray(const nsString& aFilename,
                                         InfallibleTArray<DataStorageItem>* aValues)
 {
+  // If we're shutting down, the DataStorage object may have been cleared
+  // already, and setting it up is pointless anyways since we're about to die.
+  if (mShutdownPending) {
+    return true;
+  }
+
   // Ensure the SSS is initialized before we try to use its storage.
   nsCOMPtr<nsISiteSecurityService> sss = do_GetService("@mozilla.org/ssservice;1");
 
   RefPtr<DataStorage> storage = DataStorage::Get(aFilename);
   storage->GetAll(aValues);
   return true;
 }