From a527b58145cf74e30ff1e982b1e17a2f9909e6f3 Mon Sep 17 00:00:00 2001 From: Brian Hackett Date: Wed, 17 Oct 2018 10:02:02 -0600 Subject: [PATCH] Bug 1488808 Part 7 - Keep track of the PID of the recording process, r=froydnj. --HG-- extra : rebase_source : 6ac89e1c4ac71a29a7710f64e74654b119c76896 --- toolkit/recordreplay/ProcessRecordReplay.cpp | 10 ++++++++++ toolkit/recordreplay/ProcessRecordReplay.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/toolkit/recordreplay/ProcessRecordReplay.cpp b/toolkit/recordreplay/ProcessRecordReplay.cpp index 6da2d3357e1d..6b5c637f7750 100644 --- a/toolkit/recordreplay/ProcessRecordReplay.cpp +++ b/toolkit/recordreplay/ProcessRecordReplay.cpp @@ -51,6 +51,9 @@ char* gRecordingFilename; // Current process ID. static int gPid; +// ID of the process which produced the recording. +static int gRecordingPid; + // Whether to spew record/replay messages to stderr. static bool gSpewEnabled; @@ -154,6 +157,7 @@ RecordReplayInterface_Initialize(int aArgc, char* aArgv[]) Lock::InitializeLocks(); InitializeRewindState(); + gRecordingPid = RecordReplayValue(gPid); gInitialized = true; } @@ -327,6 +331,12 @@ ThreadEventName(ThreadEvent aEvent) return gRedirections[callId].mName; } +int +GetRecordingPid() +{ + return gRecordingPid; +} + /////////////////////////////////////////////////////////////////////////////// // Record/Replay Assertions /////////////////////////////////////////////////////////////////////////////// diff --git a/toolkit/recordreplay/ProcessRecordReplay.h b/toolkit/recordreplay/ProcessRecordReplay.h index 8e3a63ef7e97..3902d9ddd8bd 100644 --- a/toolkit/recordreplay/ProcessRecordReplay.h +++ b/toolkit/recordreplay/ProcessRecordReplay.h @@ -232,6 +232,9 @@ MOZ_MakeRecordReplayPrinter(PrintSpew, true) #undef MOZ_MakeRecordReplayPrinter +// Get the ID of the process that produced the recording. +int GetRecordingPid(); + /////////////////////////////////////////////////////////////////////////////// // Profiling ///////////////////////////////////////////////////////////////////////////////