mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 970713 - Add 'Start Debug Mode' button to about:webrtc. r=smaug, r=Unfocused, r=jesup
This commit is contained in:
parent
af0b5dd5d3
commit
8b459224fd
@ -21,6 +21,14 @@ interface WebrtcGlobalInformation {
|
||||
[Throws]
|
||||
static void getLogging(DOMString pattern,
|
||||
WebrtcGlobalLoggingCallback callback);
|
||||
|
||||
// NSPR WebRTC Trace debug level (0 - 65535)
|
||||
//
|
||||
// Notes:
|
||||
// - Setting a non-zero debug level turns on gathering of log for file output.
|
||||
// - Subsequently setting a zero debug level writes that log to disk.
|
||||
|
||||
static attribute long debugLevel;
|
||||
};
|
||||
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "CSFLog.h"
|
||||
|
||||
#include "WebRtcLog.h"
|
||||
#include "mozilla/dom/WebrtcGlobalInformationBinding.h"
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
@ -232,6 +232,21 @@ WebrtcGlobalInformation::GetLogging(
|
||||
aRv = rv;
|
||||
}
|
||||
|
||||
static int32_t sLastSetLevel = 0;
|
||||
|
||||
void
|
||||
WebrtcGlobalInformation::SetDebugLevel(const GlobalObject& aGlobal, int32_t aLevel)
|
||||
{
|
||||
StartWebRtcLog(webrtc::TraceLevel(aLevel));
|
||||
sLastSetLevel = aLevel;
|
||||
}
|
||||
|
||||
int32_t
|
||||
WebrtcGlobalInformation::DebugLevel(const GlobalObject& aGlobal)
|
||||
{
|
||||
return sLastSetLevel;
|
||||
}
|
||||
|
||||
struct StreamResult {
|
||||
StreamResult() : candidateTypeBitpattern(0), streamSucceeded(false) {}
|
||||
uint8_t candidateTypeBitpattern;
|
||||
|
@ -33,6 +33,9 @@ public:
|
||||
WebrtcGlobalLoggingCallback& aLoggingCallback,
|
||||
ErrorResult& aRv);
|
||||
|
||||
static void SetDebugLevel(const GlobalObject& aGlobal, int32_t aLevel);
|
||||
static int32_t DebugLevel(const GlobalObject& aGlobal);
|
||||
|
||||
static void StoreLongTermICEStatistics(sipcc::PeerConnectionImpl& aPc);
|
||||
|
||||
private:
|
||||
|
@ -384,13 +384,41 @@ function displayStats(globalReport) {
|
||||
});
|
||||
}
|
||||
|
||||
function onLoad() {
|
||||
WebrtcGlobalInformation.getAllStats(displayStats);
|
||||
if (WebrtcGlobalInformation.debugLevel) {
|
||||
setDebugButton(true);
|
||||
} else {
|
||||
setDebugButton(false);
|
||||
}
|
||||
}
|
||||
|
||||
function startDebugMode() {
|
||||
WebrtcGlobalInformation.debugLevel = 65535;
|
||||
setDebugButton(true);
|
||||
}
|
||||
|
||||
function stopDebugMode() {
|
||||
WebrtcGlobalInformation.debugLevel = 0;
|
||||
setDebugButton(false);
|
||||
}
|
||||
|
||||
function setDebugButton(on) {
|
||||
var button = document.getElementById("debug-toggle-button");
|
||||
button.innerHTML = on ? "Stop debug mode" : "Start debug mode";
|
||||
button.onclick = on ? stopDebugMode : startDebugMode;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<body id="body" onload="WebrtcGlobalInformation.getAllStats(displayStats)">
|
||||
<body id="body" onload="onLoad()">
|
||||
<div id="stats">
|
||||
</div>
|
||||
<button onclick="WebrtcGlobalInformation.getLogging('', displayLogs)">
|
||||
Show/refresh logging
|
||||
Connection log
|
||||
</button>
|
||||
<button id="debug-toggle-button" onclick="startDebugMode()">
|
||||
Start debug mode
|
||||
</button>
|
||||
<div id="logs">
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user