This commit is contained in:
Ryan VanderMeulen 2015-06-04 09:35:35 -04:00
Родитель e0cfc9ff1e b3caa9d676
Коммит c5127a4248
553 изменённых файлов: 6119 добавлений и 3770 удалений

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9e10483c5808f94f4a0a9f6afe30aae2c5b42b4c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e0fbadeb78a96137f071d9be7a47ef9fe882d17f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5deaf27fd266316f27e68206cc3be0e6f47ded54"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9e10483c5808f94f4a0a9f6afe30aae2c5b42b4c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e0fbadeb78a96137f071d9be7a47ef9fe882d17f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5deaf27fd266316f27e68206cc3be0e6f47ded54"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

Просмотреть файл

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="9e10483c5808f94f4a0a9f6afe30aae2c5b42b4c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e0fbadeb78a96137f071d9be7a47ef9fe882d17f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5deaf27fd266316f27e68206cc3be0e6f47ded54"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="aac9cc4bb94cf720baf8f7ee419b4d76ac86b1ac"/>

Просмотреть файл

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9e10483c5808f94f4a0a9f6afe30aae2c5b42b4c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e0fbadeb78a96137f071d9be7a47ef9fe882d17f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5deaf27fd266316f27e68206cc3be0e6f47ded54"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="5c487ecd9afbcea1d507b9e4dfd09b3a8787fa65"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9e10483c5808f94f4a0a9f6afe30aae2c5b42b4c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e0fbadeb78a96137f071d9be7a47ef9fe882d17f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5deaf27fd266316f27e68206cc3be0e6f47ded54"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="61e82f99bb8bc78d52b5717e9a2481ec7267fa33">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9e10483c5808f94f4a0a9f6afe30aae2c5b42b4c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e0fbadeb78a96137f071d9be7a47ef9fe882d17f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5deaf27fd266316f27e68206cc3be0e6f47ded54"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

Просмотреть файл

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="9e10483c5808f94f4a0a9f6afe30aae2c5b42b4c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e0fbadeb78a96137f071d9be7a47ef9fe882d17f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5deaf27fd266316f27e68206cc3be0e6f47ded54"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="aac9cc4bb94cf720baf8f7ee419b4d76ac86b1ac"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9e10483c5808f94f4a0a9f6afe30aae2c5b42b4c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e0fbadeb78a96137f071d9be7a47ef9fe882d17f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5deaf27fd266316f27e68206cc3be0e6f47ded54"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

Просмотреть файл

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "9e10483c5808f94f4a0a9f6afe30aae2c5b42b4c",
"git_revision": "e0fbadeb78a96137f071d9be7a47ef9fe882d17f",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "f9a69757f448f43953d09442183e858c236ff328",
"revision": "aa2355f8f650e320a73584dfd2c5a4932577f6ea",
"repo_path": "integration/gaia-central"
}

Просмотреть файл

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9e10483c5808f94f4a0a9f6afe30aae2c5b42b4c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e0fbadeb78a96137f071d9be7a47ef9fe882d17f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5deaf27fd266316f27e68206cc3be0e6f47ded54"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="5c487ecd9afbcea1d507b9e4dfd09b3a8787fa65"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="61e82f99bb8bc78d52b5717e9a2481ec7267fa33">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9e10483c5808f94f4a0a9f6afe30aae2c5b42b4c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e0fbadeb78a96137f071d9be7a47ef9fe882d17f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5deaf27fd266316f27e68206cc3be0e6f47ded54"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

Просмотреть файл

@ -171,9 +171,7 @@ var FullScreen = {
// Add listener to detect when the fullscreen window is re-focused.
// If a fullscreen window loses focus, we show a warning when the
// fullscreen window is refocused.
if (!this.useLionFullScreen) {
window.addEventListener("activate", this);
}
window.addEventListener("activate", this);
// Cancel any "hide the toolbar" animation which is in progress, and make
// the toolbar hide immediately.
@ -195,8 +193,7 @@ var FullScreen = {
gBrowser.tabContainer.removeEventListener("TabOpen", this.exitDomFullScreen);
gBrowser.tabContainer.removeEventListener("TabClose", this.exitDomFullScreen);
gBrowser.tabContainer.removeEventListener("TabSelect", this.exitDomFullScreen);
if (!this.useLionFullScreen)
window.removeEventListener("activate", this);
window.removeEventListener("activate", this);
document.documentElement.removeAttribute("inDOMFullscreen");
this.showNavToolbox();

Просмотреть файл

@ -506,7 +506,7 @@ class Automation(object):
env['XRE_NO_WINDOWS_CRASH_DIALOG'] = '1'
# Set WebRTC logging in case it is not set yet
env.setdefault('NSPR_LOG_MODULES', 'signaling:5,mtransport:5,datachannel:5,jsep:5,MediaPipelineFactory:5')
env.setdefault('NSPR_LOG_MODULES', 'signaling:3,mtransport:4,datachannel:4,jsep:4,MediaPipelineFactory:4')
env.setdefault('R_LOG_LEVEL', '6')
env.setdefault('R_LOG_DESTINATION', 'stderr')
env.setdefault('R_LOG_VERBOSE', '1')

Просмотреть файл

@ -347,7 +347,7 @@ def environment(xrePath, env=None, crashreporter=True, debugger=False, dmdPath=N
env.setdefault('MOZ_DISABLE_NONLOCAL_CONNECTIONS', '1')
# Set WebRTC logging in case it is not set yet
env.setdefault('NSPR_LOG_MODULES', 'signaling:5,mtransport:5,datachannel:5,jsep:5,MediaPipelineFactory:5')
env.setdefault('NSPR_LOG_MODULES', 'signaling:3,mtransport:4,datachannel:4,jsep:4,MediaPipelineFactory:4')
env.setdefault('R_LOG_LEVEL', '6')
env.setdefault('R_LOG_DESTINATION', 'stderr')
env.setdefault('R_LOG_VERBOSE', '1')

Просмотреть файл

@ -926,7 +926,7 @@ nsDocShell::nsDocShell()
gDocShellLeakLog = PR_NewLogModule("nsDocShellLeak");
}
if (gDocShellLeakLog) {
MOZ_LOG(gDocShellLeakLog, PR_LOG_DEBUG, ("DOCSHELL %p created\n", this));
MOZ_LOG(gDocShellLeakLog, LogLevel::Debug, ("DOCSHELL %p created\n", this));
}
#ifdef DEBUG
@ -958,7 +958,7 @@ nsDocShell::~nsDocShell()
}
if (gDocShellLeakLog) {
MOZ_LOG(gDocShellLeakLog, PR_LOG_DEBUG, ("DOCSHELL %p destroyed\n", this));
MOZ_LOG(gDocShellLeakLog, LogLevel::Debug, ("DOCSHELL %p destroyed\n", this));
}
#ifdef DEBUG
@ -1095,7 +1095,7 @@ nsDocShell::GetInterface(const nsIID& aIID, void** aSink)
}
#if defined(DEBUG)
MOZ_LOG(gDocShellLog, PR_LOG_DEBUG,
MOZ_LOG(gDocShellLog, LogLevel::Debug,
("nsDocShell[%p]: returning app cache container %p",
this, domDoc.get()));
#endif
@ -1418,10 +1418,10 @@ nsDocShell::LoadURI(nsIURI* aURI,
}
#if defined(DEBUG)
if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) {
nsAutoCString uristr;
aURI->GetAsciiSpec(uristr);
MOZ_LOG(gDocShellLog, PR_LOG_DEBUG,
MOZ_LOG(gDocShellLog, LogLevel::Debug,
("nsDocShell[%p]: loading %s with flags 0x%08x",
this, uristr.get(), aLoadFlags));
}
@ -1540,7 +1540,7 @@ nsDocShell::LoadURI(nsIURI* aURI,
if (shEntry) {
#ifdef DEBUG
MOZ_LOG(gDocShellLog, PR_LOG_DEBUG,
MOZ_LOG(gDocShellLog, LogLevel::Debug,
("nsDocShell[%p]: loading from session history", this));
#endif
@ -1980,7 +1980,7 @@ bool
nsDocShell::SetCurrentURI(nsIURI* aURI, nsIRequest* aRequest,
bool aFireOnLocationChange, uint32_t aLocationFlags)
{
if (gDocShellLeakLog && PR_LOG_TEST(gDocShellLeakLog, PR_LOG_DEBUG)) {
if (gDocShellLeakLog && MOZ_LOG_TEST(gDocShellLeakLog, LogLevel::Debug)) {
nsAutoCString spec;
if (aURI) {
aURI->GetSpec(spec);
@ -5303,7 +5303,7 @@ nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL,
nsIChannel* aFailedChannel)
{
#if defined(DEBUG)
if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) {
nsAutoCString spec;
aURI->GetSpec(spec);
@ -5314,7 +5314,7 @@ nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL,
chanName.AssignLiteral("<no channel>");
}
MOZ_LOG(gDocShellLog, PR_LOG_DEBUG,
MOZ_LOG(gDocShellLog, LogLevel::Debug,
("nsDocShell[%p]::LoadErrorPage(\"%s\", \"%s\", {...}, [%s])\n", this,
spec.get(), NS_ConvertUTF16toUTF8(aURL).get(), chanName.get()));
}
@ -9605,7 +9605,7 @@ nsDocShell::InternalLoad(nsIURI* aURI,
nsresult rv = NS_OK;
mOriginalUriString.Truncate();
if (gDocShellLeakLog && PR_LOG_TEST(gDocShellLeakLog, PR_LOG_DEBUG)) {
if (gDocShellLeakLog && MOZ_LOG_TEST(gDocShellLeakLog, LogLevel::Debug)) {
nsAutoCString spec;
if (aURI) {
aURI->GetSpec(spec);
@ -11157,7 +11157,7 @@ nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel, nsISupports* aOwner,
NS_PRECONDITION(!aChannel || !aOwner, "Shouldn't have both set");
#if defined(DEBUG)
if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) {
nsAutoCString spec;
aURI->GetSpec(spec);
@ -11168,7 +11168,7 @@ nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel, nsISupports* aOwner,
chanName.AssignLiteral("<no channel>");
}
MOZ_LOG(gDocShellLog, PR_LOG_DEBUG,
MOZ_LOG(gDocShellLog, LogLevel::Debug,
("nsDocShell[%p]::OnNewURI(\"%s\", [%s], 0x%x)\n", this, spec.get(),
chanName.get(), aLoadType));
}
@ -11233,7 +11233,7 @@ nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel, nsISupports* aOwner,
// XXX This log message is almost useless because |updateSHistory|
// and |updateGHistory| are not correct at this point.
MOZ_LOG(gDocShellLog, PR_LOG_DEBUG,
MOZ_LOG(gDocShellLog, LogLevel::Debug,
(" shAvailable=%i updateSHistory=%i updateGHistory=%i"
" equalURI=%i\n",
shAvailable, updateSHistory, updateGHistory, equalUri));
@ -11777,7 +11777,7 @@ nsDocShell::AddToSessionHistory(nsIURI* aURI, nsIChannel* aChannel,
NS_PRECONDITION(!aChannel || !aOwner, "Shouldn't have both set");
#if defined(DEBUG)
if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) {
nsAutoCString spec;
aURI->GetSpec(spec);
@ -11788,7 +11788,7 @@ nsDocShell::AddToSessionHistory(nsIURI* aURI, nsIChannel* aChannel,
chanName.AssignLiteral("<no channel>");
}
MOZ_LOG(gDocShellLog, PR_LOG_DEBUG,
MOZ_LOG(gDocShellLog, LogLevel::Debug,
("nsDocShell[%p]::AddToSessionHistory(\"%s\", [%s])\n",
this, spec.get(), chanName.get()));
}

Просмотреть файл

@ -68,7 +68,7 @@ GetSHistoryLog()
}
return sLog;
}
#define LOG(format) MOZ_LOG(GetSHistoryLog(), PR_LOG_DEBUG, format)
#define LOG(format) MOZ_LOG(GetSHistoryLog(), mozilla::LogLevel::Debug, format)
// This macro makes it easier to print a log message which includes a URI's
// spec. Example use:
@ -78,7 +78,7 @@ GetSHistoryLog()
//
#define LOG_SPEC(format, uri) \
PR_BEGIN_MACRO \
if (PR_LOG_TEST(GetSHistoryLog(), PR_LOG_DEBUG)) { \
if (MOZ_LOG_TEST(GetSHistoryLog(), LogLevel::Debug)) { \
nsAutoCString _specStr(NS_LITERAL_CSTRING("(null)"));\
if (uri) { \
uri->GetSpec(_specStr); \
@ -96,7 +96,7 @@ GetSHistoryLog()
//
#define LOG_SHENTRY_SPEC(format, shentry) \
PR_BEGIN_MACRO \
if (PR_LOG_TEST(GetSHistoryLog(), PR_LOG_DEBUG)) { \
if (MOZ_LOG_TEST(GetSHistoryLog(), LogLevel::Debug)) { \
nsCOMPtr<nsIURI> uri; \
shentry->GetURI(getter_AddRefs(uri)); \
LOG_SPEC(format, uri); \

Просмотреть файл

@ -23,7 +23,7 @@ NS_IMPL_ISUPPORTS(ThirdPartyUtil, mozIThirdPartyUtil)
//
static PRLogModuleInfo *gThirdPartyLog;
#undef LOG
#define LOG(args) MOZ_LOG(gThirdPartyLog, PR_LOG_DEBUG, args)
#define LOG(args) MOZ_LOG(gThirdPartyLog, mozilla::LogLevel::Debug, args)
nsresult
ThirdPartyUtil::Init()

Просмотреть файл

@ -188,7 +188,7 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod,
#define LOG_CHECK(logType) \
PR_BEGIN_MACRO \
/* skip all this nonsense if the call failed or logging is disabled */ \
if (NS_SUCCEEDED(rv) && PR_LOG_TEST(gConPolLog, PR_LOG_DEBUG)) { \
if (NS_SUCCEEDED(rv) && MOZ_LOG_TEST(gConPolLog, LogLevel::Debug)) { \
const char *resultName; \
if (decision) { \
resultName = NS_CP_ResponseName(*decision); \
@ -203,7 +203,7 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod,
if (requestingLocation) { \
requestingLocation->GetSpec(refSpec); \
} \
MOZ_LOG(gConPolLog, PR_LOG_DEBUG, \
MOZ_LOG(gConPolLog, LogLevel::Debug, \
("Content Policy: " logType ": <%s> <Ref:%s> result=%s", \
spec.get(), refSpec.get(), resultName) \
); \

Просмотреть файл

@ -11,7 +11,7 @@
extern PRLogModuleInfo* GetDataChannelLog();
#undef LOG
#define LOG(args) MOZ_LOG(GetDataChannelLog(), PR_LOG_DEBUG, args)
#define LOG(args) MOZ_LOG(GetDataChannelLog(), mozilla::LogLevel::Debug, args)
#include "nsDOMDataChannelDeclarations.h"

Просмотреть файл

@ -1595,7 +1595,7 @@ nsDocument::nsDocument(const char* aContentType)
gDocumentLeakPRLog = PR_NewLogModule("DocumentLeak");
if (gDocumentLeakPRLog)
MOZ_LOG(gDocumentLeakPRLog, PR_LOG_DEBUG,
MOZ_LOG(gDocumentLeakPRLog, LogLevel::Debug,
("DOCUMENT %p created", this));
if (!gCspPRLog)
@ -1639,7 +1639,7 @@ nsIDocument::~nsIDocument()
nsDocument::~nsDocument()
{
if (gDocumentLeakPRLog)
MOZ_LOG(gDocumentLeakPRLog, PR_LOG_DEBUG,
MOZ_LOG(gDocumentLeakPRLog, LogLevel::Debug,
("DOCUMENT %p destroyed", this));
NS_ASSERTION(!mIsShowing, "Destroying a currently-showing document");
@ -2305,7 +2305,7 @@ nsDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup,
{
NS_PRECONDITION(aURI, "Null URI passed to ResetToURI");
if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) {
if (gDocumentLeakPRLog && MOZ_LOG_TEST(gDocumentLeakPRLog, LogLevel::Debug)) {
nsAutoCString spec;
aURI->GetSpec(spec);
PR_LogPrint("DOCUMENT %p ResetToURI %s", this, spec.get());
@ -2638,7 +2638,7 @@ nsDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel,
nsIStreamListener **aDocListener,
bool aReset, nsIContentSink* aSink)
{
if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) {
if (gDocumentLeakPRLog && MOZ_LOG_TEST(gDocumentLeakPRLog, LogLevel::Debug)) {
nsCOMPtr<nsIURI> uri;
aChannel->GetURI(getter_AddRefs(uri));
nsAutoCString spec;
@ -2773,7 +2773,7 @@ AppendCSPFromHeader(nsIContentSecurityPolicy* csp,
rv = csp->AppendPolicy(policy, aReportOnly);
NS_ENSURE_SUCCESS(rv, rv);
{
MOZ_LOG(gCspPRLog, PR_LOG_DEBUG,
MOZ_LOG(gCspPRLog, LogLevel::Debug,
("CSP refined with policy: \"%s\"",
NS_ConvertUTF16toUTF8(policy).get()));
}
@ -2813,7 +2813,7 @@ nsDocument::InitCSP(nsIChannel* aChannel)
{
nsCOMPtr<nsIContentSecurityPolicy> csp;
if (!CSPService::sCSPEnabled) {
MOZ_LOG(gCspPRLog, PR_LOG_DEBUG,
MOZ_LOG(gCspPRLog, LogLevel::Debug,
("CSP is disabled, skipping CSP init for document %p", this));
return NS_OK;
}
@ -2866,12 +2866,12 @@ nsDocument::InitCSP(nsIChannel* aChannel)
!applyLoopCSP &&
cspHeaderValue.IsEmpty() &&
cspROHeaderValue.IsEmpty()) {
if (PR_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gCspPRLog, LogLevel::Debug)) {
nsCOMPtr<nsIURI> chanURI;
aChannel->GetURI(getter_AddRefs(chanURI));
nsAutoCString aspec;
chanURI->GetAsciiSpec(aspec);
MOZ_LOG(gCspPRLog, PR_LOG_DEBUG,
MOZ_LOG(gCspPRLog, LogLevel::Debug,
("no CSP for document, %s, %s",
aspec.get(),
applyAppDefaultCSP ? "is app" : "not an app"));
@ -2880,7 +2880,7 @@ nsDocument::InitCSP(nsIChannel* aChannel)
return NS_OK;
}
MOZ_LOG(gCspPRLog, PR_LOG_DEBUG, ("Document is an app or CSP header specified %p", this));
MOZ_LOG(gCspPRLog, LogLevel::Debug, ("Document is an app or CSP header specified %p", this));
nsresult rv;
@ -2899,7 +2899,7 @@ nsDocument::InitCSP(nsIChannel* aChannel)
NS_ENSURE_SUCCESS(rv, rv);
if (csp) {
MOZ_LOG(gCspPRLog, PR_LOG_DEBUG, ("%s %s %s",
MOZ_LOG(gCspPRLog, LogLevel::Debug, ("%s %s %s",
"This document is sharing principal with another document.",
"Since the document is an app, CSP was already set.",
"Skipping attempt to set CSP."));
@ -2910,7 +2910,7 @@ nsDocument::InitCSP(nsIChannel* aChannel)
csp = do_CreateInstance("@mozilla.org/cspcontext;1", &rv);
if (NS_FAILED(rv)) {
MOZ_LOG(gCspPRLog, PR_LOG_DEBUG, ("Failed to create CSP object: %x", rv));
MOZ_LOG(gCspPRLog, LogLevel::Debug, ("Failed to create CSP object: %x", rv));
return rv;
}
@ -2963,7 +2963,7 @@ nsDocument::InitCSP(nsIChannel* aChannel)
rv = csp->PermitsAncestry(docShell, &safeAncestry);
if (NS_FAILED(rv) || !safeAncestry) {
MOZ_LOG(gCspPRLog, PR_LOG_DEBUG,
MOZ_LOG(gCspPRLog, LogLevel::Debug,
("CSP doesn't like frame's ancestry, not loading."));
// stop! ERROR page!
aChannel->Cancel(NS_ERROR_CSP_FRAME_ANCESTOR_VIOLATION);
@ -2988,7 +2988,7 @@ nsDocument::InitCSP(nsIChannel* aChannel)
rv = principal->SetCsp(csp);
NS_ENSURE_SUCCESS(rv, rv);
MOZ_LOG(gCspPRLog, PR_LOG_DEBUG,
MOZ_LOG(gCspPRLog, LogLevel::Debug,
("Inserted CSP into principal %p", principal));
return NS_OK;

Просмотреть файл

@ -77,16 +77,16 @@ using namespace mozilla::widget;
PRLogModuleInfo* gFocusLog;
PRLogModuleInfo* gFocusNavigationLog;
#define LOGFOCUS(args) MOZ_LOG(gFocusLog, PR_LOG_DEBUG, args)
#define LOGFOCUSNAVIGATION(args) MOZ_LOG(gFocusNavigationLog, PR_LOG_DEBUG, args)
#define LOGFOCUS(args) MOZ_LOG(gFocusLog, mozilla::LogLevel::Debug, args)
#define LOGFOCUSNAVIGATION(args) MOZ_LOG(gFocusNavigationLog, mozilla::LogLevel::Debug, args)
#define LOGTAG(log, format, content) \
if (PR_LOG_TEST(log, PR_LOG_DEBUG)) { \
if (MOZ_LOG_TEST(log, LogLevel::Debug)) { \
nsAutoCString tag(NS_LITERAL_CSTRING("(none)")); \
if (content) { \
content->NodeInfo()->NameAtom()->ToUTF8String(tag); \
} \
MOZ_LOG(log, PR_LOG_DEBUG, (format, tag.get())); \
MOZ_LOG(log, LogLevel::Debug, (format, tag.get())); \
}
#define LOGCONTENT(format, content) LOGTAG(gFocusLog, format, content)
@ -482,7 +482,7 @@ nsFocusManager::MoveFocus(nsIDOMWindow* aWindow, nsIDOMElement* aStartElement,
LOGFOCUS(("<<MoveFocus begin Type: %d Flags: %x>>", aType, aFlags));
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG) && mFocusedWindow) {
if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug) && mFocusedWindow) {
nsIDocument* doc = mFocusedWindow->GetExtantDoc();
if (doc && doc->GetDocumentURI()) {
nsAutoCString spec;
@ -638,7 +638,7 @@ nsFocusManager::WindowRaised(nsIDOMWindow* aWindow)
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aWindow);
NS_ENSURE_TRUE(window && window->IsOuterWindow(), NS_ERROR_INVALID_ARG);
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) {
LOGFOCUS(("Window %p Raised [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get()));
nsAutoCString spec;
nsIDocument* doc = window->GetExtantDoc();
@ -734,7 +734,7 @@ nsFocusManager::WindowLowered(nsIDOMWindow* aWindow)
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aWindow);
NS_ENSURE_TRUE(window && window->IsOuterWindow(), NS_ERROR_INVALID_ARG);
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) {
LOGFOCUS(("Window %p Lowered [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get()));
nsAutoCString spec;
nsIDocument* doc = window->GetExtantDoc();
@ -852,7 +852,7 @@ nsFocusManager::WindowShown(nsIDOMWindow* aWindow, bool aNeedsFocus)
window = window->GetOuterWindow();
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) {
LOGFOCUS(("Window %p Shown [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get()));
nsAutoCString spec;
nsIDocument* doc = window->GetExtantDoc();
@ -907,7 +907,7 @@ nsFocusManager::WindowHidden(nsIDOMWindow* aWindow)
window = window->GetOuterWindow();
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) {
LOGFOCUS(("Window %p Hidden [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get()));
nsAutoCString spec;
nsIDocument* doc = window->GetExtantDoc();
@ -1777,7 +1777,7 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow,
LOGCONTENT("Element %s has been focused", aContent);
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) {
nsIDocument* docm = aWindow->GetExtantDoc();
if (docm) {
LOGCONTENT(" from %s", docm->GetRootElement());

Просмотреть файл

@ -1211,7 +1211,7 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow)
#endif
if (gDOMLeakPRLog)
MOZ_LOG(gDOMLeakPRLog, PR_LOG_DEBUG,
MOZ_LOG(gDOMLeakPRLog, LogLevel::Debug,
("DOMWINDOW %p created outer=%p", this, aOuterWindow));
NS_ASSERTION(sWindowsById, "Windows hash table must be created!");
@ -1301,7 +1301,7 @@ nsGlobalWindow::~nsGlobalWindow()
#endif
if (gDOMLeakPRLog)
MOZ_LOG(gDOMLeakPRLog, PR_LOG_DEBUG,
MOZ_LOG(gDOMLeakPRLog, LogLevel::Debug,
("DOMWINDOW %p destroyed", this));
if (IsOuterWindow()) {
@ -2804,7 +2804,7 @@ nsGlobalWindow::InnerSetNewDocument(JSContext* aCx, nsIDocument* aDocument)
NS_PRECONDITION(IsInnerWindow(), "Must only be called on inner windows");
MOZ_ASSERT(aDocument);
if (gDOMLeakPRLog && PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
if (gDOMLeakPRLog && MOZ_LOG_TEST(gDOMLeakPRLog, LogLevel::Debug)) {
nsIURI *uri = aDocument->GetDocumentURI();
nsAutoCString spec;
if (uri)
@ -6046,16 +6046,17 @@ nsGlobalWindow::SetFullScreen(bool aFullScreen)
}
nsresult
nsGlobalWindow::SetFullScreenInternal(bool aFullScreen, bool aRequireTrust, gfx::VRHMDInfo* aHMD)
nsGlobalWindow::SetFullScreenInternal(bool aFullScreen, bool aFullscreenMode,
gfx::VRHMDInfo* aHMD)
{
MOZ_ASSERT(IsOuterWindow());
NS_ENSURE_TRUE(mDocShell, NS_ERROR_FAILURE);
// Only chrome can change our fullScreen mode, unless we're running in
// untrusted mode.
// Only chrome can change our fullscreen mode. Otherwise, the state
// can only be changed for DOM fullscreen.
if (aFullScreen == FullScreen() ||
(aRequireTrust && !nsContentUtils::IsCallerChrome())) {
(aFullscreenMode && !nsContentUtils::IsCallerChrome())) {
return NS_OK;
}
@ -6068,7 +6069,7 @@ nsGlobalWindow::SetFullScreenInternal(bool aFullScreen, bool aRequireTrust, gfx:
if (!window)
return NS_ERROR_FAILURE;
if (rootItem != mDocShell)
return window->SetFullScreenInternal(aFullScreen, aRequireTrust, aHMD);
return window->SetFullScreenInternal(aFullScreen, aFullscreenMode, aHMD);
// make sure we don't try to set full screen on a non-chrome window,
// which might happen in embedding world
@ -6079,12 +6080,10 @@ nsGlobalWindow::SetFullScreenInternal(bool aFullScreen, bool aRequireTrust, gfx:
if (mFullScreen == aFullScreen)
return NS_OK;
// If a fullscreen is originated from chrome, we are switching to
// the fullscreen mode, otherwise, we are entering DOM fullscreen.
// Note that although entering DOM fullscreen could also cause
// consequential calls to this method, those calls will be skipped
// at the condition above.
if (aRequireTrust) {
if (aFullscreenMode) {
mFullscreenMode = aFullScreen;
} else {
// If we are exiting from DOM fullscreen while we
@ -6124,6 +6123,9 @@ nsGlobalWindow::SetFullScreenInternal(bool aFullScreen, bool aRequireTrust, gfx:
if (aHMD) {
screen = aHMD->GetScreen();
}
if (!aFullscreenMode) {
widget->PrepareForDOMFullscreenTransition();
}
widget->MakeFullScreen(aFullScreen, screen);
}
}
@ -10558,7 +10560,7 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
}
if (mSessionStorage) {
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gDOMLeakPRLog, LogLevel::Debug)) {
PR_LogPrint("nsGlobalWindow %p has %p sessionStorage", this, mSessionStorage.get());
}
bool canAccess = mSessionStorage->CanAccess(principal);
@ -10609,7 +10611,7 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
mSessionStorage = static_cast<DOMStorage*>(storage.get());
MOZ_ASSERT(mSessionStorage);
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gDOMLeakPRLog, LogLevel::Debug)) {
PR_LogPrint("nsGlobalWindow %p tried to get a new sessionStorage %p", this, mSessionStorage.get());
}
@ -10619,7 +10621,7 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
}
}
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gDOMLeakPRLog, LogLevel::Debug)) {
PR_LogPrint("nsGlobalWindow %p returns %p sessionStorage", this, mSessionStorage.get());
}
@ -11537,7 +11539,7 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic,
return NS_OK;
}
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gDOMLeakPRLog, LogLevel::Debug)) {
PR_LogPrint("nsGlobalWindow %p with sessionStorage %p passing event from %p",
this, mSessionStorage.get(), changingStorage.get());
}

Просмотреть файл

@ -490,7 +490,7 @@ public:
virtual void RefreshCompartmentPrincipal() override;
// Outer windows only.
virtual nsresult SetFullScreenInternal(bool aIsFullScreen, bool aRequireTrust,
virtual nsresult SetFullScreenInternal(bool aIsFullscreen, bool aFullscreenMode,
mozilla::gfx::VRHMDInfo *aHMD = nullptr) override;
bool FullScreen() const;

Просмотреть файл

@ -119,7 +119,7 @@ nsNodeInfoManager::nsNodeInfoManager()
gNodeInfoManagerLeakPRLog = PR_NewLogModule("NodeInfoManagerLeak");
if (gNodeInfoManagerLeakPRLog)
MOZ_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
MOZ_LOG(gNodeInfoManagerLeakPRLog, LogLevel::Debug,
("NODEINFOMANAGER %p created", this));
mNodeInfoHash = PL_NewHashTable(32, GetNodeInfoInnerHashValue,
@ -139,7 +139,7 @@ nsNodeInfoManager::~nsNodeInfoManager()
mBindingManager = nullptr;
if (gNodeInfoManagerLeakPRLog)
MOZ_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
MOZ_LOG(gNodeInfoManagerLeakPRLog, LogLevel::Debug,
("NODEINFOMANAGER %p destroyed", this));
nsLayoutStatics::Release();
@ -196,7 +196,7 @@ nsNodeInfoManager::Init(nsIDocument *aDocument)
mDocument = aDocument;
if (gNodeInfoManagerLeakPRLog)
MOZ_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
MOZ_LOG(gNodeInfoManagerLeakPRLog, LogLevel::Debug,
("NODEINFOMANAGER %p Init document=%p", this, aDocument));
return NS_OK;

Просмотреть файл

@ -116,8 +116,8 @@ GetObjectLog()
return sLog;
}
#define LOG(args) MOZ_LOG(GetObjectLog(), PR_LOG_DEBUG, args)
#define LOG_ENABLED() PR_LOG_TEST(GetObjectLog(), PR_LOG_DEBUG)
#define LOG(args) MOZ_LOG(GetObjectLog(), mozilla::LogLevel::Debug, args)
#define LOG_ENABLED() MOZ_LOG_TEST(GetObjectLog(), mozilla::LogLevel::Debug)
static bool
IsJavaMIME(const nsACString & aMIMEType)

Просмотреть файл

@ -463,15 +463,16 @@ public:
/**
* Moves the top-level window into fullscreen mode if aIsFullScreen is true,
* otherwise exits fullscreen. If aRequireTrust is true, this method only
* changes window state in a context trusted for write.
* otherwise exits fullscreen. If aFullscreenMode is true, this method is
* called for fullscreen mode instead of DOM fullscreen, which means it can
* only change window state in a context trusted for write.
*
* If aHMD is not null, the window is made full screen on the given VR HMD
* device instead of its currrent display.
*
* Outer windows only.
*/
virtual nsresult SetFullScreenInternal(bool aIsFullScreen, bool aRequireTrust,
virtual nsresult SetFullScreenInternal(bool aIsFullscreen, bool aFullscreenMode,
mozilla::gfx::VRHMDInfo *aHMD = nullptr) = 0;
/**

Просмотреть файл

@ -2408,16 +2408,6 @@ IsInCertifiedApp(JSContext* aCx, JSObject* aObj)
Preferences::GetBool("dom.ignore_webidl_scope_checks", false);
}
#ifdef DEBUG
void
VerifyTraceProtoAndIfaceCacheCalled(JS::CallbackTracer *trc, void **thingp,
JS::TraceKind kind)
{
// We don't do anything here, we only want to verify that
// TraceProtoAndIfaceCache was called.
}
#endif
void
FinalizeGlobal(JSFreeOp* aFreeOp, JSObject* aObj)
{

Просмотреть файл

@ -526,17 +526,20 @@ AllocateProtoAndIfaceCache(JSObject* obj, ProtoAndIfaceCache::Kind aKind)
}
#ifdef DEBUG
void
VerifyTraceProtoAndIfaceCacheCalled(JS::CallbackTracer *trc, void **thingp,
JS::TraceKind kind);
struct VerifyTraceProtoAndIfaceCacheCalledTracer : public JS::CallbackTracer
{
bool ok;
bool ok;
explicit VerifyTraceProtoAndIfaceCacheCalledTracer(JSRuntime *rt)
: JS::CallbackTracer(rt, VerifyTraceProtoAndIfaceCacheCalled), ok(false)
{}
explicit VerifyTraceProtoAndIfaceCacheCalledTracer(JSRuntime *rt)
: JS::CallbackTracer(rt), ok(false)
{}
void trace(void** thingp, JS::TraceKind kind) override {
// We don't do anything here, we only want to verify that
// TraceProtoAndIfaceCache was called.
}
TracerKind getTracerKind() const override { return TracerKind::VerifyTraceProtoAndIface; }
};
#endif
@ -547,8 +550,8 @@ TraceProtoAndIfaceCache(JSTracer* trc, JSObject* obj)
#ifdef DEBUG
if (trc->isCallbackTracer() &&
trc->asCallbackTracer()->hasCallback(
VerifyTraceProtoAndIfaceCacheCalled)) {
(trc->asCallbackTracer()->getTracerKind() ==
JS::CallbackTracer::TracerKind::VerifyTraceProtoAndIface)) {
// We don't do anything here, we only want to verify that
// TraceProtoAndIfaceCache was called.
static_cast<VerifyTraceProtoAndIfaceCacheCalledTracer*>(trc)->ok = true;

Просмотреть файл

@ -18,9 +18,9 @@
#include "mozilla/Logging.h"
extern PRLogModuleInfo* GetCameraLog();
#define DOM_CAMERA_LOG( type, ... ) MOZ_LOG(GetCameraLog(), (PRLogModuleLevel)type, ( __VA_ARGS__ ))
#define DOM_CAMERA_LOG( type, ... ) MOZ_LOG(GetCameraLog(), (mozilla::LogLevel)type, ( __VA_ARGS__ ))
#define DOM_CAMERA_LOGA( ... ) DOM_CAMERA_LOG( 0, __VA_ARGS__ )
#define DOM_CAMERA_LOGA( ... ) DOM_CAMERA_LOG( mozilla::LogLevel::Error, __VA_ARGS__ )
/**
* From the least to the most output.

Просмотреть файл

@ -1067,9 +1067,14 @@ ContentEventHandler::OnQueryCaretRect(WidgetQueryContentEvent* aEvent)
&aEvent->mReply.mOffset);
NS_ENSURE_SUCCESS(rv, rv);
rv = AdjustCollapsedRangeMaybeIntoTextNode(range);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
int32_t xpOffsetInFrame;
nsIFrame* frame;
rv = GetStartFrameAndOffset(range, &frame, &xpOffsetInFrame);
rv = GetStartFrameAndOffset(range, frame, xpOffsetInFrame);
NS_ENSURE_SUCCESS(rv, rv);
nsPoint posInFrame;
@ -1359,25 +1364,80 @@ ContentEventHandler::GetFlatTextOffsetOfRange(nsIContent* aRootContent,
}
nsresult
ContentEventHandler::GetStartFrameAndOffset(nsRange* aRange,
nsIFrame** aFrame,
int32_t* aOffsetInFrame)
ContentEventHandler::AdjustCollapsedRangeMaybeIntoTextNode(nsRange* aRange)
{
NS_ASSERTION(aRange && aFrame && aOffsetInFrame, "params are invalid");
MOZ_ASSERT(aRange);
MOZ_ASSERT(aRange->Collapsed());
nsIContent* content = nullptr;
nsINode* node = aRange->GetStartParent();
if (node && node->IsNodeOfType(nsINode::eCONTENT)) {
content = static_cast<nsIContent*>(node);
if (!aRange || !aRange->Collapsed()) {
return NS_ERROR_INVALID_ARG;
}
NS_ASSERTION(content, "the start node doesn't have nsIContent!");
nsCOMPtr<nsINode> parentNode = aRange->GetStartParent();
int32_t offsetInParentNode = aRange->StartOffset();
if (NS_WARN_IF(!parentNode) || NS_WARN_IF(offsetInParentNode < 0)) {
return NS_ERROR_INVALID_ARG;
}
// If the node is text node, we don't need to modify aRange.
if (parentNode->IsNodeOfType(nsINode::eTEXT)) {
return NS_OK;
}
// If the parent is not a text node but it has a text node at the offset,
// we should adjust the range into the text node.
// NOTE: This is emulating similar situation of nsEditor.
nsINode* childNode = nullptr;
int32_t offsetInChildNode = -1;
if (!offsetInParentNode && parentNode->HasChildren()) {
// If the range is the start of the parent, adjusted the range to the
// start of the first child.
childNode = parentNode->GetFirstChild();
offsetInChildNode = 0;
} else if (static_cast<uint32_t>(offsetInParentNode) <
parentNode->GetChildCount()) {
// If the range is next to a child node, adjust the range to the end of
// the previous child.
childNode = parentNode->GetChildAt(offsetInParentNode - 1);
offsetInChildNode = childNode->Length();
}
// But if the found node isn't a text node, we cannot modify the range.
if (!childNode || !childNode->IsNodeOfType(nsINode::eTEXT) ||
NS_WARN_IF(offsetInChildNode < 0)) {
return NS_OK;
}
nsresult rv = aRange->Set(childNode, offsetInChildNode,
childNode, offsetInChildNode);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
return NS_OK;
}
nsresult
ContentEventHandler::GetStartFrameAndOffset(const nsRange* aRange,
nsIFrame*& aFrame,
int32_t& aOffsetInFrame)
{
MOZ_ASSERT(aRange);
aFrame = nullptr;
aOffsetInFrame = -1;
nsINode* node = aRange->GetStartParent();
if (NS_WARN_IF(!node) ||
NS_WARN_IF(!node->IsNodeOfType(nsINode::eCONTENT))) {
return NS_ERROR_FAILURE;
}
nsIContent* content = static_cast<nsIContent*>(node);
nsRefPtr<nsFrameSelection> fs = mPresShell->FrameSelection();
*aFrame = fs->GetFrameForNodeOffset(content, aRange->StartOffset(),
fs->GetHint(), aOffsetInFrame);
NS_ENSURE_TRUE((*aFrame), NS_ERROR_FAILURE);
NS_ASSERTION((*aFrame)->GetType() == nsGkAtoms::textFrame,
"The frame is not textframe");
aFrame = fs->GetFrameForNodeOffset(content, aRange->StartOffset(),
fs->GetHint(), &aOffsetInFrame);
if (NS_WARN_IF(!aFrame)) {
return NS_ERROR_FAILURE;
}
return NS_OK;
}

Просмотреть файл

@ -124,11 +124,13 @@ protected:
LineBreakType aLineBreakType,
bool aExpandToClusterBoundaries,
uint32_t* aNewOffset = nullptr);
// Find the first textframe for the range, and get the start offset in
// the frame.
nsresult GetStartFrameAndOffset(nsRange* aRange,
nsIFrame** aFrame,
int32_t* aOffsetInFrame);
// If the aRange isn't in text node but next to a text node, this method
// modifies it in the text node. Otherwise, not modified.
nsresult AdjustCollapsedRangeMaybeIntoTextNode(nsRange* aCollapsedRange);
// Find the first frame for the range and get the start offset in it.
nsresult GetStartFrameAndOffset(const nsRange* aRange,
nsIFrame*& aFrame,
int32_t& aOffsetInFrame);
// Convert the frame relative offset to the root view relative offset.
nsresult ConvertToRootViewRelativeOffset(nsIFrame* aFrame,
nsRect& aRect);

Просмотреть файл

@ -43,16 +43,16 @@ using namespace widget;
/**
* When a method is called, log its arguments and/or related static variables
* with PR_LOG_ALWAYS. However, if it puts too many logs like
* with LogLevel::Info. However, if it puts too many logs like
* OnDestroyPresContext(), should long only when the method actually does
* something. In this case, the log should start with "ISM: <method name>".
*
* When a method quits due to unexpected situation, log the reason with
* PR_LOG_ERROR. In this case, the log should start with
* LogLevel::Error. In this case, the log should start with
* "ISM: <method name>(), FAILED". The indent makes the log look easier.
*
* When a method does something only in some situations and it may be important
* for debug, log the information with PR_LOG_DEBUG. In this case, the log
* for debug, log the information with LogLevel::Debug. In this case, the log
* should start with "ISM: <method name>(),".
*/
PRLogModuleInfo* sISMLog = nullptr;
@ -200,7 +200,7 @@ IMEStateManager::Init()
void
IMEStateManager::Shutdown()
{
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::Shutdown(), "
"sTextCompositions=0x%p, sTextCompositions->Length()=%u",
sTextCompositions, sTextCompositions ? sTextCompositions->Length() : 0));
@ -221,7 +221,7 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
TextCompositionArray::index_type i =
sTextCompositions->IndexOf(aPresContext);
if (i != TextCompositionArray::NoIndex) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnDestroyPresContext(), "
"removing TextComposition instance from the array (index=%u)", i));
// there should be only one composition per presContext object.
@ -229,7 +229,7 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
sTextCompositions->RemoveElementAt(i);
if (sTextCompositions->IndexOf(aPresContext) !=
TextCompositionArray::NoIndex) {
MOZ_LOG(sISMLog, PR_LOG_ERROR,
MOZ_LOG(sISMLog, LogLevel::Error,
("ISM: IMEStateManager::OnDestroyPresContext(), FAILED to remove "
"TextComposition instance from the array"));
MOZ_CRASH("Failed to remove TextComposition instance from the array");
@ -241,7 +241,7 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
return NS_OK;
}
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnDestroyPresContext(aPresContext=0x%p), "
"sPresContext=0x%p, sContent=0x%p, sTextCompositions=0x%p",
aPresContext, sPresContext, sContent, sTextCompositions));
@ -273,7 +273,7 @@ IMEStateManager::OnRemoveContent(nsPresContext* aPresContext,
sTextCompositions->GetCompositionInContent(aPresContext, aContent);
if (compositionInContent) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnRemoveContent(), "
"composition is in the content"));
@ -296,7 +296,7 @@ IMEStateManager::OnRemoveContent(nsPresContext* aPresContext,
return NS_OK;
}
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnRemoveContent(aPresContext=0x%p, "
"aContent=0x%p), sPresContext=0x%p, sContent=0x%p, sTextCompositions=0x%p",
aPresContext, aContent, sPresContext, sContent, sTextCompositions));
@ -324,7 +324,7 @@ IMEStateManager::OnChangeFocus(nsPresContext* aPresContext,
nsIContent* aContent,
InputContextAction::Cause aCause)
{
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnChangeFocus(aPresContext=0x%p, "
"aContent=0x%p, aCause=%s)",
aPresContext, aContent, GetActionCauseName(aCause)));
@ -339,7 +339,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
nsIContent* aContent,
InputContextAction aAction)
{
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnChangeFocusInternal(aPresContext=0x%p, "
"aContent=0x%p, aAction={ mCause=%s, mFocusChange=%s }), "
"sPresContext=0x%p, sContent=0x%p, sActiveIMEContentObserver=0x%p",
@ -367,7 +367,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
}
if (!aPresContext) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnChangeFocusInternal(), "
"no nsPresContext is being activated"));
return NS_OK;
@ -377,7 +377,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
(sPresContext == aPresContext) ? oldWidget.get() :
aPresContext->GetRootWidget();
if (NS_WARN_IF(!widget)) {
MOZ_LOG(sISMLog, PR_LOG_ERROR,
MOZ_LOG(sISMLog, LogLevel::Error,
("ISM: IMEStateManager::OnChangeFocusInternal(), FAILED due to "
"no widget to manage its IME state"));
return NS_OK;
@ -395,7 +395,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
// on focus to the main process... but this cannot cause bugs like missed keypresses.
// (It just means a lot of needless IPC.)
if ((newState.mEnabled == IMEState::DISABLED) && TabParent::GetIMETabParent()) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnChangeFocusInternal(), "
"Parent process cancels to set DISABLED state because the content process "
"has IME focus and has already sets IME state"));
@ -410,7 +410,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
// we should do it.
InputContext context = widget->GetInputContext();
if (context.mIMEState.mEnabled == newState.mEnabled) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnChangeFocusInternal(), "
"neither focus nor IME state is changing"));
return NS_OK;
@ -449,7 +449,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
void
IMEStateManager::OnInstalledMenuKeyboardListener(bool aInstalling)
{
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnInstalledMenuKeyboardListener(aInstalling=%s), "
"sInstalledMenuKeyboardListener=%s",
GetBoolName(aInstalling), GetBoolName(sInstalledMenuKeyboardListener)));
@ -468,27 +468,27 @@ IMEStateManager::OnMouseButtonEventInEditor(nsPresContext* aPresContext,
nsIContent* aContent,
nsIDOMMouseEvent* aMouseEvent)
{
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnMouseButtonEventInEditor(aPresContext=0x%p, "
"aContent=0x%p, aMouseEvent=0x%p), sPresContext=0x%p, sContent=0x%p",
aPresContext, aContent, aMouseEvent, sPresContext, sContent));
if (sPresContext != aPresContext || sContent != aContent) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
"the mouse event isn't fired on the editor managed by ISM"));
return false;
}
if (!sActiveIMEContentObserver) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
"there is no active IMEContentObserver"));
return false;
}
if (!sActiveIMEContentObserver->IsManaging(aPresContext, aContent)) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
"the active IMEContentObserver isn't managing the editor"));
return false;
@ -497,7 +497,7 @@ IMEStateManager::OnMouseButtonEventInEditor(nsPresContext* aPresContext,
WidgetMouseEvent* internalEvent =
aMouseEvent->GetInternalNSEvent()->AsMouseEvent();
if (NS_WARN_IF(!internalEvent)) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
"the internal event of aMouseEvent isn't WidgetMouseEvent"));
return false;
@ -506,10 +506,10 @@ IMEStateManager::OnMouseButtonEventInEditor(nsPresContext* aPresContext,
bool consumed =
sActiveIMEContentObserver->OnMouseButtonEvent(aPresContext, internalEvent);
if (PR_LOG_TEST(sISMLog, PR_LOG_ALWAYS)) {
if (MOZ_LOG_TEST(sISMLog, LogLevel::Info)) {
nsAutoString eventType;
aMouseEvent->GetType(eventType);
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
"mouse event (type=%s, button=%d) is %s",
NS_ConvertUTF16toUTF8(eventType).get(), internalEvent->button,
@ -525,13 +525,13 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext,
nsIContent* aContent,
nsIDOMMouseEvent* aMouseEvent)
{
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnClickInEditor(aPresContext=0x%p, aContent=0x%p, "
"aMouseEvent=0x%p), sPresContext=0x%p, sContent=0x%p",
aPresContext, aContent, aMouseEvent, sPresContext, sContent));
if (sPresContext != aPresContext || sContent != aContent) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnClickInEditor(), "
"the mouse event isn't fired on the editor managed by ISM"));
return;
@ -544,7 +544,7 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext,
nsresult rv = aMouseEvent->GetIsTrusted(&isTrusted);
NS_ENSURE_SUCCESS_VOID(rv);
if (!isTrusted) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnClickInEditor(), "
"the mouse event isn't a trusted event"));
return; // ignore untrusted event.
@ -554,7 +554,7 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext,
rv = aMouseEvent->GetButton(&button);
NS_ENSURE_SUCCESS_VOID(rv);
if (button != 0) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnClickInEditor(), "
"the mouse event isn't a left mouse button event"));
return; // not a left click event.
@ -564,7 +564,7 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext,
rv = aMouseEvent->GetDetail(&clickCount);
NS_ENSURE_SUCCESS_VOID(rv);
if (clickCount != 1) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnClickInEditor(), "
"the mouse event isn't a single click event"));
return; // should notify only first click event.
@ -582,7 +582,7 @@ IMEStateManager::OnFocusInEditor(nsPresContext* aPresContext,
nsIContent* aContent,
nsIEditor* aEditor)
{
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnFocusInEditor(aPresContext=0x%p, aContent=0x%p, "
"aEditor=0x%p), sPresContext=0x%p, sContent=0x%p, "
"sActiveIMEContentObserver=0x%p",
@ -590,7 +590,7 @@ IMEStateManager::OnFocusInEditor(nsPresContext* aPresContext,
sActiveIMEContentObserver));
if (sPresContext != aPresContext || sContent != aContent) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnFocusInEditor(), "
"an editor not managed by ISM gets focus"));
return;
@ -600,7 +600,7 @@ IMEStateManager::OnFocusInEditor(nsPresContext* aPresContext,
// we need to recreate the instance.
if (sActiveIMEContentObserver) {
if (sActiveIMEContentObserver->IsManaging(aPresContext, aContent)) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnFocusInEditor(), "
"the editor is already being managed by sActiveIMEContentObserver"));
return;
@ -617,7 +617,7 @@ IMEStateManager::UpdateIMEState(const IMEState& aNewIMEState,
nsIContent* aContent,
nsIEditor* aEditor)
{
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::UpdateIMEState(aNewIMEState={ mEnabled=%s, "
"mOpen=%s }, aContent=0x%p, aEditor=0x%p), "
"sPresContext=0x%p, sContent=0x%p, sActiveIMEContentObserver=0x%p, "
@ -628,21 +628,21 @@ IMEStateManager::UpdateIMEState(const IMEState& aNewIMEState,
GetBoolName(sIsGettingNewIMEState)));
if (sIsGettingNewIMEState) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::UpdateIMEState(), "
"does nothing because of called while getting new IME state"));
return;
}
if (NS_WARN_IF(!sPresContext)) {
MOZ_LOG(sISMLog, PR_LOG_ERROR,
MOZ_LOG(sISMLog, LogLevel::Error,
("ISM: IMEStateManager::UpdateIMEState(), FAILED due to "
"no managing nsPresContext"));
return;
}
nsCOMPtr<nsIWidget> widget = sPresContext->GetRootWidget();
if (NS_WARN_IF(!widget)) {
MOZ_LOG(sISMLog, PR_LOG_ERROR,
MOZ_LOG(sISMLog, LogLevel::Error,
("ISM: IMEStateManager::UpdateIMEState(), FAILED due to "
"no widget for the managing nsPresContext"));
return;
@ -652,12 +652,12 @@ IMEStateManager::UpdateIMEState(const IMEState& aNewIMEState,
// editor with current editable root content due to reframed. In such case,
// We should try to reinitialize the IMEContentObserver.
if (sActiveIMEContentObserver && IsIMEObserverNeeded(aNewIMEState)) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::UpdateIMEState(), try to reinitialize the "
"active IMEContentObserver"));
if (!sActiveIMEContentObserver->MaybeReinitialize(widget, sPresContext,
aContent, aEditor)) {
PR_LOG(sISMLog, PR_LOG_ERROR,
MOZ_LOG(sISMLog, LogLevel::Error,
("ISM: IMEStateManager::UpdateIMEState(), failed to reinitialize the "
"active IMEContentObserver"));
}
@ -697,7 +697,7 @@ IMEState
IMEStateManager::GetNewIMEState(nsPresContext* aPresContext,
nsIContent* aContent)
{
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::GetNewIMEState(aPresContext=0x%p, aContent=0x%p), "
"sInstalledMenuKeyboardListener=%s",
aPresContext, aContent, GetBoolName(sInstalledMenuKeyboardListener)));
@ -705,14 +705,14 @@ IMEStateManager::GetNewIMEState(nsPresContext* aPresContext,
// On Printing or Print Preview, we don't need IME.
if (aPresContext->Type() == nsPresContext::eContext_PrintPreview ||
aPresContext->Type() == nsPresContext::eContext_Print) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::GetNewIMEState() returns DISABLED because "
"the nsPresContext is for print or print preview"));
return IMEState(IMEState::DISABLED);
}
if (sInstalledMenuKeyboardListener) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::GetNewIMEState() returns DISABLED because "
"menu keyboard listener was installed"));
return IMEState(IMEState::DISABLED);
@ -723,12 +723,12 @@ IMEStateManager::GetNewIMEState(nsPresContext* aPresContext,
// editable, such case is design mode.
nsIDocument* doc = aPresContext->Document();
if (doc && doc->HasFlag(NODE_IS_EDITABLE)) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::GetNewIMEState() returns ENABLED because "
"design mode editor has focus"));
return IMEState(IMEState::ENABLED);
}
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::GetNewIMEState() returns DISABLED because "
"no content has focus"));
return IMEState(IMEState::DISABLED);
@ -742,7 +742,7 @@ IMEStateManager::GetNewIMEState(nsPresContext* aPresContext,
GettingNewIMEStateBlocker blocker;
IMEState newIMEState = aContent->GetDesiredIMEState();
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::GetNewIMEState() returns { mEnabled=%s, "
"mOpen=%s }",
GetIMEStateEnabledName(newIMEState.mEnabled),
@ -763,7 +763,7 @@ public:
nsCOMPtr<nsIObserverService> observerService =
services::GetObserverService();
if (observerService) {
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEEnabledStateChangedEvent::Run(), notifies observers of "
"\"ime-enabled-state-changed\""));
nsAutoString state;
@ -785,7 +785,7 @@ IMEStateManager::SetIMEState(const IMEState& aState,
nsIWidget* aWidget,
InputContextAction aAction)
{
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::SetIMEState(aState={ mEnabled=%s, mOpen=%s }, "
"aContent=0x%p, aWidget=0x%p, aAction={ mCause=%s, mFocusChange=%s })",
GetIMEStateEnabledName(aState.mEnabled),
@ -871,7 +871,7 @@ IMEStateManager::SetIMEState(const IMEState& aState,
}
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::SetIMEState(), "
"calling nsIWidget::SetInputContext(context={ mIMEState={ mEnabled=%s, "
"mOpen=%s }, mHTMLInputType=\"%s\", mHTMLInputInputmode=\"%s\", "
@ -913,7 +913,7 @@ IMEStateManager::DispatchCompositionEvent(
EventDispatchingCallback* aCallBack,
bool aIsSynthesized)
{
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::DispatchCompositionEvent(aNode=0x%p, "
"aPresContext=0x%p, aCompositionEvent={ message=%s, "
"mFlags={ mIsTrusted=%s, mPropagationStopped=%s } }, "
@ -942,7 +942,7 @@ IMEStateManager::DispatchCompositionEvent(
if (NS_WARN_IF(aIsSynthesized)) {
return;
}
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::DispatchCompositionEvent(), "
"adding new TextComposition to the array"));
MOZ_ASSERT(aCompositionEvent->message == NS_COMPOSITION_START);
@ -978,7 +978,7 @@ IMEStateManager::DispatchCompositionEvent(
TextCompositionArray::index_type i =
sTextCompositions->IndexOf(aCompositionEvent->widget);
if (i != TextCompositionArray::NoIndex) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::DispatchCompositionEvent(), "
"removing TextComposition from the array since NS_COMPOSTION_END "
"was dispatched"));
@ -996,7 +996,7 @@ IMEStateManager::OnCompositionEventDiscarded(
// Note that this method is never called for synthesized events for emulating
// commit or cancel composition.
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnCompositionEventDiscarded(aCompositionEvent={ "
"message=%s, mFlags={ mIsTrusted=%s } })",
GetEventMessageName(aCompositionEvent->message),
@ -1019,7 +1019,7 @@ IMEStateManager::OnCompositionEventDiscarded(
// a TextComposition instance for the composition was already removed from
// the array and destroyed in OnDestroyPresContext(). Therefore, we may
// fail to retrieve a TextComposition instance here.
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnCompositionEventDiscarded(), "
"TextComposition instance for the widget has already gone"));
return;
@ -1040,14 +1040,14 @@ IMEStateManager::NotifyIME(IMEMessage aMessage,
bool isSynthesizedForTests =
composition && composition->IsSynthesizedForTests();
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::NotifyIME(aMessage=%s, aWidget=0x%p), "
"composition=0x%p, composition->IsSynthesizedForTests()=%s",
GetNotifyIMEMessageName(aMessage), aWidget, composition.get(),
GetBoolName(isSynthesizedForTests)));
if (NS_WARN_IF(!aWidget)) {
MOZ_LOG(sISMLog, PR_LOG_ERROR,
MOZ_LOG(sISMLog, LogLevel::Error,
("ISM: IMEStateManager::NotifyIME(), FAILED due to no widget"));
return NS_ERROR_INVALID_ARG;
}
@ -1075,7 +1075,7 @@ nsresult
IMEStateManager::NotifyIME(IMEMessage aMessage,
nsPresContext* aPresContext)
{
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::NotifyIME(aMessage=%s, aPresContext=0x%p)",
GetNotifyIMEMessageName(aMessage), aPresContext));
@ -1083,7 +1083,7 @@ IMEStateManager::NotifyIME(IMEMessage aMessage,
nsIWidget* widget = aPresContext->GetRootWidget();
if (NS_WARN_IF(!widget)) {
MOZ_LOG(sISMLog, PR_LOG_ERROR,
MOZ_LOG(sISMLog, LogLevel::Error,
("ISM: IMEStateManager::NotifyIME(), FAILED due to no widget for the "
"nsPresContext"));
return NS_ERROR_NOT_AVAILABLE;
@ -1150,18 +1150,18 @@ IMEStateManager::IsIMEObserverNeeded(const IMEState& aState)
void
IMEStateManager::DestroyIMEContentObserver()
{
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::DestroyIMEContentObserver(), "
"sActiveIMEContentObserver=0x%p",
sActiveIMEContentObserver));
if (!sActiveIMEContentObserver) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::DestroyIMEContentObserver() does nothing"));
return;
}
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::DestroyIMEContentObserver(), destroying "
"the active IMEContentObserver..."));
nsRefPtr<IMEContentObserver> tsm;
@ -1173,7 +1173,7 @@ IMEStateManager::DestroyIMEContentObserver()
void
IMEStateManager::CreateIMEContentObserver(nsIEditor* aEditor)
{
MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::CreateIMEContentObserver(aEditor=0x%p), "
"sPresContext=0x%p, sContent=0x%p, sActiveIMEContentObserver=0x%p, "
"sActiveIMEContentObserver->IsManaging(sPresContext, sContent)=%s",
@ -1182,7 +1182,7 @@ IMEStateManager::CreateIMEContentObserver(nsIEditor* aEditor)
sActiveIMEContentObserver->IsManaging(sPresContext, sContent) : false)));
if (NS_WARN_IF(sActiveIMEContentObserver)) {
MOZ_LOG(sISMLog, PR_LOG_ERROR,
MOZ_LOG(sISMLog, LogLevel::Error,
("ISM: IMEStateManager::CreateIMEContentObserver(), FAILED due to "
"there is already an active IMEContentObserver"));
MOZ_ASSERT(sActiveIMEContentObserver->IsManaging(sPresContext, sContent));
@ -1191,7 +1191,7 @@ IMEStateManager::CreateIMEContentObserver(nsIEditor* aEditor)
nsCOMPtr<nsIWidget> widget = sPresContext->GetRootWidget();
if (!widget) {
MOZ_LOG(sISMLog, PR_LOG_ERROR,
MOZ_LOG(sISMLog, LogLevel::Error,
("ISM: IMEStateManager::CreateIMEContentObserver(), FAILED due to "
"there is a root widget for the nsPresContext"));
return; // Sometimes, there are no widgets.
@ -1199,13 +1199,13 @@ IMEStateManager::CreateIMEContentObserver(nsIEditor* aEditor)
// If it's not text editable, we don't need to create IMEContentObserver.
if (!IsIMEObserverNeeded(widget->GetInputContext().mIMEState)) {
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::CreateIMEContentObserver() doesn't create "
"IMEContentObserver because of non-editable IME state"));
return;
}
MOZ_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::CreateIMEContentObserver() is creating an "
"IMEContentObserver instance..."));
sActiveIMEContentObserver = new IMEContentObserver();

Просмотреть файл

@ -238,7 +238,7 @@ public:
// Silently cancel if our load has been cancelled.
if (IsCancelled())
return NS_OK;
LOG_EVENT(PR_LOG_DEBUG, ("%p Dispatching simple event source error", mElement.get()));
LOG_EVENT(LogLevel::Debug, ("%p Dispatching simple event source error", mElement.get()));
return nsContentUtils::DispatchTrustedEvent(mElement->OwnerDoc(),
mSource,
NS_LITERAL_STRING("error"),
@ -867,7 +867,7 @@ void HTMLMediaElement::SelectResource()
nsCOMPtr<nsIURI> uri;
nsresult rv = NewURIFromString(src, getter_AddRefs(uri));
if (NS_SUCCEEDED(rv)) {
LOG(PR_LOG_DEBUG, ("%p Trying load from src=%s", this, NS_ConvertUTF16toUTF8(src).get()));
LOG(LogLevel::Debug, ("%p Trying load from src=%s", this, NS_ConvertUTF16toUTF8(src).get()));
NS_ASSERTION(!mIsLoadingFromSourceChildren,
"Should think we're not loading from source children by default");
@ -900,7 +900,7 @@ void HTMLMediaElement::SelectResource()
void HTMLMediaElement::NotifyLoadError()
{
if (!mIsLoadingFromSourceChildren) {
LOG(PR_LOG_DEBUG, ("NotifyLoadError(), no supported media error"));
LOG(LogLevel::Debug, ("NotifyLoadError(), no supported media error"));
NoSupportedMediaSourceError();
} else if (mSourceLoadCandidate) {
DispatchAsyncSourceError(mSourceLoadCandidate);
@ -995,7 +995,7 @@ void HTMLMediaElement::LoadFromSourceChildren()
ReportLoadError("MediaLoadSourceMediaNotMatched", params, ArrayLength(params));
continue;
}
LOG(PR_LOG_DEBUG, ("%p Trying load from <source>=%s type=%s media=%s", this,
LOG(LogLevel::Debug, ("%p Trying load from <source>=%s type=%s media=%s", this,
NS_ConvertUTF16toUTF8(src).get(), NS_ConvertUTF16toUTF8(type).get(),
NS_ConvertUTF16toUTF8(media).get()));
@ -1453,14 +1453,14 @@ HTMLMediaElement::Seek(double aTime,
}
if (!mPlayed) {
LOG(PR_LOG_DEBUG, ("HTMLMediaElement::mPlayed not available."));
LOG(LogLevel::Debug, ("HTMLMediaElement::mPlayed not available."));
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
if (mCurrentPlayRangeStart != -1.0) {
double rangeEndTime = CurrentTime();
LOG(PR_LOG_DEBUG, ("%p Adding \'played\' a range : [%f, %f]", this, mCurrentPlayRangeStart, rangeEndTime));
LOG(LogLevel::Debug, ("%p Adding \'played\' a range : [%f, %f]", this, mCurrentPlayRangeStart, rangeEndTime));
// Multiple seek without playing, or seek while playing.
if (mCurrentPlayRangeStart != rangeEndTime) {
mPlayed->Add(mCurrentPlayRangeStart, rangeEndTime);
@ -1471,13 +1471,13 @@ HTMLMediaElement::Seek(double aTime,
}
if (!mDecoder) {
LOG(PR_LOG_DEBUG, ("%p SetCurrentTime(%f) failed: no decoder", this, aTime));
LOG(LogLevel::Debug, ("%p SetCurrentTime(%f) failed: no decoder", this, aTime));
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
if (mReadyState == nsIDOMHTMLMediaElement::HAVE_NOTHING) {
LOG(PR_LOG_DEBUG, ("%p SetCurrentTime(%f) failed: no source", this, aTime));
LOG(LogLevel::Debug, ("%p SetCurrentTime(%f) failed: no source", this, aTime));
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
@ -1554,7 +1554,7 @@ HTMLMediaElement::Seek(double aTime,
mPlayingBeforeSeek = IsPotentiallyPlaying();
// The media backend is responsible for dispatching the timeupdate
// event if it changes the playback position as a result of the seek.
LOG(PR_LOG_DEBUG, ("%p SetCurrentTime(%f) starting seek", this, aTime));
LOG(LogLevel::Debug, ("%p SetCurrentTime(%f) starting seek", this, aTime));
nsresult rv = mDecoder->Seek(aTime, aSeekType);
if (NS_FAILED(rv)) {
aRv.Throw(rv);
@ -1568,7 +1568,7 @@ NS_IMETHODIMP HTMLMediaElement::SetCurrentTime(double aCurrentTime)
{
// Detect for a NaN and invalid values.
if (mozilla::IsNaN(aCurrentTime)) {
LOG(PR_LOG_DEBUG, ("%p SetCurrentTime(%f) failed: bad time", this, aCurrentTime));
LOG(LogLevel::Debug, ("%p SetCurrentTime(%f) failed: bad time", this, aCurrentTime));
return NS_ERROR_FAILURE;
}
@ -1665,7 +1665,7 @@ void
HTMLMediaElement::Pause(ErrorResult& aRv)
{
if (mNetworkState == nsIDOMHTMLMediaElement::NETWORK_EMPTY) {
LOG(PR_LOG_DEBUG, ("Loading due to Pause()"));
LOG(LogLevel::Debug, ("Loading due to Pause()"));
aRv = Load();
if (aRv.Failed()) {
return;
@ -2561,7 +2561,7 @@ HTMLMediaElement::ReportEMETelemetry()
NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
if (mIsEncrypted && Preferences::GetBool("media.eme.enabled")) {
Telemetry::Accumulate(Telemetry::VIDEO_EME_PLAY_SUCCESS, mLoadedDataFired);
LOG(PR_LOG_DEBUG, ("%p VIDEO_EME_PLAY_SUCCESS = %s",
LOG(LogLevel::Debug, ("%p VIDEO_EME_PLAY_SUCCESS = %s",
this, mLoadedDataFired ? "true" : "false"));
}
}
@ -2613,14 +2613,14 @@ HTMLMediaElement::ReportMSETelemetry()
}
Telemetry::Accumulate(Telemetry::VIDEO_MSE_UNLOAD_STATE, state);
LOG(PR_LOG_DEBUG, ("%p VIDEO_MSE_UNLOAD_STATE = %d", this, state));
LOG(LogLevel::Debug, ("%p VIDEO_MSE_UNLOAD_STATE = %d", this, state));
Telemetry::Accumulate(Telemetry::VIDEO_MSE_PLAY_TIME_MS, SECONDS_TO_MS(mPlayTime.Total()));
LOG(PR_LOG_DEBUG, ("%p VIDEO_MSE_PLAY_TIME_MS = %f", this, mPlayTime.Total()));
LOG(LogLevel::Debug, ("%p VIDEO_MSE_PLAY_TIME_MS = %f", this, mPlayTime.Total()));
double latency = mJoinLatency.Count() ? mJoinLatency.Total() / mJoinLatency.Count() : 0.0;
Telemetry::Accumulate(Telemetry::VIDEO_MSE_JOIN_LATENCY_MS, SECONDS_TO_MS(latency));
LOG(PR_LOG_DEBUG, ("%p VIDEO_MSE_JOIN_LATENCY = %f (%d ms) count=%d\n",
LOG(LogLevel::Debug, ("%p VIDEO_MSE_JOIN_LATENCY = %f (%d ms) count=%d\n",
this, latency, SECONDS_TO_MS(latency), mJoinLatency.Count()));
}
@ -2676,7 +2676,7 @@ HTMLMediaElement::CanPlayType(const nsAString& aType, nsAString& aResult)
break;
}
LOG(PR_LOG_DEBUG, ("%p CanPlayType(%s) = \"%s\"", this,
LOG(LogLevel::Debug, ("%p CanPlayType(%s) = \"%s\"", this,
NS_ConvertUTF16toUTF8(aType).get(),
NS_ConvertUTF16toUTF8(aResult).get()));
@ -2695,10 +2695,10 @@ nsresult HTMLMediaElement::InitializeDecoderAsClone(MediaDecoder* aOriginal)
if (!decoder)
return NS_ERROR_FAILURE;
LOG(PR_LOG_DEBUG, ("%p Cloned decoder %p from %p", this, decoder.get(), aOriginal));
LOG(LogLevel::Debug, ("%p Cloned decoder %p from %p", this, decoder.get(), aOriginal));
if (!decoder->Init(this)) {
LOG(PR_LOG_DEBUG, ("%p Failed to init cloned decoder %p", this, decoder.get()));
LOG(LogLevel::Debug, ("%p Failed to init cloned decoder %p", this, decoder.get()));
return NS_ERROR_FAILURE;
}
@ -2710,7 +2710,7 @@ nsresult HTMLMediaElement::InitializeDecoderAsClone(MediaDecoder* aOriginal)
nsRefPtr<MediaResource> resource = originalResource->CloneData(decoder);
if (!resource) {
LOG(PR_LOG_DEBUG, ("%p Failed to cloned stream for decoder %p", this, decoder.get()));
LOG(LogLevel::Debug, ("%p Failed to cloned stream for decoder %p", this, decoder.get()));
return NS_ERROR_FAILURE;
}
@ -2738,7 +2738,7 @@ nsresult HTMLMediaElement::InitializeDecoderForChannel(nsIChannel* aChannel,
return NS_ERROR_FAILURE;
}
LOG(PR_LOG_DEBUG, ("%p Created decoder %p for type %s", this, decoder.get(), mimeType.get()));
LOG(LogLevel::Debug, ("%p Created decoder %p for type %s", this, decoder.get(), mimeType.get()));
nsRefPtr<MediaResource> resource = MediaResource::Create(decoder, aChannel);
if (!resource)
@ -2798,7 +2798,7 @@ nsresult HTMLMediaElement::FinishDecoderSetup(MediaDecoder* aDecoder,
nsresult rv = aDecoder->Load(aListener, aCloneDonor);
if (NS_FAILED(rv)) {
SetDecoder(nullptr);
LOG(PR_LOG_DEBUG, ("%p Failed to load for decoder %p", this, aDecoder));
LOG(LogLevel::Debug, ("%p Failed to load for decoder %p", this, aDecoder));
return rv;
}
@ -3318,7 +3318,7 @@ void HTMLMediaElement::PlaybackEnded()
}
if (mSrcStream || (mDecoder && mDecoder->IsInfinite())) {
LOG(PR_LOG_DEBUG, ("%p, got duration by reaching the end of the resource", this));
LOG(LogLevel::Debug, ("%p, got duration by reaching the end of the resource", this));
DispatchAsyncEvent(NS_LITERAL_STRING("durationchange"));
}
@ -3609,7 +3609,7 @@ void HTMLMediaElement::ChangeReadyState(nsMediaReadyState aState)
return;
}
LOG(PR_LOG_DEBUG, ("%p Ready state changed to %s", this, gReadyStateToString[aState]));
LOG(LogLevel::Debug, ("%p Ready state changed to %s", this, gReadyStateToString[aState]));
UpdateAudioChannelPlayingState();
@ -3664,7 +3664,7 @@ void HTMLMediaElement::ChangeNetworkState(nsMediaNetworkState aState)
nsMediaNetworkState oldState = mNetworkState;
mNetworkState = aState;
LOG(PR_LOG_DEBUG, ("%p Network state changed to %s", this, gNetworkStateToString[aState]));
LOG(LogLevel::Debug, ("%p Network state changed to %s", this, gNetworkStateToString[aState]));
// TODO: |mBegun| reflects the download status. We should be able to remove
// it and check |mNetworkState| only.
@ -3759,7 +3759,7 @@ VideoFrameContainer* HTMLMediaElement::GetVideoFrameContainer()
nsresult HTMLMediaElement::DispatchEvent(const nsAString& aName)
{
LOG_EVENT(PR_LOG_DEBUG, ("%p Dispatching event %s", this,
LOG_EVENT(LogLevel::Debug, ("%p Dispatching event %s", this,
NS_ConvertUTF16toUTF8(aName).get()));
// Save events that occur while in the bfcache. These will be dispatched
@ -3778,7 +3778,7 @@ nsresult HTMLMediaElement::DispatchEvent(const nsAString& aName)
nsresult HTMLMediaElement::DispatchAsyncEvent(const nsAString& aName)
{
LOG_EVENT(PR_LOG_DEBUG, ("%p Queuing event %s", this,
LOG_EVENT(LogLevel::Debug, ("%p Queuing event %s", this,
NS_ConvertUTF16toUTF8(aName).get()));
// Save events that occur while in the bfcache. These will be dispatched
@ -4040,7 +4040,7 @@ HTMLMediaElement::IsNodeOfType(uint32_t aFlags) const
void HTMLMediaElement::DispatchAsyncSourceError(nsIContent* aSourceElement)
{
LOG_EVENT(PR_LOG_DEBUG, ("%p Queuing simple source error event", this));
LOG_EVENT(LogLevel::Debug, ("%p Queuing simple source error event", this));
nsCOMPtr<nsIRunnable> event = new nsSourceErrorEventRunner(this, aSourceElement);
NS_DispatchToMainThread(event);
@ -4125,7 +4125,7 @@ void HTMLMediaElement::ChangeDelayLoadStatus(bool aDelay)
mDelayingLoadEvent = aDelay;
LOG(PR_LOG_DEBUG, ("%p ChangeDelayLoadStatus(%d) doc=0x%p", this, aDelay, mLoadBlockedDoc.get()));
LOG(LogLevel::Debug, ("%p ChangeDelayLoadStatus(%d) doc=0x%p", this, aDelay, mLoadBlockedDoc.get()));
if (mDecoder) {
mDecoder->SetLoadInBackground(!aDelay);
}

Просмотреть файл

@ -195,7 +195,7 @@ HTMLTrackElement::LoadResource()
nsCOMPtr<nsIURI> uri;
nsresult rv = NewURIFromString(src, getter_AddRefs(uri));
NS_ENSURE_TRUE_VOID(NS_SUCCEEDED(rv));
LOG(PR_LOG_ALWAYS, ("%p Trying to load from src=%s", this,
LOG(LogLevel::Info, ("%p Trying to load from src=%s", this,
NS_ConvertUTF16toUTF8(src).get()));
if (mChannel) {
@ -246,7 +246,7 @@ HTMLTrackElement::LoadResource()
NS_ENSURE_TRUE_VOID(NS_SUCCEEDED(rv));
channel->SetNotificationCallbacks(mListener);
LOG(PR_LOG_DEBUG, ("opening webvtt channel"));
LOG(LogLevel::Debug, ("opening webvtt channel"));
rv = channel->AsyncOpen(mListener, nullptr);
NS_ENSURE_TRUE_VOID(NS_SUCCEEDED(rv));
@ -269,7 +269,7 @@ HTMLTrackElement::BindToTree(nsIDocument* aDocument,
return NS_OK;
}
LOG(PR_LOG_DEBUG, ("Track Element bound to tree."));
LOG(LogLevel::Debug, ("Track Element bound to tree."));
if (!aParent || !aParent->IsNodeOfType(nsINode::eMEDIA)) {
return NS_OK;
}
@ -281,7 +281,7 @@ HTMLTrackElement::BindToTree(nsIDocument* aDocument,
HTMLMediaElement* media = static_cast<HTMLMediaElement*>(aParent);
// TODO: separate notification for 'alternate' tracks?
media->NotifyAddedSource();
LOG(PR_LOG_DEBUG, ("Track element sent notification to parent."));
LOG(LogLevel::Debug, ("Track element sent notification to parent."));
mMediaParent->RunInStableState(
NS_NewRunnableMethod(this, &HTMLTrackElement::LoadResource));

Просмотреть файл

@ -131,8 +131,10 @@ function runEmulatorCmdSafe(aCommand) {
/**
* Send stk proactive pdu.
*
* Fulfill params: (none)
* Reject params: (none)
* Fulfill params:
* result -- an array of emulator response lines.
* Reject params:
* result -- an array of emulator response lines.
*
* @param aPdu
*
@ -143,6 +145,84 @@ function sendEmulatorStkPdu(aPdu) {
return runEmulatorCmdSafe(cmd);
}
/**
* Peek the last STK terminal response sent to modem.
*
* Fulfill params:
* result -- last terminal response in HEX String.
* Reject params:
* result -- an array of emulator response lines.
*
* @return A deferred promise.
*/
function peekLastStkResponse() {
return runEmulatorCmdSafe("stk lastresponse")
.then(aResult => aResult[0]);
}
/**
* Peek the last STK envelope sent to modem.
*
* Fulfill params:
* result -- last envelope in HEX String.
* Reject params:
* result -- an array of emulator response lines.
*
* @return A deferred promise.
*/
function peekLastStkEnvelope() {
return runEmulatorCmdSafe("stk lastenvelope")
.then(aResult => aResult[0]);
}
/**
* Verify with the peeked STK response.
*
* Fulfill params:
* result -- (none)
* Reject params:
* result -- an array of emulator response lines.
*
* @param aExpectResponse
* The expected Response PDU in HEX String.
*
* @return A deferred promise.
*/
function verifyWithPeekedStkResponse(aExpectResponse) {
return new Promise(function(aResolve, aReject) {
window.setTimeout(function() {
peekLastStkResponse().then(aResult => {
is(aResult, aExpectResponse, "Verify sent APDU");
aResolve();
});
}, 3000);
});
}
/**
* Verify with the peeked STK response.
*
* Fulfill params:
* result -- (none)
* Reject params:
* result -- an array of emulator response lines.
*
* @param aExpectEnvelope
* The expected Envelope PDU in HEX String.
*
* @return A deferred promise.
*/
function verifyWithPeekedStkEnvelope(aExpectEnvelope) {
return new Promise(function(aResolve, aReject) {
window.setTimeout(function() {
peekLastStkEnvelope().then(aResult => {
is(aResult, aExpectEnvelope, "Verify sent APDU");
aResolve();
});
}, 3000);
});
}
let workingFrame;
let iccManager;

Просмотреть файл

@ -36,3 +36,7 @@ qemu = true
[test_icc_detected_undetected_event.js]
[test_icc_match_mvno.js]
[test_icc_service_state.js]
[test_stk_menu_selection.js]
[test_stk_timer_expiration.js]
[test_stk_event_download.js]
[test_stk_response.js]

Просмотреть файл

@ -0,0 +1,204 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 90000;
MARIONETTE_HEAD_JS = "head.js";
// Start tests
startTestCommon(function() {
let icc = getMozIcc();
// APDU format of ENVELOPE:
// Class = 'A0', INS = 'C2', P1 = '00', P2 = '00', XXXX, (No Le)
// Since |sendStkEventDownload| is an API without call back to identify the
// result, the tests of |sendStkMenuSelection| must be executed one by one with
// |verifyWithPeekedStkEnvelope| introduced here.
return Promise.resolve()
.then(() => icc.sendStkEventDownload({
eventType: MozIccManager.STK_EVENT_TYPE_USER_ACTIVITY
}))
.then(() => verifyWithPeekedStkEnvelope(
"D6" + // BER_EVENT_DOWNLOAD_TAG
"07" + // Length
"990104" + // TAG_EVENT_LIST (STK_EVENT_TYPE_USER_ACTIVITY)
"82028281" // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
))
.then(() => icc.sendStkEventDownload({
eventType: MozIccManager.STK_EVENT_TYPE_IDLE_SCREEN_AVAILABLE
}))
.then(() => verifyWithPeekedStkEnvelope(
"D6" + // BER_EVENT_DOWNLOAD_TAG
"07" + // Length
"990105" + // TAG_EVENT_LIST (STK_EVENT_TYPE_IDLE_SCREEN_AVAILABLE)
"82020281" // TAG_DEVICE_ID (STK_DEVICE_ID_DISPLAY, STK_DEVICE_ID_SIM)
))
.then(() => icc.sendStkEventDownload({
eventType: MozIccManager.STK_EVENT_TYPE_LOCATION_STATUS,
locationStatus: MozIccManager.STK_SERVICE_STATE_NORMAL,
locationInfo: {
mcc: "466",
mnc: "92",
gsmLocationAreaCode: 10291,
gsmCellId: 19072823
}
}))
.then(() => verifyWithPeekedStkEnvelope(
"D6" + // BER_EVENT_DOWNLOAD_TAG
"15" + // Length
"990103" + // TAG_EVENT_LIST (STK_EVENT_TYPE_LOCATION_STATUS)
"82028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"9B0100" + // TAG_LOCATION_STATUS (STK_SERVICE_STATE_NORMAL)
"930964F629283301230737" // TAG_LOCATION_INFO (mccmnc = 46692, lac = 10291, cellId = 19072823)
))
.then(() => icc.sendStkEventDownload({
eventType: MozIccManager.STK_EVENT_TYPE_LOCATION_STATUS,
locationStatus: MozIccManager.STK_SERVICE_STATE_LIMITED,
// locationInfo shall be ignored if locationStatus != STK_SERVICE_STATE_NORMAL
locationInfo: {
mcc: "466",
mnc: "92",
gsmLocationAreaCode: 10291,
gsmCellId: 19072823
}
}))
.then(() => verifyWithPeekedStkEnvelope(
"D6" + // BER_EVENT_DOWNLOAD_TAG
"0A" + // Length
"990103" + // TAG_EVENT_LIST (STK_EVENT_TYPE_LOCATION_STATUS)
"82028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"9B0101" // TAG_LOCATION_STATUS (STK_SERVICE_STATE_LIMITED)
))
.then(() => icc.sendStkEventDownload({
eventType: MozIccManager.STK_EVENT_TYPE_LOCATION_STATUS,
locationStatus: MozIccManager.STK_SERVICE_STATE_UNAVAILABLE,
}))
.then(() => verifyWithPeekedStkEnvelope(
"D6" + // BER_EVENT_DOWNLOAD_TAG
"0A" + // Length
"990103" + // TAG_EVENT_LIST (STK_EVENT_TYPE_LOCATION_STATUS)
"82028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"9B0102" // TAG_LOCATION_STATUS (STK_SERVICE_STATE_UNAVAILABLE)
))
.then(() => icc.sendStkEventDownload({
eventType: MozIccManager.STK_EVENT_TYPE_MT_CALL,
number: "+9876543210", // International number
isIssuedByRemote: true,
error: null
}))
.then(() => verifyWithPeekedStkEnvelope(
"D6" + // BER_EVENT_DOWNLOAD_TAG
"12" + // Length
"990100" + // TAG_EVENT_LIST (STK_EVENT_TYPE_MT_CALL)
"82028381" + // TAG_DEVICE_ID (STK_DEVICE_ID_NETWORK, STK_DEVICE_ID_SIM)
"9C0100" + // TAG_TRANSACTION_ID (transactionId always set to 0)
"8606918967452301" // TAG_ADDRESS (+9876543210)
))
.then(() => icc.sendStkEventDownload({
eventType: MozIccManager.STK_EVENT_TYPE_MT_CALL,
number: "987654321", // National number
isIssuedByRemote: true,
error: null
}))
.then(() => verifyWithPeekedStkEnvelope(
"D6" + // BER_EVENT_DOWNLOAD_TAG
"12" + // Length
"990100" + // TAG_EVENT_LIST (STK_EVENT_TYPE_MT_CALL)
"82028381" + // TAG_DEVICE_ID (STK_DEVICE_ID_NETWORK, STK_DEVICE_ID_SIM)
"9C0100" + // TAG_TRANSACTION_ID (transactionId always set to 0)
"86068189674523F1" // TAG_ADDRESS (987654321)
))
.then(() => icc.sendStkEventDownload({
eventType: MozIccManager.STK_EVENT_TYPE_CALL_CONNECTED,
isIssuedByRemote: true,
}))
.then(() => verifyWithPeekedStkEnvelope(
"D6" + // BER_EVENT_DOWNLOAD_TAG
"0A" + // Length
"990101" + // TAG_EVENT_LIST (STK_EVENT_TYPE_CALL_CONNECTED)
"82028381" + // TAG_DEVICE_ID (STK_DEVICE_ID_NETWORK, STK_DEVICE_ID_SIM)
"9C0100" // TAG_TRANSACTION_ID (transactionId always set to 0)
))
.then(() => icc.sendStkEventDownload({
eventType: MozIccManager.STK_EVENT_TYPE_CALL_CONNECTED,
isIssuedByRemote: false,
}))
.then(() => verifyWithPeekedStkEnvelope(
"D6" + // BER_EVENT_DOWNLOAD_TAG
"0A" + // Length
"990101" + // TAG_EVENT_LIST (STK_EVENT_TYPE_CALL_CONNECTED)
"82028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"9C0100" // TAG_TRANSACTION_ID (transactionId always set to 0)
))
.then(() => icc.sendStkEventDownload({
eventType: MozIccManager.STK_EVENT_TYPE_CALL_DISCONNECTED,
isIssuedByRemote: false,
error: "BusyError"
}))
.then(() => verifyWithPeekedStkEnvelope(
"D6" + // BER_EVENT_DOWNLOAD_TAG
"0E" + // Length
"990102" + // TAG_EVENT_LIST (STK_EVENT_TYPE_CALL_DISCONNECTED)
"82028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"9C0100" + // TAG_TRANSACTION_ID (transactionId always set to 0)
"9A026091" // TAG_CAUSE (Busy)
))
.then(() => icc.sendStkEventDownload({
eventType: MozIccManager.STK_EVENT_TYPE_CALL_DISCONNECTED,
isIssuedByRemote: true,
}))
.then(() => verifyWithPeekedStkEnvelope(
"D6" + // BER_EVENT_DOWNLOAD_TAG
"0A" + // Length
"990102" + // TAG_EVENT_LIST (STK_EVENT_TYPE_CALL_DISCONNECTED)
"82028381" + // TAG_DEVICE_ID (STK_DEVICE_ID_NETWORK, STK_DEVICE_ID_SIM)
"9C0100" // TAG_TRANSACTION_ID (transactionId always set to 0)
))
.then(() => icc.sendStkEventDownload({
eventType: MozIccManager.STK_EVENT_TYPE_LANGUAGE_SELECTION,
language: "zh",
}))
.then(() => verifyWithPeekedStkEnvelope(
"D6" + // BER_EVENT_DOWNLOAD_TAG
"0B" + // Length
"990107" + // TAG_EVENT_LIST (STK_EVENT_TYPE_LANGUAGE_SELECTION)
"82028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"2D027A68" // TAG_LANGUAGE ("zh")
))
.then(() => icc.sendStkEventDownload({
eventType: MozIccManager.STK_EVENT_TYPE_BROWSER_TERMINATION,
terminationCause: MozIccManager.STK_BROWSER_TERMINATION_CAUSE_USER,
}))
.then(() => verifyWithPeekedStkEnvelope(
"D6" + // BER_EVENT_DOWNLOAD_TAG
"0A" + // Length
"990108" + // TAG_EVENT_LIST (STK_EVENT_TYPE_BROWSER_TERMINATION)
"82028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"B40100" // TAG_BROWSER_TERMINATION_CAUSE (USER)
))
.then(() => icc.sendStkEventDownload({
eventType: MozIccManager.STK_EVENT_TYPE_BROWSER_TERMINATION,
terminationCause: MozIccManager.STK_BROWSER_TERMINATION_CAUSE_ERROR,
}))
.then(() => verifyWithPeekedStkEnvelope(
"D6" + // BER_EVENT_DOWNLOAD_TAG
"0A" + // Length
"990108" + // TAG_EVENT_LIST (STK_EVENT_TYPE_BROWSER_TERMINATION)
"82028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"B40101" // TAG_BROWSER_TERMINATION_CAUSE (ERROR)
));
});

Просмотреть файл

@ -0,0 +1,35 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 30000;
MARIONETTE_HEAD_JS = "head.js";
// Start tests
startTestCommon(function() {
let icc = getMozIcc();
// APDU format of ENVELOPE:
// Class = 'A0', INS = 'C2', P1 = '00', P2 = '00', XXXX, (No Le)
// Since |sendStkMenuSelection| is an API without call back to identify the
// result, the tests of |sendStkMenuSelection| must be executed one by one with
// |verifyWithPeekedStkEnvelope| introduced here.
return Promise.resolve()
.then(() => icc.sendStkMenuSelection(1, true))
.then(() => verifyWithPeekedStkEnvelope(
"D3" + // BER_MENU_SELECTION_TAG
"09" + // Length
"82020181" + // TAG_DEVICE_ID (STK_DEVICE_ID_KEYPAD, STK_DEVICE_ID_SIM)
"900101" + // TAG_ITEM_ID (Item (1))
"9500" // TAG_HELP_REQUEST
))
.then(() => icc.sendStkMenuSelection(0, false))
.then(() => verifyWithPeekedStkEnvelope(
"D3" + // BER_MENU_SELECTION_TAG
"07" + // Length
"82020181" + // TAG_DEVICE_ID (STK_DEVICE_ID_KEYPAD, STK_DEVICE_ID_SIM)
"900100" // TAG_ITEM_ID (Item (0))
));
});

Просмотреть файл

@ -0,0 +1,288 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 120000;
MARIONETTE_HEAD_JS = "head.js";
// Start tests
startTestCommon(function() {
let icc = getMozIcc();
// APDU format of TERMINAL RESPONSE:
// Class = 'A0', INS = '14', P1 = '00', P2 = '00', XXXX, (No Le)
// Since |sendStkResponse| is an API without call back to identify the
// result, the tests of |sendStkResponse| must be executed one by one with
// |verifyWithPeekedStkResponse| introduced here.
return Promise.resolve()
.then(() => icc.sendStkResponse({
commandNumber: 0x01,
typeOfCommand: MozIccManager.STK_CMD_LAUNCH_BROWSER,
commandQualifier: 0x00,
options: {
url: "",
mode: MozIccManager.STK_BROWSER_MODE_LAUNCH_IF_NOT_ALREADY_LAUNCHED
}
}, {
resultCode: MozIccManager.STK_RESULT_OK
}))
.then(() => verifyWithPeekedStkResponse(
"8103011500" + // TAG_COMMAND_DETAILS (STK_CMD_LAUNCH_BROWSER)
"02028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"830100" // TAG_RESULT (STK_RESULT_OK)
))
.then(() => icc.sendStkResponse({
commandNumber: 0x02,
typeOfCommand: MozIccManager.STK_CMD_DISPLAY_TEXT,
commandQualifier: 0x01,
options: {
text: "Toolkit Test 1",
responseNeeded: false
}
}, {
resultCode:
MozIccManager.STK_RESULT_TERMINAL_CRNTLY_UNABLE_TO_PROCESS,
additionalInformation:
MozIccManager.STK_ADDITIONAL_INFO_ME_PROBLEM_SCREEN_IS_BUSY
}))
.then(() => verifyWithPeekedStkResponse(
"8103022101" + // TAG_COMMAND_DETAILS (STK_CMD_DISPLAY_TEXT)
"02028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"83022001" // TAG_RESULT (STK_ADDITIONAL_INFO_ME_PROBLEM_SCREEN_IS_BUSY)
))
.then(() => icc.sendStkResponse({
commandNumber: 0x03,
typeOfCommand: MozIccManager.STK_CMD_SELECT_ITEM,
commandQualifier: 0x00,
options: {
title: "Toolkit Select",
items: [{identifier: 1, text: "Item 1"},
{identifier: 2, text: "Item 2"},
{identifier: 3, text: "Item 3"},
{identifier: 4, text: "Item 4"}]
}
}, {
resultCode: MozIccManager.STK_RESULT_HELP_INFO_REQUIRED,
itemIdentifier: 5
}))
.then(() => verifyWithPeekedStkResponse(
"8103032400" + // TAG_COMMAND_DETAILS (STK_CMD_SELECT_ITEM)
"02028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"830113" + // TAG_RESULT (STK_RESULT_HELP_INFO_REQUIRED)
"900105" // TAG_ITEM_ID (5)
))
.then(() => icc.sendStkResponse({
commandNumber: 0x04,
typeOfCommand: MozIccManager.STK_CMD_GET_INKEY,
commandQualifier: 0x04,
options: {
text: "Enter Y/N"
}
}, {
resultCode: MozIccManager.STK_RESULT_OK,
isYesNo: true
}))
.then(() => verifyWithPeekedStkResponse(
"8103042204" + // TAG_COMMAND_DETAILS (STK_CMD_GET_INKEY)
"02028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"830100" + // TAG_RESULT (STK_RESULT_OK)
"8D020401" // TAG_TEXT_STRING (STK_TEXT_CODING_GSM_8BIT, YES)
))
.then(() => icc.sendStkResponse({
commandNumber: 0x05,
typeOfCommand: MozIccManager.STK_CMD_GET_INKEY,
commandQualifier: 0x04,
options: {
text: "Enter Y/N",
duration: {
timeUnit: MozIccManager.STK_TIME_UNIT_SECOND,
timeInterval: 10
}
}
}, {
resultCode: MozIccManager.STK_RESULT_NO_RESPONSE_FROM_USER,
}))
.then(() => verifyWithPeekedStkResponse(
"8103052204" + // TAG_COMMAND_DETAILS (STK_CMD_GET_INKEY)
"02028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"830112" + // TAG_RESULT (STK_RESULT_NO_RESPONSE_FROM_USER)
"0402010A" // TAG_DURATION (10 seconds)
))
.then(() => icc.sendStkResponse({
commandNumber: 0x06,
typeOfCommand: MozIccManager.STK_CMD_GET_INPUT,
commandQualifier: 0x01,
options: {
text: "Enter Yes"
}
}, {
resultCode: MozIccManager.STK_RESULT_OK,
input: "Yes"
}))
.then(() => verifyWithPeekedStkResponse(
"8103062301" + // TAG_COMMAND_DETAILS (STK_CMD_GET_INPUT)
"02028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"830100" + // TAG_RESULT (STK_RESULT_OK)
"8D0404596573" // TAG_TEXT_STRING (STK_TEXT_CODING_GSM_8BIT, "Yes")
))
.then(() => icc.sendStkResponse({
commandNumber: 0x07,
typeOfCommand: MozIccManager.STK_CMD_TIMER_MANAGEMENT,
commandQualifier: MozIccManager.STK_TIMER_START,
options: {
timerAction: MozIccManager.STK_TIMER_START,
timerId: 0x01,
timerValue: (0x01 * 60 * 60) + (0x02 * 60) + 0x03 // 01:02:03
}
}, {
resultCode: MozIccManager.STK_RESULT_OK,
timer: {
timerAction: MozIccManager.STK_TIMER_START,
timerId: 0x01,
timerValue: (0x01 * 60 * 60) + (0x02 * 60) + 0x03 // 01:02:03
},
}))
.then(() => verifyWithPeekedStkResponse(
"8103072700" + // TAG_COMMAND_DETAILS (STK_CMD_TIMER_MANAGEMENT)
"02028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"830100" + // TAG_RESULT (STK_RESULT_OK)
"240101" + // TIMER_IDENTIFIER (TIMER ID = 1)
"2503102030" // TAG_TIMER_VALUE
))
.then(() => icc.sendStkResponse({
commandNumber: 0x08,
typeOfCommand: MozIccManager.STK_CMD_TIMER_MANAGEMENT,
commandQualifier: MozIccManager.STK_TIMER_DEACTIVATE,
options: {
timerAction: MozIccManager.STK_TIMER_DEACTIVATE,
timerId: 0x02,
timerValue: (0x01 * 60 * 60) + (0x02 * 60) + 0x03 // 01:02:03
}
}, {
resultCode: MozIccManager.STK_RESULT_OK,
timer: {
timerId: 0x02
},
}))
.then(() => verifyWithPeekedStkResponse(
"8103082701" + // TAG_COMMAND_DETAILS (STK_CMD_TIMER_MANAGEMENT)
"02028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"830100" + // TAG_RESULT (STK_RESULT_OK)
"240102" // TIMER_IDENTIFIER (TIMER ID = 2)
))
.then(() => icc.sendStkResponse({
commandNumber: 0x09,
typeOfCommand: MozIccManager.STK_CMD_TIMER_MANAGEMENT,
commandQualifier: MozIccManager.STK_TIMER_GET_CURRENT_VALUE,
options: {
timerAction: MozIccManager.STK_TIMER_GET_CURRENT_VALUE,
timerId: 0x03,
}
}, {
resultCode: MozIccManager.STK_RESULT_ACTION_CONTRADICTION_TIMER_STATE,
timer: {
timerId: 0x03
},
}))
.then(() => verifyWithPeekedStkResponse(
"8103092702" + // TAG_COMMAND_DETAILS (STK_CMD_TIMER_MANAGEMENT)
"02028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"830124" + // TAG_RESULT (STK_RESULT_ACTION_CONTRADICTION_TIMER_STATE)
"240103" // TIMER_IDENTIFIER (TIMER ID = 3)
))
.then(() => icc.sendStkResponse({
commandNumber: 0x0A,
typeOfCommand: MozIccManager.STK_CMD_PROVIDE_LOCAL_INFO,
commandQualifier: MozIccManager.STK_LOCAL_INFO_LOCATION_INFO,
options: {
localInfoType: MozIccManager.STK_LOCAL_INFO_LOCATION_INFO
}
}, {
resultCode: MozIccManager.STK_RESULT_OK,
localInfo: {
locationInfo: {
mcc: "466",
mnc: "92",
gsmLocationAreaCode: 10291,
gsmCellId: 19072823
}
},
}))
.then(() => verifyWithPeekedStkResponse(
"81030A2600" + // TAG_COMMAND_DETAILS (STK_CMD_PROVIDE_LOCAL_INFO)
"02028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"830100" + // TAG_RESULT (STK_RESULT_OK)
"930964F629283301230737" // TAG_LOCATION_INFO (mccmnc = 46692, lac = 10291, cellId = 19072823)
))
.then(() => icc.sendStkResponse({
commandNumber: 0x0B,
typeOfCommand: MozIccManager.STK_CMD_PROVIDE_LOCAL_INFO,
commandQualifier: MozIccManager.STK_LOCAL_INFO_IMEI,
options: {
localInfoType: MozIccManager.STK_LOCAL_INFO_IMEI
}
}, {
resultCode: MozIccManager.STK_RESULT_OK,
localInfo: {
imei: "123456789012345"
},
}))
.then(() => verifyWithPeekedStkResponse(
"81030B2601" + // TAG_COMMAND_DETAILS (STK_CMD_PROVIDE_LOCAL_INFO)
"02028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"830100" + // TAG_RESULT (STK_RESULT_OK)
"14081234567890123450" // TAG_IMEI ("123456789012345")
))
.then(() => icc.sendStkResponse({
commandNumber: 0x0C,
typeOfCommand: MozIccManager.STK_CMD_PROVIDE_LOCAL_INFO,
commandQualifier: MozIccManager.STK_LOCAL_INFO_DATE_TIME_ZONE,
options: {
localInfoType: MozIccManager.STK_LOCAL_INFO_DATE_TIME_ZONE
}
}, {
resultCode: MozIccManager.STK_RESULT_OK,
localInfo: {
// 2012, 3/4, 5:06:07 (Month is zero-based)
date: new Date(Date.UTC(2012, 2, 4, 5, 6, 7))
},
}))
.then(() => verifyWithPeekedStkResponse(
"81030C2603" + // TAG_COMMAND_DETAILS (STK_CMD_PROVIDE_LOCAL_INFO)
"02028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"830100" + // TAG_RESULT (STK_RESULT_OK)
"260721304050607000" // TAG_DATE_TIME_ZONE ("2012, 3/4, 5:06:07" in UTC)
))
.then(() => icc.sendStkResponse({
commandNumber: 0x0D,
typeOfCommand: MozIccManager.STK_CMD_PROVIDE_LOCAL_INFO,
commandQualifier: MozIccManager.STK_LOCAL_INFO_LANGUAGE,
options: {
localInfoType: MozIccManager.STK_LOCAL_INFO_LANGUAGE
}
}, {
resultCode: MozIccManager.STK_RESULT_OK,
localInfo: {
language: "zh"
},
}))
.then(() => verifyWithPeekedStkResponse(
"81030D2604" + // TAG_COMMAND_DETAILS (STK_CMD_PROVIDE_LOCAL_INFO)
"02028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"830100" + // TAG_RESULT (STK_RESULT_OK)
"2D027A68" // TAG_LANGUAGE ("zh")
));
});

Просмотреть файл

@ -0,0 +1,27 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 20000;
MARIONETTE_HEAD_JS = "head.js";
// Start tests
startTestCommon(function() {
let icc = getMozIcc();
// APDU format of ENVELOPE:
// Class = 'A0', INS = 'C2', P1 = '00', P2 = '00', XXXX, (No Le)
// Since |sendStkTimerExpiration| is an API without call back to identify the
// result, the tests of |sendStkMenuSelection| must be executed one by one with
// |verifyWithPeekedStkEnvelope| introduced here.
return Promise.resolve()
.then(() => icc.sendStkTimerExpiration({ timerId: 5, timerValue: 1234567 / 1000 }))
.then(() => verifyWithPeekedStkEnvelope(
"D7" + // BER_TIMER_EXPIRATION_TAG
"0C" + // Length
"82028281" + // TAG_DEVICE_ID (STK_DEVICE_ID_ME, STK_DEVICE_ID_SIM)
"A40105" + // TAG_TIMER_IDENTIFIER (5)
"A503000243" // TIMER_VALUE (00:20:34) = 1234 seconds
));
});

Просмотреть файл

@ -107,7 +107,7 @@
#define IDB_DEBUG_LOG(_args) \
MOZ_LOG(IndexedDatabaseManager::GetLoggingModule(), \
PR_LOG_DEBUG, \
LogLevel::Debug, \
_args )
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)

Просмотреть файл

@ -282,9 +282,9 @@ LoggingHelper(bool aUseProfiler, const char* aFmt, ...)
PRLogModuleInfo* logModule = IndexedDatabaseManager::GetLoggingModule();
MOZ_ASSERT(logModule);
static const PRLogModuleLevel logLevel = PR_LOG_WARNING;
static const mozilla::LogLevel logLevel = LogLevel::Warning;
if (PR_LOG_TEST(logModule, logLevel) ||
if (MOZ_LOG_TEST(logModule, logLevel) ||
(aUseProfiler && profiler_is_active())) {
nsAutoCString message;

Просмотреть файл

@ -77,10 +77,10 @@
return sLog;
}
# define LOG(fmt, ...) \
MOZ_LOG(GetPPMLog(), PR_LOG_DEBUG, \
MOZ_LOG(GetPPMLog(), LogLevel::Debug, \
("ProcessPriorityManager - " fmt, ##__VA_ARGS__))
# define LOGP(fmt, ...) \
MOZ_LOG(GetPPMLog(), PR_LOG_DEBUG, \
MOZ_LOG(GetPPMLog(), LogLevel::Debug, \
("ProcessPriorityManager[%schild-id=%" PRIu64 ", pid=%d] - " fmt, \
NameWithComma().get(), \
static_cast<uint64_t>(ChildID()), Pid(), ##__VA_ARGS__))

Просмотреть файл

@ -12,9 +12,9 @@ namespace mozilla {
extern PRLogModuleInfo* gMediaDecoderLog;
#define SINK_LOG(msg, ...) \
MOZ_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("AudioSink=%p " msg, this, ##__VA_ARGS__))
MOZ_LOG(gMediaDecoderLog, LogLevel::Debug, ("AudioSink=%p " msg, this, ##__VA_ARGS__))
#define SINK_LOG_V(msg, ...) \
MOZ_LOG(gMediaDecoderLog, PR_LOG_DEBUG+1, ("AudioSink=%p " msg, this, ##__VA_ARGS__))
MOZ_LOG(gMediaDecoderLog, LogLevel::Verbose, ("AudioSink=%p " msg, this, ##__VA_ARGS__))
AudioSink::OnAudioEndTimeUpdateTask::OnAudioEndTimeUpdateTask(
MediaDecoderStateMachine* aStateMachine)

Просмотреть файл

@ -31,7 +31,7 @@ namespace mozilla {
PRLogModuleInfo* gAudioStreamLog = nullptr;
// For simple logs
#define LOG(x) MOZ_LOG(gAudioStreamLog, PR_LOG_DEBUG, x)
#define LOG(x) MOZ_LOG(gAudioStreamLog, mozilla::LogLevel::Debug, x)
/**
* When MOZ_DUMP_AUDIO is set in the environment (to anything),
@ -330,7 +330,7 @@ AudioStream::Init(int32_t aNumChannels, int32_t aRate,
return NS_ERROR_FAILURE;
}
MOZ_LOG(gAudioStreamLog, PR_LOG_DEBUG,
MOZ_LOG(gAudioStreamLog, LogLevel::Debug,
("%s channels: %d, rate: %d for %p", __FUNCTION__, aNumChannels, aRate, this));
mInRate = mOutRate = aRate;
mChannels = aNumChannels;
@ -547,12 +547,12 @@ AudioStream::CheckForStart()
if (mLatencyRequest == LowLatency || mNeedsStart) {
StartUnlocked(); // mState = STARTED or ERRORED
mNeedsStart = false;
MOZ_LOG(gAudioStreamLog, PR_LOG_WARNING,
MOZ_LOG(gAudioStreamLog, LogLevel::Warning,
("Started waiting %s-latency stream",
mLatencyRequest == LowLatency ? "low" : "high"));
} else {
// high latency, not full - OR Pause() was called before we got here
MOZ_LOG(gAudioStreamLog, PR_LOG_DEBUG,
MOZ_LOG(gAudioStreamLog, LogLevel::Debug,
("Not starting waiting %s-latency stream",
mLatencyRequest == LowLatency ? "low" : "high"));
}
@ -612,7 +612,7 @@ AudioStream::Write(const AudioDataValue* aBuf, uint32_t aFrames, TimeStamp *aTim
uint32_t bytesToCopy = FramesToBytes(aFrames);
// XXX this will need to change if we want to enable this on-the-fly!
if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(GetLatencyLog(), LogLevel::Debug)) {
// Record the position and time this data was inserted
int64_t timeMs;
if (aTime && !aTime->IsNull()) {
@ -645,7 +645,7 @@ AudioStream::Write(const AudioDataValue* aBuf, uint32_t aFrames, TimeStamp *aTim
remains = mBuffer.Length() - bytesToCopy; // Free up just enough space
}
// account for dropping samples
MOZ_LOG(gAudioStreamLog, PR_LOG_WARNING, ("Stream %p dropping %u bytes (%u frames)in Write()",
MOZ_LOG(gAudioStreamLog, LogLevel::Warning, ("Stream %p dropping %u bytes (%u frames)in Write()",
this, mBuffer.Length() - remains, BytesToFrames(mBuffer.Length() - remains)));
mReadPoint += BytesToFrames(mBuffer.Length() - remains);
mBuffer.ContractTo(remains);
@ -653,14 +653,14 @@ AudioStream::Write(const AudioDataValue* aBuf, uint32_t aFrames, TimeStamp *aTim
// If we are not playing, but our buffer is full, start playing to make
// room for soon-to-be-decoded data.
if (mState != STARTED && mState != RUNNING) {
MOZ_LOG(gAudioStreamLog, PR_LOG_WARNING, ("Starting stream %p in Write (%u waiting)",
MOZ_LOG(gAudioStreamLog, LogLevel::Warning, ("Starting stream %p in Write (%u waiting)",
this, bytesToCopy));
StartUnlocked();
if (mState == ERRORED) {
return NS_ERROR_FAILURE;
}
}
MOZ_LOG(gAudioStreamLog, PR_LOG_WARNING, ("Stream %p waiting in Write() (%u waiting)",
MOZ_LOG(gAudioStreamLog, LogLevel::Warning, ("Stream %p waiting in Write() (%u waiting)",
this, bytesToCopy));
mon.Wait();
}
@ -1073,16 +1073,16 @@ AudioStream::DataCallback(void* aBuffer, long aFrames)
TimeStamp now = TimeStamp::Now();
if (!mStartTime.IsNull()) {
int64_t timeMs = (now - mStartTime).ToMilliseconds();
MOZ_LOG(gAudioStreamLog, PR_LOG_WARNING,
MOZ_LOG(gAudioStreamLog, LogLevel::Warning,
("Stream took %lldms to start after first Write() @ %u", timeMs, mOutRate));
} else {
MOZ_LOG(gAudioStreamLog, PR_LOG_WARNING,
MOZ_LOG(gAudioStreamLog, LogLevel::Warning,
("Stream started before Write() @ %u", mOutRate));
}
if (old_len != available) {
// Note that we may have dropped samples in Write() as well!
MOZ_LOG(gAudioStreamLog, PR_LOG_WARNING,
MOZ_LOG(gAudioStreamLog, LogLevel::Warning,
("AudioStream %p dropped %u + %u initial frames @ %u", this,
mReadPoint, BytesToFrames(old_len - available), mOutRate));
mReadPoint += BytesToFrames(old_len - available);
@ -1123,7 +1123,7 @@ AudioStream::DataCallback(void* aBuffer, long aFrames)
uint8_t* rpos = static_cast<uint8_t*>(aBuffer) + FramesToBytes(aFrames - underrunFrames);
memset(rpos, 0, FramesToBytes(underrunFrames));
if (underrunFrames) {
MOZ_LOG(gAudioStreamLog, PR_LOG_WARNING,
MOZ_LOG(gAudioStreamLog, LogLevel::Warning,
("AudioStream %p lost %d frames", this, underrunFrames));
}
servicedFrames += underrunFrames;
@ -1133,7 +1133,7 @@ AudioStream::DataCallback(void* aBuffer, long aFrames)
WriteDumpFile(mDumpFile, this, aFrames, aBuffer);
// Don't log if we're not interested or if the stream is inactive
if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG) &&
if (MOZ_LOG_TEST(GetLatencyLog(), LogLevel::Debug) &&
mState != SHUTDOWN &&
insertTime != INT64_MAX && servicedFrames > underrunFrames) {
uint32_t latency = UINT32_MAX;

Просмотреть файл

@ -69,7 +69,7 @@ void GraphDriver::SetGraphTime(GraphDriver* aPreviousDriver,
mStateComputedTime = aLastSwitchStateComputedTime;
mNextStateComputedTime = aLastSwitchNextStateComputedTime;
STREAM_LOG(PR_LOG_DEBUG, ("Setting previous driver: %p (%s)", aPreviousDriver, aPreviousDriver->AsAudioCallbackDriver() ? "AudioCallbackDriver" : "SystemClockDriver"));
STREAM_LOG(LogLevel::Debug, ("Setting previous driver: %p (%s)", aPreviousDriver, aPreviousDriver->AsAudioCallbackDriver() ? "AudioCallbackDriver" : "SystemClockDriver"));
MOZ_ASSERT(!mPreviousDriver);
mPreviousDriver = aPreviousDriver;
}
@ -182,7 +182,7 @@ public:
NS_IMETHOD Run()
{
char aLocal;
STREAM_LOG(PR_LOG_DEBUG, ("Starting system thread"));
STREAM_LOG(LogLevel::Debug, ("Starting system thread"));
profiler_register_thread("MediaStreamGraph", &aLocal);
LIFECYCLE_LOG("Starting a new system driver for graph %p\n",
mDriver->mGraphImpl);
@ -236,7 +236,7 @@ ThreadedDriver::Revive()
{
// Note: only called on MainThread, without monitor
// We know were weren't in a running state
STREAM_LOG(PR_LOG_DEBUG, ("AudioCallbackDriver reviving."));
STREAM_LOG(LogLevel::Debug, ("AudioCallbackDriver reviving."));
// If we were switching, switch now. Otherwise, tell thread to run the main
// loop again.
MonitorAutoLock mon(mGraphImpl->GetMonitor());
@ -256,7 +256,7 @@ ThreadedDriver::Stop()
{
NS_ASSERTION(NS_IsMainThread(), "Must be called on main thread");
// mGraph's thread is not running so it's OK to do whatever here
STREAM_LOG(PR_LOG_DEBUG, ("Stopping threads for MediaStreamGraph %p", this));
STREAM_LOG(LogLevel::Debug, ("Stopping threads for MediaStreamGraph %p", this));
if (mThread) {
mThread->Shutdown();
@ -287,7 +287,7 @@ ThreadedDriver::RunThread()
mNextStateComputedTime =
mGraphImpl->RoundUpToNextAudioBlock(
nextCurrentTime + mGraphImpl->MillisecondsToMediaTime(AUDIO_TARGET_MS));
STREAM_LOG(PR_LOG_DEBUG,
STREAM_LOG(LogLevel::Debug,
("interval[%ld; %ld] state[%ld; %ld]",
(long)mIterationStart, (long)mIterationEnd,
(long)mStateComputedTime, (long)mNextStateComputedTime));
@ -300,7 +300,7 @@ ThreadedDriver::RunThread()
mNextStateComputedTime);
if (mNextDriver && stillProcessing) {
STREAM_LOG(PR_LOG_DEBUG, ("Switching to AudioCallbackDriver"));
STREAM_LOG(LogLevel::Debug, ("Switching to AudioCallbackDriver"));
mNextDriver->SetGraphTime(this, mIterationStart, mIterationEnd,
mStateComputedTime, mNextStateComputedTime);
mGraphImpl->SetCurrentDriver(mNextDriver);
@ -319,20 +319,20 @@ SystemClockDriver::GetIntervalForIteration(GraphTime& aFrom, GraphTime& aTo)
mCurrentTimeStamp = now;
MOZ_LOG(gMediaStreamGraphLog, PR_LOG_DEBUG+1, ("Updating current time to %f (real %f, mStateComputedTime %f)",
MOZ_LOG(gMediaStreamGraphLog, LogLevel::Verbose, ("Updating current time to %f (real %f, mStateComputedTime %f)",
mGraphImpl->MediaTimeToSeconds(aTo),
(now - mInitialTimeStamp).ToSeconds(),
mGraphImpl->MediaTimeToSeconds(StateComputedTime())));
if (mStateComputedTime < aTo) {
STREAM_LOG(PR_LOG_WARNING, ("Media graph global underrun detected"));
STREAM_LOG(LogLevel::Warning, ("Media graph global underrun detected"));
aTo = mIterationEnd = mStateComputedTime;
}
if (aFrom >= aTo) {
NS_ASSERTION(aFrom == aTo , "Time can't go backwards!");
// This could happen due to low clock resolution, maybe?
STREAM_LOG(PR_LOG_DEBUG, ("Time did not advance"));
STREAM_LOG(LogLevel::Debug, ("Time did not advance"));
}
}
@ -363,7 +363,7 @@ SystemClockDriver::WaitForNextIteration()
// least once a minute, if we need to wake up at all
timeoutMS = std::max<int64_t>(0, std::min<int64_t>(timeoutMS, 60*1000));
timeout = PR_MillisecondsToInterval(uint32_t(timeoutMS));
STREAM_LOG(PR_LOG_DEBUG+1, ("Waiting for next iteration; at %f, timeout=%f", (now - mInitialTimeStamp).ToSeconds(), timeoutMS/1000.0));
STREAM_LOG(LogLevel::Verbose, ("Waiting for next iteration; at %f, timeout=%f", (now - mInitialTimeStamp).ToSeconds(), timeoutMS/1000.0));
if (mWaitState == WAITSTATE_WAITING_INDEFINITELY) {
mGraphImpl->mGraphDriverAsleep = false; // atomic
}
@ -374,7 +374,7 @@ SystemClockDriver::WaitForNextIteration()
}
if (timeout > 0) {
mGraphImpl->GetMonitor().Wait(timeout);
STREAM_LOG(PR_LOG_DEBUG+1, ("Resuming after timeout; at %f, elapsed=%f",
STREAM_LOG(LogLevel::Verbose, ("Resuming after timeout; at %f, elapsed=%f",
(TimeStamp::Now() - mInitialTimeStamp).ToSeconds(),
(TimeStamp::Now() - now).ToSeconds()));
}
@ -439,14 +439,14 @@ OfflineClockDriver::GetIntervalForIteration(GraphTime& aFrom, GraphTime& aTo)
aTo = mIterationEnd = IterationEnd() + mGraphImpl->MillisecondsToMediaTime(mSlice);
if (mStateComputedTime < aTo) {
STREAM_LOG(PR_LOG_WARNING, ("Media graph global underrun detected"));
STREAM_LOG(LogLevel::Warning, ("Media graph global underrun detected"));
aTo = mIterationEnd = mStateComputedTime;
}
if (aFrom >= aTo) {
NS_ASSERTION(aFrom == aTo , "Time can't go backwards!");
// This could happen due to low clock resolution, maybe?
STREAM_LOG(PR_LOG_DEBUG, ("Time did not advance"));
STREAM_LOG(LogLevel::Debug, ("Time did not advance"));
}
}
@ -545,7 +545,7 @@ AudioCallbackDriver::AudioCallbackDriver(MediaStreamGraphImpl* aGraphImpl, dom::
, mCallbackReceivedWhileSwitching(0)
#endif
{
STREAM_LOG(PR_LOG_DEBUG, ("AudioCallbackDriver ctor for graph %p", aGraphImpl));
STREAM_LOG(LogLevel::Debug, ("AudioCallbackDriver ctor for graph %p", aGraphImpl));
}
AudioCallbackDriver::~AudioCallbackDriver()
@ -613,21 +613,21 @@ AudioCallbackDriver::Init()
StartStream();
STREAM_LOG(PR_LOG_DEBUG, ("AudioCallbackDriver started."));
STREAM_LOG(LogLevel::Debug, ("AudioCallbackDriver started."));
}
void
AudioCallbackDriver::Destroy()
{
STREAM_LOG(PR_LOG_DEBUG, ("AudioCallbackDriver destroyed."));
STREAM_LOG(LogLevel::Debug, ("AudioCallbackDriver destroyed."));
mAudioStream.reset();
}
void
AudioCallbackDriver::Resume()
{
STREAM_LOG(PR_LOG_DEBUG, ("Resuming audio threads for MediaStreamGraph %p", mGraphImpl));
STREAM_LOG(LogLevel::Debug, ("Resuming audio threads for MediaStreamGraph %p", mGraphImpl));
if (cubeb_stream_start(mAudioStream) != CUBEB_OK) {
NS_WARNING("Could not start cubeb stream for MSG.");
}
@ -639,12 +639,12 @@ AudioCallbackDriver::Start()
// If this is running on the main thread, we can't open the stream directly,
// because it is a blocking operation.
if (NS_IsMainThread()) {
STREAM_LOG(PR_LOG_DEBUG, ("Starting audio threads for MediaStreamGraph %p from a new thread.", mGraphImpl));
STREAM_LOG(LogLevel::Debug, ("Starting audio threads for MediaStreamGraph %p from a new thread.", mGraphImpl));
nsRefPtr<AsyncCubebTask> initEvent =
new AsyncCubebTask(this, AsyncCubebOperation::INIT);
initEvent->Dispatch();
} else {
STREAM_LOG(PR_LOG_DEBUG, ("Starting audio threads for MediaStreamGraph %p from the previous driver's thread", mGraphImpl));
STREAM_LOG(LogLevel::Debug, ("Starting audio threads for MediaStreamGraph %p from the previous driver's thread", mGraphImpl));
Init();
// Check if we need to resolve promises because the driver just got switched
@ -689,7 +689,7 @@ AudioCallbackDriver::Revive()
{
// Note: only called on MainThread, without monitor
// We know were weren't in a running state
STREAM_LOG(PR_LOG_DEBUG, ("AudioCallbackDriver reviving."));
STREAM_LOG(LogLevel::Debug, ("AudioCallbackDriver reviving."));
// If we were switching, switch now. Otherwise, start the audio thread again.
MonitorAutoLock mon(mGraphImpl->GetMonitor());
if (mNextDriver) {
@ -698,7 +698,7 @@ AudioCallbackDriver::Revive()
mGraphImpl->SetCurrentDriver(mNextDriver);
mNextDriver->Start();
} else {
STREAM_LOG(PR_LOG_DEBUG, ("Starting audio threads for MediaStreamGraph %p from a new thread.", mGraphImpl));
STREAM_LOG(LogLevel::Debug, ("Starting audio threads for MediaStreamGraph %p from a new thread.", mGraphImpl));
nsRefPtr<AsyncCubebTask> initEvent =
new AsyncCubebTask(this, AsyncCubebOperation::INIT);
initEvent->Dispatch();
@ -782,9 +782,9 @@ AudioCallbackDriver::OSXDeviceSwitchingWorkaround()
// callback is called "some" number of times, and then stops being called,
// and then gets called again. 10 is to be safe, it's a low-enough number
// of milliseconds anyways (< 100ms)
//STREAM_LOG(PR_LOG_DEBUG, ("Callbacks during switch: %d", mCallbackReceivedWhileSwitching+1));
//STREAM_LOG(LogLevel::Debug, ("Callbacks during switch: %d", mCallbackReceivedWhileSwitching+1));
if (mCallbackReceivedWhileSwitching++ >= 10) {
STREAM_LOG(PR_LOG_DEBUG, ("Got %d callbacks, switching back to CallbackDriver", mCallbackReceivedWhileSwitching));
STREAM_LOG(LogLevel::Debug, ("Got %d callbacks, switching back to CallbackDriver", mCallbackReceivedWhileSwitching));
// If we have a self reference, we have fallen back temporarily on a
// system clock driver, but we just got called back, that means the osx
// audio backend has switched to the new device.
@ -883,7 +883,7 @@ AudioCallbackDriver::DataCallback(AudioDataValue* aBuffer, long aFrames)
// reclock the current time against the state time, here.
mIterationEnd = mIterationStart + 0.8 * inGraph;
STREAM_LOG(PR_LOG_DEBUG, ("interval[%ld; %ld] state[%ld; %ld] (frames: %ld) (durationMS: %u) (duration ticks: %ld)\n",
STREAM_LOG(LogLevel::Debug, ("interval[%ld; %ld] state[%ld; %ld] (frames: %ld) (durationMS: %u) (duration ticks: %ld)\n",
(long)mIterationStart, (long)mIterationEnd,
(long)mStateComputedTime, (long)mNextStateComputedTime,
(long)aFrames, (uint32_t)durationMS,
@ -892,7 +892,7 @@ AudioCallbackDriver::DataCallback(AudioDataValue* aBuffer, long aFrames)
mCurrentTimeStamp = TimeStamp::Now();
if (mStateComputedTime < mIterationEnd) {
STREAM_LOG(PR_LOG_WARNING, ("Media graph global underrun detected"));
STREAM_LOG(LogLevel::Warning, ("Media graph global underrun detected"));
mIterationEnd = mStateComputedTime;
}
@ -916,7 +916,7 @@ AudioCallbackDriver::DataCallback(AudioDataValue* aBuffer, long aFrames)
return aFrames;
}
}
STREAM_LOG(PR_LOG_DEBUG, ("Switching to system driver."));
STREAM_LOG(LogLevel::Debug, ("Switching to system driver."));
mNextDriver->SetGraphTime(this, mIterationStart, mIterationEnd,
mStateComputedTime, mNextStateComputedTime);
mGraphImpl->SetCurrentDriver(mNextDriver);
@ -936,7 +936,7 @@ AudioCallbackDriver::DataCallback(AudioDataValue* aBuffer, long aFrames)
void
AudioCallbackDriver::StateCallback(cubeb_state aState)
{
STREAM_LOG(PR_LOG_DEBUG, ("AudioCallbackDriver State: %d", aState));
STREAM_LOG(LogLevel::Debug, ("AudioCallbackDriver State: %d", aState));
}
void
@ -1020,7 +1020,7 @@ AudioCallbackDriver::DeviceChangedCallback() {
if (mSelfReference) {
return;
}
STREAM_LOG(PR_LOG_ERROR, ("Switching to SystemClockDriver during output switch"));
STREAM_LOG(LogLevel::Error, ("Switching to SystemClockDriver during output switch"));
mSelfReference.Take(this);
mCallbackReceivedWhileSwitching = 0;
mGraphImpl->mFlushSourcesOnNextIteration = true;

Просмотреть файл

@ -191,11 +191,11 @@ void AsyncLatencyLogger::WriteLog(LatencyLogIndex aIndex, uint64_t aID, int64_t
TimeStamp aTimeStamp)
{
if (aTimeStamp.IsNull()) {
MOZ_LOG(GetLatencyLog(), PR_LOG_DEBUG,
MOZ_LOG(GetLatencyLog(), LogLevel::Debug,
("Latency: %s,%llu,%lld,%lld",
LatencyLogIndex2Strings[aIndex], aID, GetTimeStamp(), aValue));
} else {
MOZ_LOG(GetLatencyLog(), PR_LOG_DEBUG,
MOZ_LOG(GetLatencyLog(), LogLevel::Debug,
("Latency: %s,%llu,%lld,%lld,%lld",
LatencyLogIndex2Strings[aIndex], aID, GetTimeStamp(), aValue,
static_cast<int64_t>((aTimeStamp - gAsyncLogger->mStart).ToMilliseconds())));
@ -216,7 +216,7 @@ void AsyncLatencyLogger::Log(LatencyLogIndex aIndex, uint64_t aID, int64_t aValu
void AsyncLatencyLogger::Log(LatencyLogIndex aIndex, uint64_t aID, int64_t aValue, TimeStamp &aTime)
{
if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(GetLatencyLog(), LogLevel::Debug)) {
nsCOMPtr<nsIRunnable> event = new LogEvent(aIndex, aID, aValue, aTime);
if (mThread) {
mThread->Dispatch(event, NS_DISPATCH_NORMAL);

Просмотреть файл

@ -955,7 +955,7 @@ MediaCache::FreeBlock(int32_t aBlock)
return;
}
CACHE_LOG(PR_LOG_DEBUG, ("Released block %d", aBlock));
CACHE_LOG(LogLevel::Debug, ("Released block %d", aBlock));
for (uint32_t i = 0; i < block->mOwners.Length(); ++i) {
BlockOwner* bo = &block->mOwners[i];
@ -1121,17 +1121,17 @@ MediaCache::Update()
if (NS_SUCCEEDED(rv)) {
// We successfully copied the file data.
CACHE_LOG(PR_LOG_DEBUG, ("Swapping blocks %d and %d (trimming cache)",
CACHE_LOG(LogLevel::Debug, ("Swapping blocks %d and %d (trimming cache)",
blockIndex, destinationBlockIndex));
// Swapping the block metadata here lets us maintain the
// correct positions in the linked lists
SwapBlocks(blockIndex, destinationBlockIndex);
//Free the overflowing block even if the copy failed.
CACHE_LOG(PR_LOG_DEBUG, ("Released block %d (trimming cache)", blockIndex));
CACHE_LOG(LogLevel::Debug, ("Released block %d (trimming cache)", blockIndex));
FreeBlock(blockIndex);
}
} else {
CACHE_LOG(PR_LOG_DEBUG, ("Could not trim cache block %d (destination %d, predicted next use %f, latest predicted use for overflow %f",
CACHE_LOG(LogLevel::Debug, ("Could not trim cache block %d (destination %d, predicted next use %f, latest predicted use for overflow %f",
blockIndex, destinationBlockIndex,
PredictNextUse(now, destinationBlockIndex).ToSeconds(),
latestPredictedUseForOverflow.ToSeconds()));
@ -1169,7 +1169,7 @@ MediaCache::Update()
MediaCacheStream* stream = mStreams[i];
if (stream->mClosed) {
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p closed", stream));
CACHE_LOG(LogLevel::Debug, ("Stream %p closed", stream));
continue;
}
@ -1220,29 +1220,29 @@ MediaCache::Update()
// advertised with Content-Length, and we may as well keep reading.
// But we don't want to seek to the end of the stream if we're not
// already there.
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p at end of stream", stream));
CACHE_LOG(LogLevel::Debug, ("Stream %p at end of stream", stream));
enableReading = !stream->mCacheSuspended &&
stream->mStreamLength == stream->mChannelOffset;
} else if (desiredOffset < stream->mStreamOffset) {
// We're reading to try to catch up to where the current stream
// reader wants to be. Better not stop.
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p catching up", stream));
CACHE_LOG(LogLevel::Debug, ("Stream %p catching up", stream));
enableReading = true;
} else if (desiredOffset < stream->mStreamOffset + BLOCK_SIZE) {
// The stream reader is waiting for us, or nearly so. Better feed it.
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p feeding reader", stream));
CACHE_LOG(LogLevel::Debug, ("Stream %p feeding reader", stream));
enableReading = true;
} else if (!stream->mIsTransportSeekable &&
nonSeekableReadaheadBlockCount >= maxBlocks*NONSEEKABLE_READAHEAD_MAX) {
// This stream is not seekable and there are already too many blocks
// being cached for readahead for nonseekable streams (which we can't
// free). So stop reading ahead now.
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p throttling non-seekable readahead", stream));
CACHE_LOG(LogLevel::Debug, ("Stream %p throttling non-seekable readahead", stream));
enableReading = false;
} else if (mIndex.Length() > uint32_t(maxBlocks)) {
// We're in the process of bringing the cache size back to the
// desired limit, so don't bring in more data yet
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p throttling to reduce cache size", stream));
CACHE_LOG(LogLevel::Debug, ("Stream %p throttling to reduce cache size", stream));
enableReading = false;
} else {
TimeDuration predictedNewDataUse = PredictNextUseForIncomingData(stream);
@ -1250,24 +1250,24 @@ MediaCache::Update()
if (stream->mCacheSuspended &&
predictedNewDataUse.ToSeconds() > resumeThreshold) {
// Don't need data for a while, so don't bother waking up the stream
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p avoiding wakeup since more data is not needed", stream));
CACHE_LOG(LogLevel::Debug, ("Stream %p avoiding wakeup since more data is not needed", stream));
enableReading = false;
} else if (predictedNewDataUse.ToSeconds() > readaheadLimit) {
// Don't read ahead more than this much
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p throttling to avoid reading ahead too far", stream));
CACHE_LOG(LogLevel::Debug, ("Stream %p throttling to avoid reading ahead too far", stream));
enableReading = false;
} else if (freeBlockCount > 0) {
// Free blocks in the cache, so keep reading
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p reading since there are free blocks", stream));
CACHE_LOG(LogLevel::Debug, ("Stream %p reading since there are free blocks", stream));
enableReading = true;
} else if (latestNextUse <= TimeDuration(0)) {
// No reusable blocks, so can't read anything
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p throttling due to no reusable blocks", stream));
CACHE_LOG(LogLevel::Debug, ("Stream %p throttling due to no reusable blocks", stream));
enableReading = false;
} else {
// Read ahead if the data we expect to read is more valuable than
// the least valuable block in the main part of the cache
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p predict next data in %f, current worst block is %f",
CACHE_LOG(LogLevel::Debug, ("Stream %p predict next data in %f, current worst block is %f",
stream, predictedNewDataUse.ToSeconds(), latestNextUse.ToSeconds()));
enableReading = predictedNewDataUse < latestNextUse;
}
@ -1282,7 +1282,7 @@ MediaCache::Update()
// This block is already going to be read by the other stream.
// So don't try to read it from this stream as well.
enableReading = false;
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p waiting on same block (%lld) from stream %p",
CACHE_LOG(LogLevel::Debug, ("Stream %p waiting on same block (%lld) from stream %p",
stream, desiredOffset/BLOCK_SIZE, other));
break;
}
@ -1346,18 +1346,18 @@ MediaCache::Update()
switch (actions[i]) {
case SEEK:
case SEEK_AND_RESUME:
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p CacheSeek to %lld (resume=%d)", stream,
CACHE_LOG(LogLevel::Debug, ("Stream %p CacheSeek to %lld (resume=%d)", stream,
(long long)stream->mChannelOffset, actions[i] == SEEK_AND_RESUME));
rv = stream->mClient->CacheClientSeek(stream->mChannelOffset,
actions[i] == SEEK_AND_RESUME);
break;
case RESUME:
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p Resumed", stream));
CACHE_LOG(LogLevel::Debug, ("Stream %p Resumed", stream));
rv = stream->mClient->CacheClientResume();
QueueSuspendedStatusUpdate(stream->mResourceID);
break;
case SUSPEND:
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p Suspended", stream));
CACHE_LOG(LogLevel::Debug, ("Stream %p Suspended", stream));
rv = stream->mClient->CacheClientSuspend();
QueueSuspendedStatusUpdate(stream->mResourceID);
break;
@ -1497,7 +1497,7 @@ MediaCache::AllocateAndWriteBlock(MediaCacheStream* aStream, const void* aData,
if (stream->mBlocks[streamBlockIndex] >= 0) {
// We no longer want to own this block
int32_t globalBlockIndex = stream->mBlocks[streamBlockIndex];
CACHE_LOG(PR_LOG_DEBUG, ("Released block %d from stream %p block %d(%lld)",
CACHE_LOG(LogLevel::Debug, ("Released block %d from stream %p block %d(%lld)",
globalBlockIndex, stream, streamBlockIndex, (long long)streamBlockIndex*BLOCK_SIZE));
RemoveBlockOwner(globalBlockIndex, stream);
}
@ -1511,7 +1511,7 @@ MediaCache::AllocateAndWriteBlock(MediaCacheStream* aStream, const void* aData,
FreeBlock(blockIndex);
Block* block = &mIndex[blockIndex];
CACHE_LOG(PR_LOG_DEBUG, ("Allocated block %d to stream %p block %d(%lld)",
CACHE_LOG(LogLevel::Debug, ("Allocated block %d to stream %p block %d(%lld)",
blockIndex, aStream, streamBlockIndex, (long long)streamBlockIndex*BLOCK_SIZE));
mFreeBlocks.RemoveBlock(blockIndex);
@ -1546,7 +1546,7 @@ MediaCache::AllocateAndWriteBlock(MediaCacheStream* aStream, const void* aData,
nsresult rv = mFileCache->WriteBlock(blockIndex, reinterpret_cast<const uint8_t*>(aData));
if (NS_FAILED(rv)) {
CACHE_LOG(PR_LOG_DEBUG, ("Released block %d from stream %p block %d(%lld)",
CACHE_LOG(LogLevel::Debug, ("Released block %d from stream %p block %d(%lld)",
blockIndex, aStream, streamBlockIndex, (long long)streamBlockIndex*BLOCK_SIZE));
FreeBlock(blockIndex);
}
@ -1563,7 +1563,7 @@ MediaCache::OpenStream(MediaCacheStream* aStream)
NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p opened", aStream));
CACHE_LOG(LogLevel::Debug, ("Stream %p opened", aStream));
mStreams.AppendElement(aStream);
aStream->mResourceID = AllocateResourceID();
@ -1577,7 +1577,7 @@ MediaCache::ReleaseStream(MediaCacheStream* aStream)
NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p closed", aStream));
CACHE_LOG(LogLevel::Debug, ("Stream %p closed", aStream));
mStreams.RemoveElement(aStream);
// Update MediaCache again for |mStreams| is changed.
@ -1598,7 +1598,7 @@ MediaCache::ReleaseStreamBlocks(MediaCacheStream* aStream)
for (uint32_t i = 0; i < length; ++i) {
int32_t blockIndex = aStream->mBlocks[i];
if (blockIndex >= 0) {
CACHE_LOG(PR_LOG_DEBUG, ("Released block %d from stream %p block %d(%lld)",
CACHE_LOG(LogLevel::Debug, ("Released block %d from stream %p block %d(%lld)",
blockIndex, aStream, i, (long long)i*BLOCK_SIZE));
RemoveBlockOwner(blockIndex, aStream);
}
@ -1769,7 +1769,7 @@ MediaCacheStream::NotifyDataReceived(int64_t aSize, const char* aData,
int64_t size = aSize;
const char* data = aData;
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p DataReceived at %lld count=%lld",
CACHE_LOG(LogLevel::Debug, ("Stream %p DataReceived at %lld count=%lld",
this, (long long)mChannelOffset, (long long)aSize));
// We process the data one block (or part of a block) at a time
@ -1837,7 +1837,7 @@ MediaCacheStream::FlushPartialBlockInternal(bool aNotifyAll)
int32_t blockOffset = int32_t(mChannelOffset%BLOCK_SIZE);
if (blockOffset > 0) {
CACHE_LOG(PR_LOG_DEBUG,
CACHE_LOG(LogLevel::Debug,
("Stream %p writing partial block: [%d] bytes; "
"mStreamOffset [%lld] mChannelOffset[%lld] mStreamLength [%lld] "
"notifying: [%s]",
@ -2186,7 +2186,7 @@ MediaCacheStream::Seek(int32_t aWhence, int64_t aOffset)
return NS_ERROR_FAILURE;
mStreamOffset = newOffset;
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p Seek to %lld", this, (long long)mStreamOffset));
CACHE_LOG(LogLevel::Debug, ("Stream %p Seek to %lld", this, (long long)mStreamOffset));
gMediaCache->NoteSeek(this, oldOffset);
gMediaCache->QueueUpdate();
@ -2303,7 +2303,7 @@ MediaCacheStream::Read(char* aBuffer, uint32_t aCount, uint32_t* aBytes)
// have changed
gMediaCache->QueueUpdate();
}
CACHE_LOG(PR_LOG_DEBUG,
CACHE_LOG(LogLevel::Debug,
("Stream %p Read at %lld count=%d", this, (long long)(mStreamOffset-count), count));
*aBytes = count;
return NS_OK;

Просмотреть файл

@ -53,7 +53,7 @@ static const int64_t CAN_PLAY_THROUGH_MARGIN = 1;
PRLogModuleInfo* gMediaDecoderLog;
#define DECODER_LOG(x, ...) \
MOZ_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("Decoder=%p " x, this, ##__VA_ARGS__))
MOZ_LOG(gMediaDecoderLog, LogLevel::Debug, ("Decoder=%p " x, this, ##__VA_ARGS__))
static const char* const gPlayStateStr[] = {
"START",

Просмотреть файл

@ -22,7 +22,7 @@ namespace mozilla {
extern PRLogModuleInfo* gMediaDecoderLog;
#define DECODER_LOG(x, ...) \
MOZ_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("Decoder=%p " x, mDecoder, ##__VA_ARGS__))
MOZ_LOG(gMediaDecoderLog, LogLevel::Debug, ("Decoder=%p " x, mDecoder, ##__VA_ARGS__))
// Same workaround as MediaDecoderStateMachine.cpp.
#define DECODER_WARN_HELPER(a, b) NS_WARNING b

Просмотреть файл

@ -60,11 +60,11 @@ extern PRLogModuleInfo* gMediaSampleLog;
#define LOG(m, l, x, ...) \
MOZ_LOG(m, l, ("Decoder=%p " x, mDecoder.get(), ##__VA_ARGS__))
#define DECODER_LOG(x, ...) \
LOG(gMediaDecoderLog, PR_LOG_DEBUG, x, ##__VA_ARGS__)
LOG(gMediaDecoderLog, LogLevel::Debug, x, ##__VA_ARGS__)
#define VERBOSE_LOG(x, ...) \
LOG(gMediaDecoderLog, PR_LOG_DEBUG+1, x, ##__VA_ARGS__)
LOG(gMediaDecoderLog, LogLevel::Verbose, x, ##__VA_ARGS__)
#define SAMPLE_LOG(x, ...) \
LOG(gMediaSampleLog, PR_LOG_DEBUG, x, ##__VA_ARGS__)
LOG(gMediaSampleLog, LogLevel::Debug, x, ##__VA_ARGS__)
// Somehow MSVC doesn't correctly delete the comma before ##__VA_ARGS__
// when __VA_ARGS__ expands to nothing. This is a workaround for it.

Просмотреть файл

@ -35,8 +35,8 @@ PRLogModuleInfo* GetFormatDecoderLog() {
}
return log;
}
#define LOG(arg, ...) MOZ_LOG(GetFormatDecoderLog(), PR_LOG_DEBUG, ("MediaFormatReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define LOGV(arg, ...) MOZ_LOG(GetFormatDecoderLog(), PR_LOG_DEBUG+1, ("MediaFormatReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define LOG(arg, ...) MOZ_LOG(GetFormatDecoderLog(), mozilla::LogLevel::Debug, ("MediaFormatReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define LOGV(arg, ...) MOZ_LOG(GetFormatDecoderLog(), mozilla::LogLevel::Verbose, ("MediaFormatReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
namespace mozilla {

Просмотреть файл

@ -111,7 +111,7 @@ GetMediaManagerLog()
sLog = PR_NewLogModule("MediaManager");
return sLog;
}
#define LOG(msg) MOZ_LOG(GetMediaManagerLog(), PR_LOG_DEBUG, msg)
#define LOG(msg) MOZ_LOG(GetMediaManagerLog(), mozilla::LogLevel::Debug, msg)
using dom::File;
using dom::MediaStreamConstraints;

Просмотреть файл

@ -49,7 +49,7 @@ struct MediaTrackConstraintSet;
}
extern PRLogModuleInfo* GetMediaManagerLog();
#define MM_LOG(msg) MOZ_LOG(GetMediaManagerLog(), PR_LOG_DEBUG, msg)
#define MM_LOG(msg) MOZ_LOG(GetMediaManagerLog(), mozilla::LogLevel::Debug, msg)
/**
* This class is an implementation of MediaStreamListener. This is used

Просмотреть файл

@ -31,7 +31,7 @@ extern PRLogModuleInfo* gMediaPromiseLog;
#define PROMISE_LOG(x, ...) \
MOZ_ASSERT(gMediaPromiseLog); \
MOZ_LOG(gMediaPromiseLog, PR_LOG_DEBUG, (x, ##__VA_ARGS__))
MOZ_LOG(gMediaPromiseLog, mozilla::LogLevel::Debug, (x, ##__VA_ARGS__))
namespace detail {
template<typename ThisType, typename Ret, typename ArgType>

Просмотреть файл

@ -168,7 +168,7 @@ class MediaRecorder::Session: public nsIObserver
NS_IMETHODIMP Run()
{
LOG(PR_LOG_DEBUG, ("Session.PushBlobRunnable s=(%p)", mSession.get()));
LOG(LogLevel::Debug, ("Session.PushBlobRunnable s=(%p)", mSession.get()));
MOZ_ASSERT(NS_IsMainThread());
nsRefPtr<MediaRecorder> recorder = mSession->mRecorder;
@ -198,7 +198,7 @@ class MediaRecorder::Session: public nsIObserver
NS_IMETHODIMP Run()
{
LOG(PR_LOG_DEBUG, ("Session.ErrorNotifyRunnable s=(%p)", mSession.get()));
LOG(LogLevel::Debug, ("Session.ErrorNotifyRunnable s=(%p)", mSession.get()));
MOZ_ASSERT(NS_IsMainThread());
nsRefPtr<MediaRecorder> recorder = mSession->mRecorder;
@ -227,7 +227,7 @@ class MediaRecorder::Session: public nsIObserver
NS_IMETHODIMP Run()
{
LOG(PR_LOG_DEBUG, ("Session.DispatchStartEventRunnable s=(%p)", mSession.get()));
LOG(LogLevel::Debug, ("Session.DispatchStartEventRunnable s=(%p)", mSession.get()));
MOZ_ASSERT(NS_IsMainThread());
NS_ENSURE_TRUE(mSession->mRecorder, NS_OK);
@ -259,7 +259,7 @@ class MediaRecorder::Session: public nsIObserver
{
MOZ_ASSERT(NS_GetCurrentThread() == mSession->mReadThread);
LOG(PR_LOG_DEBUG, ("Session.ExtractRunnable shutdown = %d", mSession->mEncoder->IsShutdown()));
LOG(LogLevel::Debug, ("Session.ExtractRunnable shutdown = %d", mSession->mEncoder->IsShutdown()));
if (!mSession->mEncoder->IsShutdown()) {
mSession->Extract(false);
nsCOMPtr<nsIRunnable> event = new ExtractRunnable(mSession);
@ -304,7 +304,7 @@ class MediaRecorder::Session: public nsIObserver
trackTypes |= ContainerWriter::CREATE_VIDEO_TRACK;
}
LOG(PR_LOG_DEBUG, ("Session.NotifyTracksAvailable track type = (%d)", trackTypes));
LOG(LogLevel::Debug, ("Session.NotifyTracksAvailable track type = (%d)", trackTypes));
mSession->InitEncoder(trackTypes);
}
private:
@ -320,7 +320,7 @@ class MediaRecorder::Session: public nsIObserver
NS_IMETHODIMP Run()
{
LOG(PR_LOG_DEBUG, ("Session.DestroyRunnable session refcnt = (%d) stopIssued %d s=(%p)",
LOG(LogLevel::Debug, ("Session.DestroyRunnable session refcnt = (%d) stopIssued %d s=(%p)",
(int)mSession->mRefCnt, mSession->mStopIssued, mSession.get()));
MOZ_ASSERT(NS_IsMainThread() && mSession.get());
nsRefPtr<MediaRecorder> recorder = mSession->mRecorder;
@ -381,7 +381,7 @@ public:
void Start()
{
LOG(PR_LOG_DEBUG, ("Session.Start %p", this));
LOG(LogLevel::Debug, ("Session.Start %p", this));
MOZ_ASSERT(NS_IsMainThread());
SetupStreams();
@ -389,12 +389,12 @@ public:
void Stop()
{
LOG(PR_LOG_DEBUG, ("Session.Stop %p", this));
LOG(LogLevel::Debug, ("Session.Stop %p", this));
MOZ_ASSERT(NS_IsMainThread());
mStopIssued = true;
CleanupStreams();
if (mNeedSessionEndTask) {
LOG(PR_LOG_DEBUG, ("Session.Stop mNeedSessionEndTask %p", this));
LOG(LogLevel::Debug, ("Session.Stop mNeedSessionEndTask %p", this));
// End the Session directly if there is no ExtractRunnable.
DoSessionEndTask(NS_OK);
}
@ -403,7 +403,7 @@ public:
nsresult Pause()
{
LOG(PR_LOG_DEBUG, ("Session.Pause"));
LOG(LogLevel::Debug, ("Session.Pause"));
MOZ_ASSERT(NS_IsMainThread());
NS_ENSURE_TRUE(mTrackUnionStream, NS_ERROR_FAILURE);
@ -414,7 +414,7 @@ public:
nsresult Resume()
{
LOG(PR_LOG_DEBUG, ("Session.Resume"));
LOG(LogLevel::Debug, ("Session.Resume"));
MOZ_ASSERT(NS_IsMainThread());
NS_ENSURE_TRUE(mTrackUnionStream, NS_ERROR_FAILURE);
@ -425,7 +425,7 @@ public:
nsresult RequestData()
{
LOG(PR_LOG_DEBUG, ("Session.RequestData"));
LOG(LogLevel::Debug, ("Session.RequestData"));
MOZ_ASSERT(NS_IsMainThread());
if (NS_FAILED(NS_DispatchToMainThread(new EncoderErrorNotifierRunnable(this))) ||
@ -464,7 +464,7 @@ private:
// Only DestroyRunnable is allowed to delete Session object.
virtual ~Session()
{
LOG(PR_LOG_DEBUG, ("Session.~Session (%p)", this));
LOG(LogLevel::Debug, ("Session.~Session (%p)", this));
CleanupStreams();
}
// Pull encoded media data from MediaEncoder and put into EncodedBufferCache.
@ -474,7 +474,7 @@ private:
void Extract(bool aForceFlush)
{
MOZ_ASSERT(NS_GetCurrentThread() == mReadThread);
LOG(PR_LOG_DEBUG, ("Session.Extract %p", this));
LOG(LogLevel::Debug, ("Session.Extract %p", this));
if (!mIsRegisterProfiler) {
char aLocal;
@ -577,11 +577,11 @@ private:
void InitEncoder(uint8_t aTrackTypes)
{
LOG(PR_LOG_DEBUG, ("Session.InitEncoder %p", this));
LOG(LogLevel::Debug, ("Session.InitEncoder %p", this));
MOZ_ASSERT(NS_IsMainThread());
if (!mRecorder) {
LOG(PR_LOG_DEBUG, ("Session.InitEncoder failure, mRecorder is null %p", this));
LOG(LogLevel::Debug, ("Session.InitEncoder failure, mRecorder is null %p", this));
return;
}
// Allocate encoder and bind with union stream.
@ -595,7 +595,7 @@ private:
}
if (!mEncoder) {
LOG(PR_LOG_DEBUG, ("Session.InitEncoder !mEncoder %p", this));
LOG(LogLevel::Debug, ("Session.InitEncoder !mEncoder %p", this));
DoSessionEndTask(NS_ERROR_ABORT);
return;
}
@ -604,7 +604,7 @@ private:
// The Session::stop would clean the mTrackUnionStream. If the AfterTracksAdded
// comes after stop command, this function would crash.
if (!mTrackUnionStream) {
LOG(PR_LOG_DEBUG, ("Session.InitEncoder !mTrackUnionStream %p", this));
LOG(LogLevel::Debug, ("Session.InitEncoder !mTrackUnionStream %p", this));
DoSessionEndTask(NS_OK);
return;
}
@ -613,7 +613,7 @@ private:
if (!mReadThread) {
nsresult rv = NS_NewNamedThread("Media_Encoder", getter_AddRefs(mReadThread));
if (NS_FAILED(rv)) {
LOG(PR_LOG_DEBUG, ("Session.InitEncoder !mReadThread %p", this));
LOG(LogLevel::Debug, ("Session.InitEncoder !mReadThread %p", this));
DoSessionEndTask(rv);
return;
}
@ -626,7 +626,7 @@ private:
nsCOMPtr<nsIRunnable> event = new ExtractRunnable(this);
if (NS_FAILED(mReadThread->Dispatch(event, NS_DISPATCH_NORMAL))) {
NS_WARNING("Failed to dispatch ExtractRunnable at beginning");
LOG(PR_LOG_DEBUG, ("Session.InitEncoder !ReadThread->Dispatch %p", this));
LOG(LogLevel::Debug, ("Session.InitEncoder !ReadThread->Dispatch %p", this));
DoSessionEndTask(NS_ERROR_ABORT);
}
// Set mNeedSessionEndTask to false because the
@ -672,7 +672,7 @@ private:
NS_IMETHODIMP Observe(nsISupports *aSubject, const char *aTopic, const char16_t *aData) override
{
MOZ_ASSERT(NS_IsMainThread());
LOG(PR_LOG_DEBUG, ("Session.Observe XPCOM_SHUTDOWN %p", this));
LOG(LogLevel::Debug, ("Session.Observe XPCOM_SHUTDOWN %p", this));
if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
// Force stop Session to terminate Read Thread.
mEncoder->Cancel();
@ -742,7 +742,7 @@ MediaRecorder::~MediaRecorder()
mInputPort->Destroy();
mPipeStream->Destroy();
}
LOG(PR_LOG_DEBUG, ("~MediaRecorder (%p)", this));
LOG(LogLevel::Debug, ("~MediaRecorder (%p)", this));
UnRegisterActivityObserver();
}
@ -832,7 +832,7 @@ MediaRecorder::GetMimeType(nsString &aMimeType)
void
MediaRecorder::Start(const Optional<int32_t>& aTimeSlice, ErrorResult& aResult)
{
LOG(PR_LOG_DEBUG, ("MediaRecorder.Start %p", this));
LOG(LogLevel::Debug, ("MediaRecorder.Start %p", this));
if (mState != RecordingState::Inactive) {
aResult.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
@ -874,7 +874,7 @@ MediaRecorder::Start(const Optional<int32_t>& aTimeSlice, ErrorResult& aResult)
void
MediaRecorder::Stop(ErrorResult& aResult)
{
LOG(PR_LOG_DEBUG, ("MediaRecorder.Stop %p", this));
LOG(LogLevel::Debug, ("MediaRecorder.Stop %p", this));
MediaRecorderReporter::RemoveMediaRecorder(this);
if (mState == RecordingState::Inactive) {
aResult.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
@ -888,7 +888,7 @@ MediaRecorder::Stop(ErrorResult& aResult)
void
MediaRecorder::Pause(ErrorResult& aResult)
{
LOG(PR_LOG_DEBUG, ("MediaRecorder.Pause"));
LOG(LogLevel::Debug, ("MediaRecorder.Pause"));
if (mState != RecordingState::Recording) {
aResult.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
@ -906,7 +906,7 @@ MediaRecorder::Pause(ErrorResult& aResult)
void
MediaRecorder::Resume(ErrorResult& aResult)
{
LOG(PR_LOG_DEBUG, ("MediaRecorder.Resume"));
LOG(LogLevel::Debug, ("MediaRecorder.Resume"));
if (mState != RecordingState::Paused) {
aResult.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
@ -1112,7 +1112,7 @@ bool MediaRecorder::CheckPrincipal()
void
MediaRecorder::RemoveSession(Session* aSession)
{
LOG(PR_LOG_DEBUG, ("MediaRecorder.RemoveSession (%p)", aSession));
LOG(LogLevel::Debug, ("MediaRecorder.RemoveSession (%p)", aSession));
mSessions.RemoveElement(aSession);
}
@ -1124,7 +1124,7 @@ MediaRecorder::NotifyOwnerDocumentActivityChanged()
nsIDocument* doc = window->GetExtantDoc();
NS_ENSURE_TRUE_VOID(doc);
LOG(PR_LOG_DEBUG, ("MediaRecorder %p document IsActive %d isVisible %d\n",
LOG(LogLevel::Debug, ("MediaRecorder %p document IsActive %d isVisible %d\n",
this, doc->IsActive(), doc->IsVisible()));
if (!doc->IsActive() || !doc->IsVisible()) {
// Stop the session.

Просмотреть файл

@ -34,7 +34,7 @@
#include "nsIContentPolicy.h"
PRLogModuleInfo* gMediaResourceLog;
#define RESOURCE_LOG(msg, ...) MOZ_LOG(gMediaResourceLog, PR_LOG_DEBUG, \
#define RESOURCE_LOG(msg, ...) MOZ_LOG(gMediaResourceLog, mozilla::LogLevel::Debug, \
(msg, ##__VA_ARGS__))
// Debug logging macro with object pointer and class name.
#define CMLOG(msg, ...) \

Просмотреть файл

@ -113,7 +113,7 @@ MediaShutdownManager::Shutdown()
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(sInstance);
DECODER_LOG(PR_LOG_DEBUG, ("MediaShutdownManager::Shutdown() start..."));
DECODER_LOG(LogLevel::Debug, ("MediaShutdownManager::Shutdown() start..."));
// Mark that we're shutting down, so that Unregister(*) calls don't remove
// hashtable entries. If Unregsiter(*) was to remove from the hash table,
@ -139,7 +139,7 @@ MediaShutdownManager::Shutdown()
// up after it finishes its notifications.
sInstance = nullptr;
DECODER_LOG(PR_LOG_DEBUG, ("MediaShutdownManager::Shutdown() end."));
DECODER_LOG(LogLevel::Debug, ("MediaShutdownManager::Shutdown() end."));
}
} // namespace mozilla

Просмотреть файл

@ -68,7 +68,7 @@ MediaStreamGraphImpl::~MediaStreamGraphImpl()
{
NS_ASSERTION(IsEmpty(),
"All streams should have been destroyed by messages from the main thread");
STREAM_LOG(PR_LOG_DEBUG, ("MediaStreamGraph %p destroyed", this));
STREAM_LOG(LogLevel::Debug, ("MediaStreamGraph %p destroyed", this));
LIFECYCLE_LOG("MediaStreamGraphImpl::~MediaStreamGraphImpl\n");
}
@ -88,7 +88,7 @@ MediaStreamGraphImpl::FinishStream(MediaStream* aStream)
{
if (aStream->mFinished)
return;
STREAM_LOG(PR_LOG_DEBUG, ("MediaStream %p will finish", aStream));
STREAM_LOG(LogLevel::Debug, ("MediaStream %p will finish", aStream));
aStream->mFinished = true;
aStream->mBuffer.AdvanceKnownTracksTime(STREAM_TIME_MAX);
// Force at least one more iteration of the control loop, since we rely
@ -118,11 +118,11 @@ MediaStreamGraphImpl::AddStream(MediaStream* aStream)
if (contextSuspended) {
aStream->mBufferStartTime = START_TIME_DELAYED;
mSuspendedStreams.AppendElement(aStream);
STREAM_LOG(PR_LOG_DEBUG, ("Adding media stream %p to the graph, in the suspended stream array", aStream));
STREAM_LOG(LogLevel::Debug, ("Adding media stream %p to the graph, in the suspended stream array", aStream));
} else {
aStream->mBufferStartTime = IterationEnd();
mStreams.AppendElement(aStream);
STREAM_LOG(PR_LOG_DEBUG, ("Adding media stream %p to the graph", aStream));
STREAM_LOG(LogLevel::Debug, ("Adding media stream %p to the graph", aStream));
}
SetStreamOrderDirty();
@ -151,7 +151,7 @@ MediaStreamGraphImpl::RemoveStream(MediaStream* aStream)
NS_RELEASE(aStream); // probably destroying it
STREAM_LOG(PR_LOG_DEBUG, ("Removing media stream %p from the graph", aStream));
STREAM_LOG(LogLevel::Debug, ("Removing media stream %p from the graph", aStream));
}
void
@ -185,14 +185,14 @@ MediaStreamGraphImpl::ExtractPendingInput(SourceMediaStream* aStream,
StreamTime t =
GraphTimeToStreamTime(aStream, CurrentDriver()->StateComputedTime()) +
(aDesiredUpToTime - CurrentDriver()->StateComputedTime());
STREAM_LOG(PR_LOG_DEBUG+1, ("Calling NotifyPull aStream=%p t=%f current end=%f", aStream,
STREAM_LOG(LogLevel::Verbose, ("Calling NotifyPull aStream=%p t=%f current end=%f", aStream,
MediaTimeToSeconds(t),
MediaTimeToSeconds(aStream->mBuffer.GetEnd())));
if (t > aStream->mBuffer.GetEnd()) {
*aEnsureNextIteration = true;
#ifdef DEBUG
if (aStream->mListeners.Length() == 0) {
STREAM_LOG(PR_LOG_ERROR, ("No listeners in NotifyPull aStream=%p desired=%f current end=%f",
STREAM_LOG(LogLevel::Error, ("No listeners in NotifyPull aStream=%p desired=%f current end=%f",
aStream, MediaTimeToSeconds(t),
MediaTimeToSeconds(aStream->mBuffer.GetEnd())));
aStream->DumpTrackInfo();
@ -220,7 +220,7 @@ MediaStreamGraphImpl::ExtractPendingInput(SourceMediaStream* aStream,
}
if (data->mCommands & SourceMediaStream::TRACK_CREATE) {
MediaSegment* segment = data->mData.forget();
STREAM_LOG(PR_LOG_DEBUG, ("SourceMediaStream %p creating track %d, start %lld, initial end %lld",
STREAM_LOG(LogLevel::Debug, ("SourceMediaStream %p creating track %d, start %lld, initial end %lld",
aStream, data->mID, int64_t(data->mStart),
int64_t(segment->GetDuration())));
@ -233,7 +233,7 @@ MediaStreamGraphImpl::ExtractPendingInput(SourceMediaStream* aStream,
notifiedTrackCreated = true;
} else if (data->mData->GetDuration() > 0) {
MediaSegment* dest = aStream->mBuffer.FindTrack(data->mID)->GetSegment();
STREAM_LOG(PR_LOG_DEBUG+1, ("SourceMediaStream %p track %d, advancing end from %lld to %lld",
STREAM_LOG(LogLevel::Verbose, ("SourceMediaStream %p track %d, advancing end from %lld to %lld",
aStream, data->mID,
int64_t(dest->GetDuration()),
int64_t(dest->GetDuration() + data->mData->GetDuration())));
@ -482,7 +482,7 @@ MediaStreamGraphImpl::UpdateCurrentTimeForStreams(GraphTime aPrevCurrentTime,
StreamReadyToFinish(stream);
}
}
STREAM_LOG(PR_LOG_DEBUG + 1,
STREAM_LOG(LogLevel::Verbose,
("MediaStream %p bufferStartTime=%f blockedTime=%f", stream,
MediaTimeToSeconds(stream->mBufferStartTime),
MediaTimeToSeconds(blockedTime)));
@ -505,7 +505,7 @@ MediaStreamGraphImpl::WillUnderrun(MediaStream* aStream, GraphTime aTime,
INCLUDE_TRAILING_BLOCKED_INTERVAL);
#ifdef DEBUG
if (bufferEnd < IterationEnd()) {
STREAM_LOG(PR_LOG_ERROR, ("MediaStream %p underrun, "
STREAM_LOG(LogLevel::Error, ("MediaStream %p underrun, "
"bufferEnd %f < IterationEnd() %f (%lld < %lld), Streamtime %lld",
aStream, MediaTimeToSeconds(bufferEnd), MediaTimeToSeconds(IterationEnd()),
bufferEnd, IterationEnd(), aStream->GetBufferEnd()));
@ -515,7 +515,7 @@ MediaStreamGraphImpl::WillUnderrun(MediaStream* aStream, GraphTime aTime,
#endif
// We should block after bufferEnd.
if (bufferEnd <= aTime) {
STREAM_LOG(PR_LOG_DEBUG+1, ("MediaStream %p will block due to data underrun at %ld, "
STREAM_LOG(LogLevel::Verbose, ("MediaStream %p will block due to data underrun at %ld, "
"bufferEnd %ld",
aStream, aTime, bufferEnd));
return true;
@ -526,7 +526,7 @@ MediaStreamGraphImpl::WillUnderrun(MediaStream* aStream, GraphTime aTime,
// but we might as well remain unblocked and play the data we've got while
// we can.
if (bufferEnd < aEndBlockingDecisions && aStream->mBlocked.GetBefore(aTime)) {
STREAM_LOG(PR_LOG_DEBUG+1, ("MediaStream %p will block due to speculative data underrun, "
STREAM_LOG(LogLevel::Verbose, ("MediaStream %p will block due to speculative data underrun, "
"bufferEnd %f (end at %ld)",
aStream, MediaTimeToSeconds(bufferEnd), bufferEnd));
return true;
@ -813,7 +813,7 @@ MediaStreamGraphImpl::RecomputeBlocking(GraphTime aEndBlockingDecisions)
{
bool blockingDecisionsWillChange = false;
STREAM_LOG(PR_LOG_DEBUG+1, ("Media graph %p computing blocking for time %f",
STREAM_LOG(LogLevel::Verbose, ("Media graph %p computing blocking for time %f",
this, MediaTimeToSeconds(CurrentDriver()->StateComputedTime())));
nsTArray<MediaStream*>* runningAndSuspendedPair[2];
runningAndSuspendedPair[0] = &mStreams;
@ -847,7 +847,7 @@ MediaStreamGraphImpl::RecomputeBlocking(GraphTime aEndBlockingDecisions)
}
}
}
STREAM_LOG(PR_LOG_DEBUG+1, ("Media graph %p computed blocking for interval %f to %f",
STREAM_LOG(LogLevel::Verbose, ("Media graph %p computed blocking for interval %f to %f",
this, MediaTimeToSeconds(CurrentDriver()->StateComputedTime()),
MediaTimeToSeconds(aEndBlockingDecisions)));
@ -925,13 +925,13 @@ MediaStreamGraphImpl::RecomputeBlockingAt(const nsTArray<MediaStream*>& aStreams
GraphTime endTime = StreamTimeToGraphTime(stream,
stream->GetStreamBuffer().GetAllTracksEnd());
if (endTime <= aTime) {
STREAM_LOG(PR_LOG_DEBUG+1, ("MediaStream %p is blocked due to being finished", stream));
STREAM_LOG(LogLevel::Verbose, ("MediaStream %p is blocked due to being finished", stream));
// We'll block indefinitely
MarkStreamBlocking(stream);
*aEnd = std::min(*aEnd, aEndBlockingDecisions);
continue;
} else {
STREAM_LOG(PR_LOG_DEBUG+1, ("MediaStream %p is finished, but not blocked yet (end at %f, with blocking at %f)",
STREAM_LOG(LogLevel::Verbose, ("MediaStream %p is finished, but not blocked yet (end at %f, with blocking at %f)",
stream, MediaTimeToSeconds(stream->GetBufferEnd()),
MediaTimeToSeconds(endTime)));
*aEnd = std::min(*aEnd, endTime);
@ -942,7 +942,7 @@ MediaStreamGraphImpl::RecomputeBlockingAt(const nsTArray<MediaStream*>& aStreams
bool explicitBlock = stream->mExplicitBlockerCount.GetAt(aTime, &end) > 0;
*aEnd = std::min(*aEnd, end);
if (explicitBlock) {
STREAM_LOG(PR_LOG_DEBUG+1, ("MediaStream %p is blocked due to explicit blocker", stream));
STREAM_LOG(LogLevel::Verbose, ("MediaStream %p is blocked due to explicit blocker", stream));
MarkStreamBlocking(stream);
continue;
}
@ -1091,7 +1091,7 @@ MediaStreamGraphImpl::PlayAudio(MediaStream* aStream,
if (blocked) {
output.InsertNullDataAtStart(toWrite);
ticksWritten += toWrite;
STREAM_LOG(PR_LOG_DEBUG+1, ("MediaStream %p writing %ld blocking-silence samples for %f to %f (%ld to %ld)\n",
STREAM_LOG(LogLevel::Verbose, ("MediaStream %p writing %ld blocking-silence samples for %f to %f (%ld to %ld)\n",
aStream, toWrite, MediaTimeToSeconds(t), MediaTimeToSeconds(end),
offset, offset + toWrite));
} else {
@ -1099,7 +1099,7 @@ MediaStreamGraphImpl::PlayAudio(MediaStream* aStream,
StreamTime endTicksAvailable = audio->GetDuration();
if (endTicksNeeded <= endTicksAvailable) {
STREAM_LOG(PR_LOG_DEBUG + 1,
STREAM_LOG(LogLevel::Verbose,
("MediaStream %p writing %ld samples for %f to %f "
"(samples %ld to %ld)\n",
aStream, toWrite, MediaTimeToSeconds(t),
@ -1114,7 +1114,7 @@ MediaStreamGraphImpl::PlayAudio(MediaStream* aStream,
if (endTicksNeeded > endTicksAvailable &&
offset < endTicksAvailable) {
output.AppendSlice(*audio, offset, endTicksAvailable);
STREAM_LOG(PR_LOG_DEBUG + 1,
STREAM_LOG(LogLevel::Verbose,
("MediaStream %p writing %ld samples for %f to %f "
"(samples %ld to %ld)\n",
aStream, toWrite, MediaTimeToSeconds(t),
@ -1125,7 +1125,7 @@ MediaStreamGraphImpl::PlayAudio(MediaStream* aStream,
offset = endTicksAvailable;
}
output.AppendNullData(toWrite);
STREAM_LOG(PR_LOG_DEBUG + 1,
STREAM_LOG(LogLevel::Verbose,
("MediaStream %p writing %ld padding slsamples for %f to "
"%f (samples %ld to %ld)\n",
aStream, toWrite, MediaTimeToSeconds(t),
@ -1214,7 +1214,7 @@ MediaStreamGraphImpl::PlayVideo(MediaStream* aStream)
if (!frame || *frame == aStream->mLastPlayedVideoFrame)
return;
STREAM_LOG(PR_LOG_DEBUG+1, ("MediaStream %p writing video frame %p (%dx%d)",
STREAM_LOG(LogLevel::Verbose, ("MediaStream %p writing video frame %p (%dx%d)",
aStream, frame->GetImage(), frame->GetIntrinsicSize().width,
frame->GetIntrinsicSize().height));
GraphTime startTime = StreamTimeToGraphTime(aStream,
@ -1521,7 +1521,7 @@ MediaStreamGraphImpl::OneIteration(GraphTime aFrom, GraphTime aTo,
if (finalUpdate) {
// Enter shutdown mode. The stable-state handler will detect this
// and complete shutdown. Destroy any streams immediately.
STREAM_LOG(PR_LOG_DEBUG, ("MediaStreamGraph %p waiting for main thread cleanup", this));
STREAM_LOG(LogLevel::Debug, ("MediaStreamGraph %p waiting for main thread cleanup", this));
// We'll shut down this graph object if it does not get restarted.
mLifecycleState = LIFECYCLE_WAITING_FOR_MAIN_THREAD_CLEANUP;
// No need to Destroy streams here. The main-thread owner of each
@ -1562,7 +1562,7 @@ void
MediaStreamGraphImpl::ForceShutDown()
{
NS_ASSERTION(NS_IsMainThread(), "Must be called on main thread");
STREAM_LOG(PR_LOG_DEBUG, ("MediaStreamGraph %p ForceShutdown", this));
STREAM_LOG(LogLevel::Debug, ("MediaStreamGraph %p ForceShutdown", this));
{
MonitorAutoLock lock(mMonitor);
mForceShutDown = true;
@ -2767,7 +2767,7 @@ SourceMediaStream::NeedsMixing()
void
MediaInputPort::Init()
{
STREAM_LOG(PR_LOG_DEBUG, ("Adding MediaInputPort %p (from %p to %p) to the graph",
STREAM_LOG(LogLevel::Debug, ("Adding MediaInputPort %p (from %p to %p) to the graph",
this, mSource, mDest));
mSource->AddConsumer(this);
mDest->AddInput(this);
@ -3045,7 +3045,7 @@ MediaStreamGraph::GetInstance(bool aStartWithAudioDriver,
graph = new MediaStreamGraphImpl(true, CubebUtils::PreferredSampleRate(), aStartWithAudioDriver, aChannel);
gGraphs.Put(channel, graph);
STREAM_LOG(PR_LOG_DEBUG, ("Starting up MediaStreamGraph %p", graph));
STREAM_LOG(LogLevel::Debug, ("Starting up MediaStreamGraph %p", graph));
}
return graph;
@ -3058,7 +3058,7 @@ MediaStreamGraph::CreateNonRealtimeInstance(TrackRate aSampleRate)
MediaStreamGraphImpl* graph = new MediaStreamGraphImpl(false, aSampleRate);
STREAM_LOG(PR_LOG_DEBUG, ("Starting up Offline MediaStreamGraph %p", graph));
STREAM_LOG(LogLevel::Debug, ("Starting up Offline MediaStreamGraph %p", graph));
return graph;
}
@ -3363,7 +3363,7 @@ MediaStreamGraphImpl::MoveStreams(AudioContextOperation aAudioContextOperation,
stream->remove();
}
STREAM_LOG(PR_LOG_DEBUG, ("Moving streams between suspended and running"
STREAM_LOG(LogLevel::Debug, ("Moving streams between suspended and running"
"state: mStreams: %d, mSuspendedStreams: %d\n", mStreams.Length(),
mSuspendedStreams.Length()));
#ifdef DEBUG

Просмотреть файл

@ -23,7 +23,7 @@ extern PRLogModuleInfo* gMediaTimerLog;
#define TIMER_LOG(x, ...) \
MOZ_ASSERT(gMediaTimerLog); \
MOZ_LOG(gMediaTimerLog, PR_LOG_DEBUG, ("[MediaTimer=%p relative_t=%lld]" x, this, \
MOZ_LOG(gMediaTimerLog, LogLevel::Debug, ("[MediaTimer=%p relative_t=%lld]" x, this, \
RelativeMicroseconds(TimeStamp::Now()), ##__VA_ARGS__))
// This promise type is only exclusive because so far there isn't a reason for

Просмотреть файл

@ -21,7 +21,7 @@
using namespace mozilla::net;
PRLogModuleInfo* gRtspMediaResourceLog;
#define RTSP_LOG(msg, ...) MOZ_LOG(gRtspMediaResourceLog, PR_LOG_DEBUG, \
#define RTSP_LOG(msg, ...) MOZ_LOG(gRtspMediaResourceLog, mozilla::LogLevel::Debug, \
(msg, ##__VA_ARGS__))
// Debug logging macro with object pointer and class name.
#define RTSPMLOG(msg, ...) \

Просмотреть файл

@ -50,7 +50,7 @@ namespace mozilla {
// the same log module.
#define MIRROR_LOG(x, ...) \
MOZ_ASSERT(gStateWatchingLog); \
MOZ_LOG(gStateWatchingLog, PR_LOG_DEBUG, (x, ##__VA_ARGS__))
MOZ_LOG(gStateWatchingLog, LogLevel::Debug, (x, ##__VA_ARGS__))
template<typename T> class AbstractMirror;

Просмотреть файл

@ -60,7 +60,7 @@ extern PRLogModuleInfo* gStateWatchingLog;
#define WATCH_LOG(x, ...) \
MOZ_ASSERT(gStateWatchingLog); \
MOZ_LOG(gStateWatchingLog, PR_LOG_DEBUG, (x, ##__VA_ARGS__))
MOZ_LOG(gStateWatchingLog, LogLevel::Debug, (x, ##__VA_ARGS__))
/*
* AbstractWatcher is a superclass from which all watchers must inherit.

Просмотреть файл

@ -16,13 +16,13 @@ extern PRLogModuleInfo* gMediaStreamGraphLog;
void
StreamBuffer::DumpTrackInfo() const
{
STREAM_LOG(PR_LOG_ALWAYS, ("DumpTracks: mTracksKnownTime %lld", mTracksKnownTime));
STREAM_LOG(LogLevel::Info, ("DumpTracks: mTracksKnownTime %lld", mTracksKnownTime));
for (uint32_t i = 0; i < mTracks.Length(); ++i) {
Track* track = mTracks[i];
if (track->IsEnded()) {
STREAM_LOG(PR_LOG_ALWAYS, ("Track[%d] %d: ended", i, track->GetID()));
STREAM_LOG(LogLevel::Info, ("Track[%d] %d: ended", i, track->GetID()));
} else {
STREAM_LOG(PR_LOG_ALWAYS, ("Track[%d] %d: %lld", i, track->GetID(),
STREAM_LOG(LogLevel::Info, ("Track[%d] %d: %lld", i, track->GetID(),
track->GetEnd()));
}
}

Просмотреть файл

@ -196,7 +196,7 @@ TrackUnionStream::TrackUnionStream(DOMMediaStream* aWrapper) :
segment->AppendNullData(outputStart);
StreamBuffer::Track* track =
&mBuffer.AddTrack(id, outputStart, segment.forget());
STREAM_LOG(PR_LOG_DEBUG, ("TrackUnionStream %p adding track %d for input stream %p track %d, start ticks %lld",
STREAM_LOG(LogLevel::Debug, ("TrackUnionStream %p adding track %d for input stream %p track %d, start ticks %lld",
this, id, aPort->GetSource(), aTrack->GetID(),
(long long)outputStart));
@ -264,7 +264,7 @@ TrackUnionStream::TrackUnionStream(DOMMediaStream* aWrapper) :
if (interval.mInputIsBlocked) {
// Maybe the input track ended?
segment->AppendNullData(ticks);
STREAM_LOG(PR_LOG_DEBUG+1, ("TrackUnionStream %p appending %lld ticks of null data to track %d",
STREAM_LOG(LogLevel::Verbose, ("TrackUnionStream %p appending %lld ticks of null data to track %d",
this, (long long)ticks, outputTrack->GetID()));
} else if (InMutedCycle()) {
segment->AppendNullData(ticks);

Просмотреть файл

@ -29,7 +29,7 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(WebVTTListener)
NS_IMPL_CYCLE_COLLECTING_RELEASE(WebVTTListener)
PRLogModuleInfo* gTextTrackLog;
# define VTT_LOG(...) MOZ_LOG(gTextTrackLog, PR_LOG_DEBUG, (__VA_ARGS__))
# define VTT_LOG(...) MOZ_LOG(gTextTrackLog, LogLevel::Debug, (__VA_ARGS__))
WebVTTListener::WebVTTListener(HTMLTrackElement* aElement)
: mElement(aElement)

Просмотреть файл

@ -22,9 +22,9 @@
namespace mozilla {
extern PRLogModuleInfo* gMediaDecoderLog;
#define LOGE(...) MOZ_LOG(gMediaDecoderLog, PR_LOG_ERROR, (__VA_ARGS__))
#define LOGW(...) MOZ_LOG(gMediaDecoderLog, PR_LOG_WARNING, (__VA_ARGS__))
#define LOGD(...) MOZ_LOG(gMediaDecoderLog, PR_LOG_DEBUG, (__VA_ARGS__))
#define LOGE(...) MOZ_LOG(gMediaDecoderLog, mozilla::LogLevel::Error, (__VA_ARGS__))
#define LOGW(...) MOZ_LOG(gMediaDecoderLog, mozilla::LogLevel::Warning, (__VA_ARGS__))
#define LOGD(...) MOZ_LOG(gMediaDecoderLog, mozilla::LogLevel::Debug, (__VA_ARGS__))
#define PROPERTY_ID_FORMAT "%c%c%c%c"
#define PROPERTY_ID_PRINT(x) ((x) >> 24), \

Просмотреть файл

@ -24,7 +24,7 @@ using namespace mozilla::media;
namespace mozilla {
PRLogModuleInfo* GetDirectShowLog();
#define LOG(...) MOZ_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#define LOG(...) MOZ_LOG(GetDirectShowLog(), mozilla::LogLevel::Debug, (__VA_ARGS__))
AudioSinkFilter::AudioSinkFilter(const wchar_t* aObjectName, HRESULT* aOutResult)
: BaseFilter(aObjectName, CLSID_MozAudioSinkFilter),

Просмотреть файл

@ -16,7 +16,7 @@ using namespace mozilla::media;
namespace mozilla {
PRLogModuleInfo* GetDirectShowLog();
#define LOG(...) MOZ_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#define LOG(...) MOZ_LOG(GetDirectShowLog(), mozilla::LogLevel::Debug, (__VA_ARGS__))
AudioSinkInputPin::AudioSinkInputPin(wchar_t* aObjectName,
AudioSinkFilter* aFilter,

Просмотреть файл

@ -26,7 +26,7 @@ GetDirectShowLog() {
return log;
}
#define LOG(...) MOZ_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#define LOG(...) MOZ_LOG(GetDirectShowLog(), mozilla::LogLevel::Debug, (__VA_ARGS__))
DirectShowReader::DirectShowReader(AbstractMediaDecoder* aDecoder)
: MediaDecoderReader(aDecoder),

Просмотреть файл

@ -15,7 +15,7 @@ using namespace mozilla::media;
namespace mozilla {
PRLogModuleInfo* GetDirectShowLog();
#define LOG(...) MOZ_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#define LOG(...) MOZ_LOG(GetDirectShowLog(), mozilla::LogLevel::Debug, (__VA_ARGS__))
SampleSink::SampleSink()
: mMonitor("SampleSink"),
@ -65,7 +65,7 @@ SampleSink::Receive(IMediaSample* aSample)
mon.Wait();
}
if (PR_LOG_TEST(GetDirectShowLog(), PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(GetDirectShowLog(), LogLevel::Debug)) {
REFERENCE_TIME start = 0, end = 0;
HRESULT hr = aSample->GetMediaTime(&start, &end);
LOG("SampleSink::Receive() [%4.2lf-%4.2lf]",
@ -102,7 +102,7 @@ SampleSink::Extract(RefPtr<IMediaSample>& aOutSample)
}
aOutSample = mSample;
if (PR_LOG_TEST(GetDirectShowLog(), PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(GetDirectShowLog(), LogLevel::Debug)) {
int64_t start = 0, end = 0;
mSample->GetMediaTime(&start, &end);
LOG("SampleSink::Extract() [%4.2lf-%4.2lf]",

Просмотреть файл

@ -21,7 +21,7 @@ namespace mozilla {
#if defined (DEBUG_SOURCE_TRACE)
PRLogModuleInfo* GetDirectShowLog();
#define DIRECTSHOW_LOG(...) MOZ_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#define DIRECTSHOW_LOG(...) MOZ_LOG(GetDirectShowLog(), mozilla::LogLevel::Debug, (__VA_ARGS__))
#else
#define DIRECTSHOW_LOG(...)
#endif

Просмотреть файл

@ -14,13 +14,13 @@ namespace mozilla {
#ifndef EME_LOG
PRLogModuleInfo* GetEMELog();
#define EME_LOG(...) MOZ_LOG(GetEMELog(), PR_LOG_DEBUG, (__VA_ARGS__))
#define EME_LOG_ENABLED() PR_LOG_TEST(GetEMELog(), PR_LOG_DEBUG)
#define EME_LOG(...) MOZ_LOG(GetEMELog(), mozilla::LogLevel::Debug, (__VA_ARGS__))
#define EME_LOG_ENABLED() MOZ_LOG_TEST(GetEMELog(), mozilla::LogLevel::Debug)
#endif
#ifndef EME_VERBOSE_LOG
PRLogModuleInfo* GetEMEVerboseLog();
#define EME_VERBOSE_LOG(...) MOZ_LOG(GetEMEVerboseLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#define EME_VERBOSE_LOG(...) MOZ_LOG(GetEMEVerboseLog(), mozilla::LogLevel::Debug, (__VA_ARGS__))
#else
#ifndef EME_LOG
#define EME_LOG(...)

Просмотреть файл

@ -62,7 +62,7 @@ MediaEncoder::NotifyEvent(MediaStreamGraph* aGraph,
MediaStreamListener::MediaStreamGraphEvent event)
{
// In case that MediaEncoder does not receive a TRACK_EVENT_ENDED event.
LOG(PR_LOG_DEBUG, ("NotifyRemoved in [MediaEncoder]."));
LOG(LogLevel::Debug, ("NotifyRemoved in [MediaEncoder]."));
if (mAudioEncoder) {
mAudioEncoder->NotifyEvent(aGraph, event);
}
@ -87,7 +87,7 @@ MediaEncoder::CreateEncoder(const nsAString& aMIMEType, uint8_t aTrackTypes)
nsRefPtr<MediaEncoder> encoder;
nsString mimeType;
if (!aTrackTypes) {
LOG(PR_LOG_ERROR, ("NO TrackTypes!!!"));
LOG(LogLevel::Error, ("NO TrackTypes!!!"));
return nullptr;
}
#ifdef MOZ_WEBM_ENCODER
@ -138,10 +138,10 @@ MediaEncoder::CreateEncoder(const nsAString& aMIMEType, uint8_t aTrackTypes)
mimeType = NS_LITERAL_STRING(AUDIO_OGG);
}
else {
LOG(PR_LOG_ERROR, ("Can not find any encoder to record this media stream"));
LOG(LogLevel::Error, ("Can not find any encoder to record this media stream"));
return nullptr;
}
LOG(PR_LOG_DEBUG, ("Create encoder result:a[%d] v[%d] w[%d] mimeType = %s.",
LOG(LogLevel::Debug, ("Create encoder result:a[%d] v[%d] w[%d] mimeType = %s.",
audioEncoder != nullptr, videoEncoder != nullptr,
writer != nullptr, mimeType.get()));
encoder = new MediaEncoder(writer.forget(), audioEncoder.forget(),
@ -187,15 +187,15 @@ MediaEncoder::GetEncodedData(nsTArray<nsTArray<uint8_t> >* aOutputBufs,
while (reloop) {
switch (mState) {
case ENCODE_METADDATA: {
LOG(PR_LOG_DEBUG, ("ENCODE_METADDATA TimeStamp = %f", GetEncodeTimeStamp()));
LOG(LogLevel::Debug, ("ENCODE_METADDATA TimeStamp = %f", GetEncodeTimeStamp()));
nsresult rv = CopyMetadataToMuxer(mAudioEncoder.get());
if (NS_FAILED(rv)) {
LOG(PR_LOG_ERROR, ("Error! Fail to Set Audio Metadata"));
LOG(LogLevel::Error, ("Error! Fail to Set Audio Metadata"));
break;
}
rv = CopyMetadataToMuxer(mVideoEncoder.get());
if (NS_FAILED(rv)) {
LOG(PR_LOG_ERROR, ("Error! Fail to Set Video Metadata"));
LOG(LogLevel::Error, ("Error! Fail to Set Video Metadata"));
break;
}
@ -205,31 +205,31 @@ MediaEncoder::GetEncodedData(nsTArray<nsTArray<uint8_t> >* aOutputBufs,
mSizeOfBuffer = aOutputBufs->SizeOfExcludingThis(MallocSizeOf);
}
if (NS_FAILED(rv)) {
LOG(PR_LOG_ERROR,("Error! writer fail to generate header!"));
LOG(LogLevel::Error,("Error! writer fail to generate header!"));
mState = ENCODE_ERROR;
break;
}
LOG(PR_LOG_DEBUG, ("Finish ENCODE_METADDATA TimeStamp = %f", GetEncodeTimeStamp()));
LOG(LogLevel::Debug, ("Finish ENCODE_METADDATA TimeStamp = %f", GetEncodeTimeStamp()));
mState = ENCODE_TRACK;
break;
}
case ENCODE_TRACK: {
LOG(PR_LOG_DEBUG, ("ENCODE_TRACK TimeStamp = %f", GetEncodeTimeStamp()));
LOG(LogLevel::Debug, ("ENCODE_TRACK TimeStamp = %f", GetEncodeTimeStamp()));
EncodedFrameContainer encodedData;
nsresult rv = NS_OK;
rv = WriteEncodedDataToMuxer(mAudioEncoder.get());
if (NS_FAILED(rv)) {
LOG(PR_LOG_ERROR, ("Error! Fail to write audio encoder data to muxer"));
LOG(LogLevel::Error, ("Error! Fail to write audio encoder data to muxer"));
break;
}
LOG(PR_LOG_DEBUG, ("Audio encoded TimeStamp = %f", GetEncodeTimeStamp()));
LOG(LogLevel::Debug, ("Audio encoded TimeStamp = %f", GetEncodeTimeStamp()));
rv = WriteEncodedDataToMuxer(mVideoEncoder.get());
if (NS_FAILED(rv)) {
LOG(PR_LOG_ERROR, ("Fail to write video encoder data to muxer"));
LOG(LogLevel::Error, ("Fail to write video encoder data to muxer"));
break;
}
LOG(PR_LOG_DEBUG, ("Video encoded TimeStamp = %f", GetEncodeTimeStamp()));
LOG(LogLevel::Debug, ("Video encoded TimeStamp = %f", GetEncodeTimeStamp()));
// In audio only or video only case, let unavailable track's flag to be true.
bool isAudioCompleted = (mAudioEncoder && mAudioEncoder->IsEncodingComplete()) || !mAudioEncoder;
bool isVideoCompleted = (mVideoEncoder && mVideoEncoder->IsEncodingComplete()) || !mVideoEncoder;
@ -244,7 +244,7 @@ MediaEncoder::GetEncodedData(nsTArray<nsTArray<uint8_t> >* aOutputBufs,
reloop = false;
}
mState = (mWriter->IsWritingComplete()) ? ENCODE_DONE : ENCODE_TRACK;
LOG(PR_LOG_DEBUG, ("END ENCODE_TRACK TimeStamp = %f "
LOG(LogLevel::Debug, ("END ENCODE_TRACK TimeStamp = %f "
"mState = %d aComplete %d vComplete %d",
GetEncodeTimeStamp(), mState, isAudioCompleted, isVideoCompleted));
break;
@ -252,7 +252,7 @@ MediaEncoder::GetEncodedData(nsTArray<nsTArray<uint8_t> >* aOutputBufs,
case ENCODE_DONE:
case ENCODE_ERROR:
LOG(PR_LOG_DEBUG, ("MediaEncoder has been shutdown."));
LOG(LogLevel::Debug, ("MediaEncoder has been shutdown."));
mSizeOfBuffer = 0;
mShutdown = true;
reloop = false;
@ -280,7 +280,7 @@ MediaEncoder::WriteEncodedDataToMuxer(TrackEncoder *aTrackEncoder)
nsresult rv = aTrackEncoder->GetEncodedTrack(encodedVideoData);
if (NS_FAILED(rv)) {
// Encoding might be canceled.
LOG(PR_LOG_ERROR, ("Error! Fail to get encoded data from video encoder."));
LOG(LogLevel::Error, ("Error! Fail to get encoded data from video encoder."));
mState = ENCODE_ERROR;
return rv;
}
@ -288,7 +288,7 @@ MediaEncoder::WriteEncodedDataToMuxer(TrackEncoder *aTrackEncoder)
aTrackEncoder->IsEncodingComplete() ?
ContainerWriter::END_OF_STREAM : 0);
if (NS_FAILED(rv)) {
LOG(PR_LOG_ERROR, ("Error! Fail to write encoded video track to the media container."));
LOG(LogLevel::Error, ("Error! Fail to write encoded video track to the media container."));
mState = ENCODE_ERROR;
}
return rv;
@ -306,14 +306,14 @@ MediaEncoder::CopyMetadataToMuxer(TrackEncoder *aTrackEncoder)
nsRefPtr<TrackMetadataBase> meta = aTrackEncoder->GetMetadata();
if (meta == nullptr) {
LOG(PR_LOG_ERROR, ("Error! metadata = null"));
LOG(LogLevel::Error, ("Error! metadata = null"));
mState = ENCODE_ERROR;
return NS_ERROR_ABORT;
}
nsresult rv = mWriter->SetMetadata(meta);
if (NS_FAILED(rv)) {
LOG(PR_LOG_ERROR, ("Error! SetMetadata fail"));
LOG(LogLevel::Error, ("Error! SetMetadata fail"));
mState = ENCODE_ERROR;
}
return rv;

Просмотреть файл

@ -58,7 +58,7 @@ AudioTrackEncoder::NotifyQueuedTrackChanges(MediaStreamGraph* aGraph,
// Check and initialize parameters for codec encoder.
if (!mInitialized) {
mAudioInitCounter++;
TRACK_LOG(PR_LOG_DEBUG, ("Init the audio encoder %d times", mAudioInitCounter));
TRACK_LOG(LogLevel::Debug, ("Init the audio encoder %d times", mAudioInitCounter));
AudioSegment::ChunkIterator iter(const_cast<AudioSegment&>(audio));
while (!iter.IsEnded()) {
AudioChunk chunk = *iter;
@ -184,7 +184,7 @@ VideoTrackEncoder::NotifyQueuedTrackChanges(MediaStreamGraph* aGraph,
// Check and initialize parameters for codec encoder.
if (!mInitialized) {
mVideoInitCounter++;
TRACK_LOG(PR_LOG_DEBUG, ("Init the video encoder %d times", mVideoInitCounter));
TRACK_LOG(LogLevel::Debug, ("Init the video encoder %d times", mVideoInitCounter));
VideoSegment::ChunkIterator iter(const_cast<VideoSegment&>(video));
while (!iter.IsEnded()) {
VideoChunk chunk = *iter;

Просмотреть файл

@ -16,7 +16,7 @@
namespace mozilla {
PRLogModuleInfo* gVP8TrackEncoderLog;
#define VP8LOG(msg, ...) MOZ_LOG(gVP8TrackEncoderLog, PR_LOG_DEBUG, \
#define VP8LOG(msg, ...) MOZ_LOG(gVP8TrackEncoderLog, mozilla::LogLevel::Debug, \
(msg, ##__VA_ARGS__))
// Debug logging macro with object pointer and class name.

Просмотреть файл

@ -18,7 +18,7 @@ namespace mozilla {
#undef LOG
PRLogModuleInfo* gVorbisTrackEncoderLog;
#define VORBISLOG(msg, ...) MOZ_LOG(gVorbisTrackEncoderLog, PR_LOG_DEBUG, \
#define VORBISLOG(msg, ...) MOZ_LOG(gVorbisTrackEncoderLog, mozilla::LogLevel::Debug, \
(msg, ##__VA_ARGS__))
VorbisTrackEncoder::VorbisTrackEncoder()

Просмотреть файл

@ -40,8 +40,8 @@ PRLogModuleInfo* GetDemuxerLog() {
}
return log;
}
#define LOG(arg, ...) MOZ_LOG(GetDemuxerLog(), PR_LOG_DEBUG, ("MP4Reader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define VLOG(arg, ...) MOZ_LOG(GetDemuxerLog(), PR_LOG_DEBUG, ("MP4Reader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define LOG(arg, ...) MOZ_LOG(GetDemuxerLog(), mozilla::LogLevel::Debug, ("MP4Reader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define VLOG(arg, ...) MOZ_LOG(GetDemuxerLog(), mozilla::LogLevel::Debug, ("MP4Reader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
using namespace mp4_demuxer;

Просмотреть файл

@ -19,7 +19,7 @@ namespace mozilla {
extern PRLogModuleInfo* GetGMPLog();
#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg)
#define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg)
namespace gmp {

Просмотреть файл

@ -47,7 +47,7 @@ namespace mozilla {
extern PRLogModuleInfo* GetGMPLog();
#define LOG(level, x, ...) MOZ_LOG(GetGMPLog(), (level), (x, ##__VA_ARGS__))
#define LOGD(x, ...) LOG(PR_LOG_DEBUG, "GMPChild[pid=%d] " x, (int)base::GetCurrentProcId(), ##__VA_ARGS__)
#define LOGD(x, ...) LOG(mozilla::LogLevel::Debug, "GMPChild[pid=%d] " x, (int)base::GetCurrentProcId(), ##__VA_ARGS__)
namespace gmp {

Просмотреть файл

@ -22,7 +22,7 @@ namespace mozilla {
extern PRLogModuleInfo* GetGMPLog();
#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg)
#define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg)
#ifdef __CLASS__

Просмотреть файл

@ -44,7 +44,7 @@ namespace mozilla {
extern PRLogModuleInfo* GetGMPLog();
#define LOG(level, x, ...) MOZ_LOG(GetGMPLog(), (level), (x, ##__VA_ARGS__))
#define LOGD(x, ...) LOG(PR_LOG_DEBUG, "GMPParent[%p|childPid=%d] " x, this, mChildPid, ##__VA_ARGS__)
#define LOGD(x, ...) LOG(mozilla::LogLevel::Debug, "GMPParent[%p|childPid=%d] " x, this, mChildPid, ##__VA_ARGS__)
#ifdef __CLASS__
#undef __CLASS__

Просмотреть файл

@ -52,7 +52,7 @@ GetGMPLog()
return sLog;
}
#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg)
#define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg)
#ifdef __CLASS__

Просмотреть файл

@ -20,7 +20,7 @@ namespace mozilla {
#undef LOG
#endif
#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg)
#define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg)
#ifdef __CLASS__

Просмотреть файл

@ -41,7 +41,7 @@ namespace mozilla {
#undef LOG
#endif
#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg)
#define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg)
#ifdef __CLASS__

Просмотреть файл

@ -28,7 +28,7 @@ namespace mozilla {
extern PRLogModuleInfo* GetGMPLog();
#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg)
#define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg)
#ifdef __CLASS__

Просмотреть файл

@ -15,7 +15,7 @@ namespace mozilla {
extern PRLogModuleInfo* GetGMPLog();
#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg)
#define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg)
#ifdef __CLASS__

Просмотреть файл

@ -23,7 +23,7 @@ namespace mozilla {
extern PRLogModuleInfo* GetGMPLog();
#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg)
#define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg)
namespace gmp {
@ -245,7 +245,7 @@ GMPVideoDecoderParent::RecvDecoded(const GMPVideoi420FrameData& aDecodedFrame)
}
if (!GMPVideoi420FrameImpl::CheckFrameData(aDecodedFrame)) {
LOG(PR_LOG_ERROR, ("%s: Decoded frame corrupt, ignoring", __FUNCTION__));
LOG(LogLevel::Error, ("%s: Decoded frame corrupt, ignoring", __FUNCTION__));
return false;
}
auto f = new GMPVideoi420FrameImpl(aDecodedFrame, &mVideoHost);
@ -361,7 +361,7 @@ GMPVideoDecoderParent::AnswerNeedShmem(const uint32_t& aFrameBufferSize,
aFrameBufferSize,
ipc::SharedMemory::TYPE_BASIC, &mem))
{
LOG(PR_LOG_ERROR, ("%s: Failed to get a shared mem buffer for Child! size %u",
LOG(LogLevel::Error, ("%s: Failed to get a shared mem buffer for Child! size %u",
__FUNCTION__, aFrameBufferSize));
return false;
}

Просмотреть файл

@ -25,7 +25,7 @@ namespace mozilla {
extern PRLogModuleInfo* GetGMPLog();
#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg)
#define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg)
#ifdef __CLASS__
@ -352,7 +352,7 @@ GMPVideoEncoderParent::AnswerNeedShmem(const uint32_t& aEncodedBufferSize,
aEncodedBufferSize,
ipc::SharedMemory::TYPE_BASIC, &mem))
{
LOG(PR_LOG_ERROR, ("%s::%s: Failed to get a shared mem buffer for Child! size %u",
LOG(LogLevel::Error, ("%s::%s: Failed to get a shared mem buffer for Child! size %u",
__CLASS__, __FUNCTION__, aEncodedBufferSize));
return false;
}

Просмотреть файл

@ -131,7 +131,7 @@ nsresult GStreamerReader::Init(MediaDecoderReader* aCloneDonor)
mPlayBin = gst_element_factory_make("playbin2", nullptr);
#endif
if (!mPlayBin) {
LOG(PR_LOG_ERROR, "couldn't create playbin");
LOG(LogLevel::Error, "couldn't create playbin");
return NS_ERROR_FAILURE;
}
g_object_set(mPlayBin, "buffer-size", 0, nullptr);
@ -298,12 +298,12 @@ void GStreamerReader::PlayBinSourceSetup(GstAppSrc* aSource)
/* let the demuxer work in pull mode for local files (or very short files)
* so that we get optimal seeking accuracy/performance
*/
LOG(PR_LOG_DEBUG, "configuring random access, len %lld", resourceLength);
LOG(LogLevel::Debug, "configuring random access, len %lld", resourceLength);
gst_app_src_set_stream_type(mSource, GST_APP_STREAM_TYPE_RANDOM_ACCESS);
} else {
/* make the demuxer work in push mode so that seeking is kept to a minimum
*/
LOG(PR_LOG_DEBUG, "configuring push mode, len %lld", resourceLength);
LOG(LogLevel::Debug, "configuring push mode, len %lld", resourceLength);
gst_app_src_set_stream_type(mSource, GST_APP_STREAM_TYPE_SEEKABLE);
}
@ -420,9 +420,9 @@ nsresult GStreamerReader::ReadMetadata(MediaInfo* aInfo,
gst_object_unref(filter);
}
LOG(PR_LOG_DEBUG, "starting metadata pipeline");
LOG(LogLevel::Debug, "starting metadata pipeline");
if (gst_element_set_state(mPlayBin, GST_STATE_PAUSED) == GST_STATE_CHANGE_FAILURE) {
LOG(PR_LOG_DEBUG, "metadata pipeline state change failed");
LOG(LogLevel::Debug, "metadata pipeline state change failed");
ret = NS_ERROR_FAILURE;
continue;
}
@ -433,19 +433,19 @@ nsresult GStreamerReader::ReadMetadata(MediaInfo* aInfo,
message = gst_bus_timed_pop_filtered(mBus, GST_CLOCK_TIME_NONE,
(GstMessageType)(GST_MESSAGE_ASYNC_DONE | GST_MESSAGE_ERROR | GST_MESSAGE_EOS));
if (GST_MESSAGE_TYPE(message) == GST_MESSAGE_ASYNC_DONE) {
LOG(PR_LOG_DEBUG, "read metadata pipeline prerolled");
LOG(LogLevel::Debug, "read metadata pipeline prerolled");
gst_message_unref(message);
ret = NS_OK;
break;
} else {
LOG(PR_LOG_DEBUG, "read metadata pipeline failed to preroll: %s",
LOG(LogLevel::Debug, "read metadata pipeline failed to preroll: %s",
gst_message_type_get_name (GST_MESSAGE_TYPE (message)));
if (GST_MESSAGE_TYPE(message) == GST_MESSAGE_ERROR) {
GError* error;
gchar* debug;
gst_message_parse_error(message, &error, &debug);
LOG(PR_LOG_ERROR, "read metadata error: %s: %s", error->message, debug);
LOG(LogLevel::Error, "read metadata error: %s: %s", error->message, debug);
g_error_free(error);
g_free(debug);
}
@ -475,7 +475,7 @@ nsresult GStreamerReader::ReadMetadata(MediaInfo* aInfo,
mLastParserDuration = mMP3FrameParser.GetDuration();
mDecoder->SetMediaDuration(mLastParserDuration);
} else {
LOG(PR_LOG_DEBUG, "querying duration");
LOG(LogLevel::Debug, "querying duration");
// Otherwise use the gstreamer duration.
#if GST_VERSION_MAJOR >= 1
if (gst_element_query_duration(GST_ELEMENT(mPlayBin),
@ -486,7 +486,7 @@ nsresult GStreamerReader::ReadMetadata(MediaInfo* aInfo,
&format, &duration) && format == GST_FORMAT_TIME) {
#endif
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
LOG(PR_LOG_DEBUG, "have duration %" GST_TIME_FORMAT, GST_TIME_ARGS(duration));
LOG(LogLevel::Debug, "have duration %" GST_TIME_FORMAT, GST_TIME_ARGS(duration));
duration = GST_TIME_AS_USECONDS (duration);
mDecoder->SetMediaDuration(duration);
}
@ -618,7 +618,7 @@ nsresult GStreamerReader::ResetDecode()
{
nsresult res = NS_OK;
LOG(PR_LOG_DEBUG, "reset decode");
LOG(LogLevel::Debug, "reset decode");
if (NS_FAILED(MediaDecoderReader::ResetDecode())) {
res = NS_ERROR_FAILURE;
@ -635,7 +635,7 @@ nsresult GStreamerReader::ResetDecode()
mConfigureAlignment = true;
#endif
LOG(PR_LOG_DEBUG, "reset decode done");
LOG(LogLevel::Debug, "reset decode done");
return res;
}
@ -798,7 +798,7 @@ bool GStreamerReader::DecodeVideoFrame(bool &aKeyFrameSkip,
duration = gst_util_uint64_scale(GST_USECOND, fpsDen, fpsNum);
if (timestamp < aTimeThreshold) {
LOG(PR_LOG_DEBUG, "skipping frame %" GST_TIME_FORMAT
LOG(LogLevel::Debug, "skipping frame %" GST_TIME_FORMAT
" threshold %" GST_TIME_FORMAT,
GST_TIME_ARGS(timestamp * 1000),
GST_TIME_ARGS(aTimeThreshold * 1000));
@ -851,7 +851,7 @@ GStreamerReader::Seek(int64_t aTarget, int64_t aEndTime)
MOZ_ASSERT(OnTaskQueue());
gint64 seekPos = aTarget * GST_USECOND;
LOG(PR_LOG_DEBUG, "%p About to seek to %" GST_TIME_FORMAT,
LOG(LogLevel::Debug, "%p About to seek to %" GST_TIME_FORMAT,
mDecoder, GST_TIME_ARGS(seekPos));
int flags = GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT;
@ -859,14 +859,14 @@ GStreamerReader::Seek(int64_t aTarget, int64_t aEndTime)
GST_FORMAT_TIME,
static_cast<GstSeekFlags>(flags),
seekPos)) {
LOG(PR_LOG_ERROR, "seek failed");
LOG(LogLevel::Error, "seek failed");
return SeekPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
}
LOG(PR_LOG_DEBUG, "seek succeeded");
LOG(LogLevel::Debug, "seek succeeded");
GstMessage* message = gst_bus_timed_pop_filtered(mBus, GST_CLOCK_TIME_NONE,
(GstMessageType)(GST_MESSAGE_ASYNC_DONE | GST_MESSAGE_ERROR));
gst_message_unref(message);
LOG(PR_LOG_DEBUG, "seek completed");
LOG(LogLevel::Debug, "seek completed");
return SeekPromise::CreateAndResolve(aTarget, __func__);
}
@ -894,7 +894,7 @@ media::TimeIntervals GStreamerReader::GetBuffered()
duration = mDecoder->GetMediaDuration();
}
LOG(PR_LOG_DEBUG, "complete range [0, %f] for [0, %li]",
LOG(LogLevel::Debug, "complete range [0, %f] for [0, %li]",
(double) duration / GST_MSECOND, GetDataLength());
buffered +=
media::TimeInterval(media::TimeUnit::FromMicroseconds(0),
@ -923,7 +923,7 @@ media::TimeIntervals GStreamerReader::GetBuffered()
continue;
#endif
LOG(PR_LOG_DEBUG, "adding range [%f, %f] for [%li %li] size %li",
LOG(LogLevel::Debug, "adding range [%f, %f] for [%li %li] size %li",
(double) GST_TIME_AS_USECONDS (startTime) / GST_MSECOND,
(double) GST_TIME_AS_USECONDS (endTime) / GST_MSECOND,
startOffset, endOffset, GetDataLength());
@ -973,16 +973,16 @@ void GStreamerReader::ReadAndPushData(guint aLength)
GstFlowReturn ret = gst_app_src_push_buffer(mSource, gst_buffer_ref(buffer));
if (ret != GST_FLOW_OK) {
LOG(PR_LOG_ERROR, "ReadAndPushData push ret %s(%d)", gst_flow_get_name(ret), ret);
LOG(LogLevel::Error, "ReadAndPushData push ret %s(%d)", gst_flow_get_name(ret), ret);
}
if (NS_FAILED(rv)) {
/* Terminate the stream if there is an error in reading */
LOG(PR_LOG_ERROR, "ReadAndPushData read error, rv=%x", rv);
LOG(LogLevel::Error, "ReadAndPushData read error, rv=%x", rv);
gst_app_src_end_of_stream(mSource);
} else if (bytesRead < aLength) {
/* If we read less than what we wanted, we reached the end */
LOG(PR_LOG_WARNING, "ReadAndPushData read underflow, "
LOG(LogLevel::Warning, "ReadAndPushData read underflow, "
"bytesRead=%u, aLength=%u, offset(%lld,%lld)",
bytesRead, aLength, offset1, offset2);
gst_app_src_end_of_stream(mSource);
@ -1051,7 +1051,7 @@ gboolean GStreamerReader::SeekData(GstAppSrc* aSrc, guint64 aOffset)
}
if (NS_FAILED(rv)) {
LOG(PR_LOG_ERROR, "seek at %lu failed", aOffset);
LOG(LogLevel::Error, "seek at %lu failed", aOffset);
} else {
MOZ_ASSERT(aOffset == static_cast<guint64>(resource->Tell()));
}
@ -1074,7 +1074,7 @@ GstFlowReturn GStreamerReader::NewPrerollCb(GstAppSink* aSink,
void GStreamerReader::AudioPreroll()
{
/* The first audio buffer has reached the audio sink. Get rate and channels */
LOG(PR_LOG_DEBUG, "Audio preroll");
LOG(LogLevel::Debug, "Audio preroll");
GstPad* sinkpad = gst_element_get_static_pad(GST_ELEMENT(mAudioAppSink), "sink");
#if GST_VERSION_MAJOR >= 1
GstCaps *caps = gst_pad_get_current_caps(sinkpad);
@ -1096,7 +1096,7 @@ void GStreamerReader::AudioPreroll()
void GStreamerReader::VideoPreroll()
{
/* The first video buffer has reached the video sink. Get width and height */
LOG(PR_LOG_DEBUG, "Video preroll");
LOG(LogLevel::Debug, "Video preroll");
GstPad* sinkpad = gst_element_get_static_pad(GST_ELEMENT(mVideoAppSink), "sink");
int PARNumerator, PARDenominator;
#if GST_VERSION_MAJOR >= 1
@ -1130,7 +1130,7 @@ void GStreamerReader::VideoPreroll()
gst_structure_get_fraction(structure, "framerate", &fpsNum, &fpsDen);
mInfo.mVideo.mDisplay = displaySize;
} else {
LOG(PR_LOG_DEBUG, "invalid video region");
LOG(LogLevel::Debug, "invalid video region");
Eos();
}
gst_caps_unref(caps);
@ -1364,7 +1364,7 @@ GstPadProbeReturn GStreamerReader::EventProbe(GstPad *aPad, GstEvent *aEvent)
{
GstElement* parent = GST_ELEMENT(gst_pad_get_parent(aPad));
LOG(PR_LOG_DEBUG, "event probe %s", GST_EVENT_TYPE_NAME (aEvent));
LOG(LogLevel::Debug, "event probe %s", GST_EVENT_TYPE_NAME (aEvent));
switch(GST_EVENT_TYPE(aEvent)) {
case GST_EVENT_SEGMENT:

Просмотреть файл

@ -15,7 +15,7 @@ namespace mozilla {
#ifndef IC_LOG
PRLogModuleInfo* GetICLog();
#define IC_LOG(...) MOZ_LOG(GetICLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#define IC_LOG(...) MOZ_LOG(GetICLog(), mozilla::LogLevel::Debug, (__VA_ARGS__))
#endif
namespace dom {

Просмотреть файл

@ -26,7 +26,7 @@ extern PRLogModuleInfo* GetMediaSourceLog();
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
#define MSE_DEBUG(name, arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, (TOSTRING(name) "(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
#define MSE_DEBUG(name, arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Debug, (TOSTRING(name) "(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
namespace mozilla {

Просмотреть файл

@ -57,8 +57,8 @@ PRLogModuleInfo* GetMediaSourceAPILog()
return sLogModule;
}
#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSource(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define MSE_API(arg, ...) MOZ_LOG(GetMediaSourceAPILog(), PR_LOG_DEBUG, ("MediaSource(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Debug, ("MediaSource(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define MSE_API(arg, ...) MOZ_LOG(GetMediaSourceAPILog(), mozilla::LogLevel::Debug, ("MediaSource(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
// Arbitrary limit.
static const unsigned int MAX_SOURCE_BUFFERS = 16;

Просмотреть файл

@ -17,8 +17,8 @@
extern PRLogModuleInfo* GetMediaSourceLog();
#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSourceDecoder(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define MSE_DEBUGV(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG + 1, ("MediaSourceDecoder(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Debug, ("MediaSourceDecoder(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define MSE_DEBUGV(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Verbose, ("MediaSourceDecoder(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
namespace mozilla {

Просмотреть файл

@ -25,8 +25,8 @@
extern PRLogModuleInfo* GetMediaSourceLog();
#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSourceReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define MSE_DEBUGV(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG + 1, ("MediaSourceReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Debug, ("MediaSourceReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define MSE_DEBUGV(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Verbose, ("MediaSourceReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
// When a stream hits EOS it needs to decide what other stream to switch to. Due
// to inaccuracies is determining buffer end frames (Bug 1065207) and rounding

Просмотреть файл

@ -13,7 +13,7 @@
extern PRLogModuleInfo* GetMediaSourceLog();
#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSourceResource(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Debug, ("MediaSourceResource(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
#define UNIMPLEMENTED() MSE_DEBUG("UNIMPLEMENTED FUNCTION at %s:%d", __FILE__, __LINE__)

Просмотреть файл

@ -15,8 +15,8 @@ extern PRLogModuleInfo* GetSourceBufferResourceLog();
#define __func__ __FUNCTION__
#endif
#define SBR_DEBUG(arg, ...) MOZ_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG, ("ResourceQueue(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define SBR_DEBUGV(arg, ...) MOZ_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG+1, ("ResourceQueue(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define SBR_DEBUG(arg, ...) MOZ_LOG(GetSourceBufferResourceLog(), mozilla::LogLevel::Debug, ("ResourceQueue(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define SBR_DEBUGV(arg, ...) MOZ_LOG(GetSourceBufferResourceLog(), mozilla::LogLevel::Verbose, ("ResourceQueue(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
namespace mozilla {

Просмотреть файл

@ -29,9 +29,9 @@ class JSObject;
extern PRLogModuleInfo* GetMediaSourceLog();
extern PRLogModuleInfo* GetMediaSourceAPILog();
#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
#define MSE_DEBUGV(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG + 1, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
#define MSE_API(arg, ...) MOZ_LOG(GetMediaSourceAPILog(), PR_LOG_DEBUG, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Debug, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
#define MSE_DEBUGV(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Verbose, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
#define MSE_API(arg, ...) MOZ_LOG(GetMediaSourceAPILog(), mozilla::LogLevel::Debug, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
namespace mozilla {

Просмотреть файл

@ -16,7 +16,7 @@ extern PRLogModuleInfo* GetMediaSourceLog();
#define __func__ __FUNCTION__
#endif
#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("SourceBufferDecoder(%p:%s)::%s: " arg, this, mResource->GetContentType().get(), __func__, ##__VA_ARGS__))
#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Debug, ("SourceBufferDecoder(%p:%s)::%s: " arg, this, mResource->GetContentType().get(), __func__, ##__VA_ARGS__))
namespace mozilla {

Просмотреть файл

@ -19,8 +19,8 @@
extern PRLogModuleInfo* GetMediaSourceLog();
extern PRLogModuleInfo* GetMediaSourceAPILog();
#define MSE_API(arg, ...) MOZ_LOG(GetMediaSourceAPILog(), PR_LOG_DEBUG, ("SourceBufferList(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("SourceBufferList(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define MSE_API(arg, ...) MOZ_LOG(GetMediaSourceAPILog(), mozilla::LogLevel::Debug, ("SourceBufferList(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Debug, ("SourceBufferList(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
struct JSContext;
class JSObject;

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше