Bug 1480640 - Fix hazard in CopyingStructuredCloneReadCallback, r=baku a=lizzard
authorSteve Fink <sfink@mozilla.com>
Fri, 03 Aug 2018 09:19:14 -0700
changeset 478421 16a5f0d51b4a54aaf826f4ae526bfef5e2861474
parent 478420 462f6b16d5888cbd0ca60850b7191eea20c09cd4
child 478422 3e579ac0cc19de9bed955b044a9397da74cd8ad8
push id9664
push userarchaeopteryx@coole-files.de
push dateWed, 15 Aug 2018 08:30:27 +0000
treeherdermozilla-beta@e8db9f7d2225 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku, lizzard
bugs1480640
milestone62.0
Bug 1480640 - Fix hazard in CopyingStructuredCloneReadCallback, r=baku a=lizzard
dom/indexedDB/IDBObjectStore.cpp
--- a/dom/indexedDB/IDBObjectStore.cpp
+++ b/dom/indexedDB/IDBObjectStore.cpp
@@ -1297,33 +1297,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;
   }