Bug 1293949 - nsFileInputStream must do the pending open step before been serialized, r=mayhemer a=ritu CLOSED TREE
authorAndrea Marchesini <amarchesini@mozilla.com>
Fri, 23 Sep 2016 15:29:05 +0200
changeset 350415 68b9c9dc4612b42a6cf81be86572339762c0853f
parent 350414 0b08e3d9588ec3fcb2b4d04f1c5dc8014c79a685
child 350416 865939f4946d80fa532aaa168515a2fe69f9a774
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer, ritu
bugs1293949
milestone50.0
Bug 1293949 - nsFileInputStream must do the pending open step before been serialized, r=mayhemer a=ritu CLOSED TREE
netwerk/base/nsFileStreams.cpp
--- a/netwerk/base/nsFileStreams.cpp
+++ b/netwerk/base/nsFileStreams.cpp
@@ -574,17 +574,17 @@ nsFileInputStream::Available(uint64_t *a
 }
 
 void
 nsFileInputStream::Serialize(InputStreamParams& aParams,
                              FileDescriptorArray& aFileDescriptors)
 {
     FileInputStreamParams params;
 
-    if (mFD) {
+    if (NS_SUCCEEDED(DoPendingOpen()) && mFD) {
         FileHandleType fd = FileHandleType(PR_FileDesc2NativeHandle(mFD));
         NS_ASSERTION(fd, "This should never be null!");
 
         DebugOnly<FileDescriptor*> dbgFD = aFileDescriptors.AppendElement(fd);
         NS_ASSERTION(dbgFD->IsValid(), "Sending an invalid file descriptor!");
 
         params.fileDescriptorIndex() = aFileDescriptors.Length() - 1;