Bug 1465452 Part 11 - Record refcount changes for pipe input/output streams, r=erahm.
authorBrian Hackett <bhackett1024@gmail.com>
Sat, 21 Jul 2018 14:34:51 +0000
changeset 427682 2fc6404e8d2a207c2a01ea6888f5b0066a68d794
parent 427681 25957aa95ba319774782bac5e0211ef82be65ac3
child 427683 f01abf3b9dd773688f5200d4c7f9705185c6e9b2
push id105513
push userbhackett@mozilla.com
push dateSun, 22 Jul 2018 02:15:03 +0000
treeherdermozilla-inbound@b17cfac5aa3f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerserahm
bugs1465452
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 1465452 Part 11 - Record refcount changes for pipe input/output streams, r=erahm.
xpcom/io/nsPipe3.cpp
--- a/xpcom/io/nsPipe3.cpp
+++ b/xpcom/io/nsPipe3.cpp
@@ -144,17 +144,20 @@ class nsPipeInputStream final
   : public nsIAsyncInputStream
   , public nsISeekableStream
   , public nsISearchableInputStream
   , public nsICloneableInputStream
   , public nsIClassInfo
   , public nsIBufferedInputStream
 {
 public:
-  NS_DECL_THREADSAFE_ISUPPORTS
+  // Pipe input streams preserve their refcount changes when record/replaying,
+  // as otherwise the thread which destroys the stream may vary between
+  // recording and replaying.
+  NS_DECL_THREADSAFE_ISUPPORTS_WITH_RECORDING(recordreplay::Behavior::Preserve)
   NS_DECL_NSIINPUTSTREAM
   NS_DECL_NSIASYNCINPUTSTREAM
   NS_DECL_NSISEEKABLESTREAM
   NS_DECL_NSISEARCHABLEINPUTSTREAM
   NS_DECL_NSICLONEABLEINPUTSTREAM
   NS_DECL_NSICLASSINFO
   NS_DECL_NSIBUFFEREDINPUTSTREAM
 
@@ -295,17 +298,19 @@ private:
 
 class nsPipe final : public nsIPipe
 {
 public:
   friend class nsPipeInputStream;
   friend class nsPipeOutputStream;
   friend class AutoReadSegment;
 
-  NS_DECL_THREADSAFE_ISUPPORTS
+  // As for nsPipeInputStream, preserve refcount changes when recording or
+  // replaying.
+  NS_DECL_THREADSAFE_ISUPPORTS_WITH_RECORDING(recordreplay::Behavior::Preserve)
   NS_DECL_NSIPIPE
 
   // nsPipe methods:
   nsPipe();
 
 private:
   ~nsPipe();