Bug 1480640 - Fix hazard in CopyingStructuredCloneReadCallback, r=baku
authorSteve Fink <sfink@mozilla.com>
Fri, 03 Aug 2018 09:19:14 -0700
changeset 486379 8ac2b54e22a8c7610e15c6f697e38a4bfe40e4a7
parent 486378 309fe3a601ac44cacccdda9fab32a0601a046005
child 486380 f6684513f10a4d4893f5000e246a3e03acd98c43
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1480640
milestone63.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 1480640 - Fix hazard in CopyingStructuredCloneReadCallback, r=baku
dom/indexedDB/IDBObjectStore.cpp
--- a/dom/indexedDB/IDBObjectStore.cpp
+++ b/dom/indexedDB/IDBObjectStore.cpp
@@ -937,33 +937,29 @@ CopyingStructuredCloneReadCallback(JSCon
       result.set(&wrappedFile.toObject());
 
       return result;
     }
 
     if (aTag == SCTAG_DOM_MUTABLEFILE) {
       MOZ_ASSERT(file.mType == StructuredCloneFile::eMutableFile);
 
-      RefPtr<IDBMutableFile> mutableFile = file.mMutableFile;
-
       JS::Rooted<JS::Value> wrappedMutableFile(aCx);
-      if (NS_WARN_IF(!ToJSValue(aCx, mutableFile, &wrappedMutableFile))) {
+      if (NS_WARN_IF(!ToJSValue(aCx, file.mMutableFile, &wrappedMutableFile))) {
         return nullptr;
       }
 
       result.set(&wrappedMutableFile.toObject());
 
       return result;
     }
 
     MOZ_ASSERT(file.mType == StructuredCloneFile::eWasmBytecode);
 
-    RefPtr<JS::WasmModule> module = file.mWasmModule;
-
-    JS::Rooted<JSObject*> wrappedModule(aCx, module->createObject(aCx));
+    JS::Rooted<JSObject*> wrappedModule(aCx, file.mWasmModule->createObject(aCx));
     if (NS_WARN_IF(!wrappedModule)) {
       return nullptr;
     }
 
     result.set(wrappedModule);
 
     return result;
   }