Skip to content

Commit

Permalink
Bug 1837333 - webrtc stats history should be cleared on parent proces…
Browse files Browse the repository at this point in the history
…s only;r=pehrsons, a=dmeehan

The stats history only lives on the parent process. Clearing the logs from about:webrtc causes a (non-release) assertion. This was missed in testing. I will look into changing that in a follow up Bug 1837335.

Differential Revision: https://phabricator.services.mozilla.com/D180299
  • Loading branch information
na-g committed Jun 13, 2023
1 parent 06f3893 commit 65568d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dom/media/webrtc/jsapi/WebrtcGlobalInformation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "nsLiteralString.h"
#include "nsNetCID.h" // NS_SOCKETTRANSPORTSERVICE_CONTRACTID
#include "nsServiceManagerUtils.h" // do_GetService
#include "nsXULAppAPI.h"
#include "mozilla/ErrorResult.h"
#include "nsProxyRelease.h" // nsMainThreadPtrHolder
#include "mozilla/Telemetry.h"
Expand Down Expand Up @@ -174,7 +175,9 @@ static void ClearLongTermStats() {
}

GetWebrtcGlobalStatsStash().Clear();
WebrtcGlobalStatsHistory::Clear();
if (XRE_IsParentProcess()) {
WebrtcGlobalStatsHistory::Clear();
}
if (auto* ctx = GetPeerConnectionCtx()) {
ctx->ClearClosedStats();
}
Expand Down Expand Up @@ -739,7 +742,6 @@ mozilla::ipc::IPCResult WebrtcGlobalChild::RecvClearStats() {
}

ClearLongTermStats();
WebrtcGlobalStatsHistory::Clear();
return IPC_OK();
}

Expand Down

0 comments on commit 65568d3

Please sign in to comment.