Bug 1465452 Part 12 - Record refcount changes for abstract threads, r=froydnj.
authorBrian Hackett <bhackett1024@gmail.com>
Sat, 21 Jul 2018 14:35:23 +0000
changeset 427683 f01abf3b9dd773688f5200d4c7f9705185c6e9b2
parent 427682 2fc6404e8d2a207c2a01ea6888f5b0066a68d794
child 427684 ebe594fec36d8c00a0f26c89bc284a1366de2d74
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)
reviewersfroydnj
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 12 - Record refcount changes for abstract threads, r=froydnj.
xpcom/threads/AbstractThread.h
--- a/xpcom/threads/AbstractThread.h
+++ b/xpcom/threads/AbstractThread.h
@@ -51,17 +51,20 @@ public:
   // Returns an AbstractThread wrapper of a nsIThread.
   static already_AddRefed<AbstractThread>
   CreateXPCOMThreadWrapper(nsIThread* aThread, bool aRequireTailDispatch);
 
   // Returns an AbstractThread wrapper of a non-nsIThread EventTarget on the main thread.
   static already_AddRefed<AbstractThread>
   CreateEventTargetWrapper(nsIEventTarget* aEventTarget, bool aRequireTailDispatch);
 
-  NS_DECL_THREADSAFE_ISUPPORTS
+  // AbstractThreads preserve their refcounts when recording/replaying, as
+  // otherwise the thread which releases the last reference may vary between
+  // recording and replaying.
+  NS_DECL_THREADSAFE_ISUPPORTS_WITH_RECORDING(recordreplay::Behavior::Preserve)
 
   // We don't use NS_DECL_NSIEVENTTARGET so that we can remove the default
   // |flags| parameter from Dispatch. Otherwise, a single-argument Dispatch call
   // would be ambiguous.
   NS_IMETHOD_(bool) IsOnCurrentThreadInfallible(void) override;
   NS_IMETHOD IsOnCurrentThread(bool *_retval) override;
   NS_IMETHOD Dispatch(already_AddRefed<nsIRunnable> event, uint32_t flags) override;
   NS_IMETHOD DispatchFromScript(nsIRunnable *event, uint32_t flags) override;