Bug 1510724 Part 3 - Add PreambleResult kind for redirected functions which don't generate events, r=lsmyth.
authorBrian Hackett <bhackett1024@gmail.com>
Wed, 28 Nov 2018 09:14:11 -1000
changeset 505571 5aa50800cd8b74b0b86ceca0d22bd76f6f633857
parent 505570 a69ff828253927c4731ec5dc39d29861fce9bcdf
child 505572 c5e4fbda309ea89ec353d6787187d5e3569b6b6f
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsmyth
bugs1510724
milestone65.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 1510724 Part 3 - Add PreambleResult kind for redirected functions which don't generate events, r=lsmyth.
toolkit/recordreplay/ProcessRedirect.cpp
toolkit/recordreplay/ProcessRedirect.h
--- a/toolkit/recordreplay/ProcessRedirect.cpp
+++ b/toolkit/recordreplay/ProcessRedirect.cpp
@@ -31,16 +31,19 @@ namespace recordreplay {
 ///////////////////////////////////////////////////////////////////////////////
 
 static bool CallPreambleHook(PreambleFn aPreamble, size_t aCallId,
                              CallArguments* aArguments) {
   PreambleResult result = aPreamble(aArguments);
   switch (result) {
     case PreambleResult::Veto:
       return true;
+    case PreambleResult::IgnoreRedirect:
+      RecordReplayInvokeCall(OriginalFunction(aCallId), aArguments);
+      return true;
     case PreambleResult::PassThrough: {
       AutoEnsurePassThroughThreadEvents pt;
       RecordReplayInvokeCall(OriginalFunction(aCallId), aArguments);
       return true;
     }
     case PreambleResult::Redirect:
       return false;
   }
--- a/toolkit/recordreplay/ProcessRedirect.h
+++ b/toolkit/recordreplay/ProcessRedirect.h
@@ -208,21 +208,28 @@ typedef ssize_t ErrorType;
 typedef void (*SaveOutputFn)(Stream& aEvents, CallArguments* aArguments,
                              ErrorType* aError);
 
 // Possible results for the redirection preamble hook.
 enum class PreambleResult {
   // Do not perform any further processing.
   Veto,
 
-  // Perform a function redirection as normal if events are not passed through.
+  // If events are not passed through, add an event for the function call and
+  // perform a function redirection as normal.
   Redirect,
 
-  // Do not add an event for the call, as if events were passed through.
-  PassThrough
+  // Don't add an event for the call or perform a normal function redirection.
+  // If events are not passed through, they may still be added for transitive
+  // callees.
+  IgnoreRedirect,
+
+  // Do not add an event for the call or anything it transitively calls, as if
+  // events were passed through.
+  PassThrough,
 };
 
 // Signature for a function that is called on entry to a redirection and can
 // modify its behavior.
 typedef PreambleResult (*PreambleFn)(CallArguments* aArguments);
 
 // Signature for a function that conveys data about a call to or from the
 // middleman process.