import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 1163201 - Part 1: Remove instances of #ifdef PR_LOGGING in dom/. r=froydnj (9979c0e74)
-  Bug 1183972 - No sync-dispatch of new GMPParent - r=cpearce (93339b530)
- Bug 1142935 - reset transports with NuwaAddConstructor(). r=tlee (277406812)
- Bug 1121676 - Use a lock to protect the list of top-level actors (r=bent) (3d0be2f87)
-  Bug 1121676 - Use static mutex to protect top-level protocols (r=bent) (4491dd318)
- Bug 1163201 - Part 2: Wrap expensive calls in PR_LOG_TEST. r=froydnj (7de4b9a97)
- Bug 1163201 - Part 3: Remove mSamples in |MediaEngineWebRTCAudioSource|. r=cpeterson (452442773)
- Bug 1163201 - Part 4: Fix b2g build. r=bustage (a824ea36d)
- Bug 1165518 - Part 1: Add Logging.h. r=froydnj (09d68aaa6)
- Bug 1162850 - Don't stop looking for style sheet load finishes after the FontFaceSet gets a DOMContentLoaded. r=jdaggett (c29fbffa0)
- Bug 1056479 p0 - rename ambiguous GetFontList method in Android fontlist. r=m_kato (76239d7a0)
- Bug 1056479 p1 - add language to FindFamily parameters. r=jfkthame (2271bd7d0)
- Bug 1056479 p1a - use lang as part of pref font fallback. r=karlt (5f5fd66c5)
- cleanup GetTableFromFontData() to match gecko code again (78076fc26)
- Bug 1056479 p2 - implement platform fontlist based on fontconfig. r=karlt (6a7631e44)
- Bug 1056479 p3 - fixup various reftests for Linux. r=jfkthame (b25360708)
- Bug 1056479 p4 - fix accessibility api for font-weight. r=jfkthame (efa8f5080)
- Bug 1056479 p5 - fixup printpreview test. r=jfkthame (3fe2ddc0b)
- Bug 1056479 p6 - handle font updates. r=jfkthame (eb78b2c54)
- Bug 1056479 p7 - fixup assertion for non-italic fallback. r=m_kato (f5e9f539e)
- Bug 1056479 p8 - switch gfxFontConfig to gfxFontconfig. r=karlt (4da146b50)
- Bug 1056479 p9 - fix build bustage. r=birtles (28f246c2b)
- Bug 1056479 p10 - activate bundled fonts. r=m_kato (d7627c3fa)
- Bug 1056479 p10 - activate bundled fonts. r=m_kato (251c02315)
- Bug 1056479 followup: Annotate gfxPlatformGtk::CreatePlatformFontList() as 'override'. rs=ehsan (993e65d6e)
This commit is contained in:
2020-05-30 09:52:10 +08:00
parent 4ac9bef80d
commit fdb63ff9b9
166 changed files with 2358 additions and 981 deletions
+27 -14
View File
@@ -18,6 +18,10 @@
#include "mozilla/AppUnits.h"
#include "mozilla/gfx/2D.h"
#if defined(MOZ_WIDGET_GTK)
#include "gfxPlatformGtk.h" // xxx - for UseFcFontList
#endif
using namespace mozilla;
using namespace mozilla::a11y;
@@ -628,21 +632,30 @@ TextAttrsMgr::FontWeightTextAttr::
if (font->IsSyntheticBold())
return 700;
#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)
// On Linux, font->GetStyle()->weight will give the absolute weight requested
// of the font face. The Linux code uses the gfxFontEntry constructor which
// doesn't initialize the weight field.
return font->GetStyle()->weight;
#else
// On Windows, font->GetStyle()->weight will give the same weight as
// fontEntry->Weight(), the weight of the first font in the font group, which
// may not be the weight of the font face used to render the characters.
// On Mac, font->GetStyle()->weight will just give the same number as
// getComputedStyle(). fontEntry->Weight() will give the weight of the font
// face used.
gfxFontEntry *fontEntry = font->GetFontEntry();
return fontEntry->Weight();
bool useFontEntryWeight = true;
// Under Linux, when gfxPangoFontGroup code is used,
// font->GetStyle()->weight will give the absolute weight requested of the
// font face. The gfxPangoFontGroup code uses the gfxFontEntry constructor
// which doesn't initialize the weight field.
#if defined(MOZ_WIDGET_QT)
useFontEntryWeight = false;
#elif defined(MOZ_WIDGET_GTK)
useFontEntryWeight = gfxPlatformGtk::UseFcFontList();
#endif
if (useFontEntryWeight) {
// On Windows, font->GetStyle()->weight will give the same weight as
// fontEntry->Weight(), the weight of the first font in the font group,
// which may not be the weight of the font face used to render the
// characters. On Mac, font->GetStyle()->weight will just give the same
// number as getComputedStyle(). fontEntry->Weight() will give the weight
// of the font face used.
gfxFontEntry *fontEntry = font->GetFontEntry();
return fontEntry->Weight();
} else {
return font->GetStyle()->weight;
}
}
////////////////////////////////////////////////////////////////////////////////
+2 -14
View File
@@ -25,9 +25,7 @@
NS_IMPL_ISUPPORTS(nsContentPolicy, nsIContentPolicy)
#ifdef PR_LOGGING
static PRLogModuleInfo* gConPolLog;
#endif
nsresult
NS_NewContentPolicy(nsIContentPolicy **aResult)
@@ -43,11 +41,9 @@ nsContentPolicy::nsContentPolicy()
: mPolicies(NS_CONTENTPOLICY_CATEGORY)
, mSimplePolicies(NS_SIMPLECONTENTPOLICY_CATEGORY)
{
#ifdef PR_LOGGING
if (! gConPolLog) {
gConPolLog = PR_NewLogModule("nsContentPolicy");
}
#endif
}
nsContentPolicy::~nsContentPolicy()
@@ -204,14 +200,12 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod,
return NS_OK;
}
#ifdef PR_LOGGING
//uses the parameters from ShouldXYZ to produce and log a message
//logType must be a literal string constant
#define LOG_CHECK(logType) \
PR_BEGIN_MACRO \
/* skip all this nonsense if the call failed */ \
if (NS_SUCCEEDED(rv)) { \
/* skip all this nonsense if the call failed or logging is disabled */ \
if (NS_SUCCEEDED(rv) && PR_LOG_TEST(gConPolLog, PR_LOG_DEBUG)) { \
const char *resultName; \
if (decision) { \
resultName = NS_CP_ResponseName(*decision); \
@@ -233,12 +227,6 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod,
} \
PR_END_MACRO
#else //!defined(PR_LOGGING)
#define LOG_CHECK(logType)
#endif //!defined(PR_LOGGING)
NS_IMETHODIMP
nsContentPolicy::ShouldLoad(uint32_t contentType,
nsIURI *contentLocation,
-3
View File
@@ -57,7 +57,6 @@ class nsIPrincipal;
case nsIContentPolicy:: name : \
return #name
#ifdef PR_LOGGING
/**
* Returns a string corresponding to the name of the response constant, or
* "<Unknown Response>" if an unknown response value is given.
@@ -120,8 +119,6 @@ NS_CP_ContentTypeName(uint32_t contentType)
}
}
#endif // defined(PR_LOGGING)
#undef CASE_RETURN
/* Passes on parameters from its "caller"'s context. */
-2
View File
@@ -9,9 +9,7 @@
#include "base/basictypes.h"
#include "prlog.h"
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetDataChannelLog();
#endif
#undef LOG
#define LOG(args) PR_LOG(GetDataChannelLog(), PR_LOG_DEBUG, args)
+11 -36
View File
@@ -240,10 +240,8 @@ using namespace mozilla::dom;
typedef nsTArray<Link*> LinkArray;
#ifdef PR_LOGGING
static PRLogModuleInfo* gDocumentLeakPRLog;
static PRLogModuleInfo* gCspPRLog;
#endif
#define NAME_NOT_VALID ((nsSimpleContentList*)1)
@@ -1579,7 +1577,6 @@ nsDocument::nsDocument(const char* aContentType)
{
SetContentTypeInternal(nsDependentCString(aContentType));
#ifdef PR_LOGGING
if (!gDocumentLeakPRLog)
gDocumentLeakPRLog = PR_NewLogModule("DocumentLeak");
@@ -1589,7 +1586,6 @@ nsDocument::nsDocument(const char* aContentType)
if (!gCspPRLog)
gCspPRLog = PR_NewLogModule("CSP");
#endif
// Start out mLastStyleSheetSet as null, per spec
SetDOMStringToNull(mLastStyleSheetSet);
@@ -1626,11 +1622,9 @@ nsIDocument::~nsIDocument()
nsDocument::~nsDocument()
{
#ifdef PR_LOGGING
if (gDocumentLeakPRLog)
PR_LOG(gDocumentLeakPRLog, PR_LOG_DEBUG,
("DOCUMENT %p destroyed", this));
#endif
NS_ASSERTION(!mIsShowing, "Destroying a currently-showing document");
@@ -2307,13 +2301,11 @@ nsDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup,
{
NS_PRECONDITION(aURI, "Null URI passed to ResetToURI");
#ifdef PR_LOGGING
if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) {
nsAutoCString spec;
aURI->GetSpec(spec);
PR_LogPrint("DOCUMENT %p ResetToURI %s", this, spec.get());
}
#endif
mSecurityInfo = nullptr;
@@ -2645,7 +2637,6 @@ nsDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel,
nsIStreamListener **aDocListener,
bool aReset, nsIContentSink* aSink)
{
#ifdef PR_LOGGING
if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) {
nsCOMPtr<nsIURI> uri;
aChannel->GetURI(getter_AddRefs(uri));
@@ -2654,7 +2645,6 @@ nsDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel,
uri->GetSpec(spec);
PR_LogPrint("DOCUMENT %p StartDocumentLoad %s", this, spec.get());
}
#endif
#ifdef DEBUG
{
@@ -2788,13 +2778,11 @@ AppendCSPFromHeader(nsIContentSecurityPolicy* csp,
const nsSubstring& policy = tokenizer.nextToken();
rv = csp->AppendPolicy(policy, aReportOnly);
NS_ENSURE_SUCCESS(rv, rv);
#ifdef PR_LOGGING
{
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
("CSP refined with policy: \"%s\"",
NS_ConvertUTF16toUTF8(policy).get()));
}
#endif
}
return NS_OK;
}
@@ -2831,10 +2819,8 @@ nsDocument::InitCSP(nsIChannel* aChannel)
{
nsCOMPtr<nsIContentSecurityPolicy> csp;
if (!CSPService::sCSPEnabled) {
#ifdef PR_LOGGING
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
("CSP is disabled, skipping CSP init for document %p", this));
#endif
return NS_OK;
}
@@ -2898,22 +2884,21 @@ nsDocument::InitCSP(nsIChannel* aChannel)
!applyLoopCSP &&
cspHeaderValue.IsEmpty() &&
cspROHeaderValue.IsEmpty()) {
#ifdef PR_LOGGING
nsCOMPtr<nsIURI> chanURI;
aChannel->GetURI(getter_AddRefs(chanURI));
nsAutoCString aspec;
chanURI->GetAsciiSpec(aspec);
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
("no CSP for document, %s, %s",
aspec.get(),
applyAppDefaultCSP ? "is app" : "not an app"));
#endif
if (PR_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) {
nsCOMPtr<nsIURI> chanURI;
aChannel->GetURI(getter_AddRefs(chanURI));
nsAutoCString aspec;
chanURI->GetAsciiSpec(aspec);
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
("no CSP for document, %s, %s",
aspec.get(),
applyAppDefaultCSP ? "is app" : "not an app"));
}
return NS_OK;
}
#ifdef PR_LOGGING
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("Document is an app or CSP header specified %p", this));
#endif
nsresult rv;
@@ -2932,12 +2917,10 @@ nsDocument::InitCSP(nsIChannel* aChannel)
NS_ENSURE_SUCCESS(rv, rv);
if (csp) {
#ifdef PR_LOGGING
PR_LOG(gCspPRLog, PR_LOG_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."));
#endif
return NS_OK;
}
}
@@ -2945,9 +2928,7 @@ nsDocument::InitCSP(nsIChannel* aChannel)
csp = do_CreateInstance("@mozilla.org/cspcontext;1", &rv);
if (NS_FAILED(rv)) {
#ifdef PR_LOGGING
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("Failed to create CSP object: %x", rv));
#endif
return rv;
}
@@ -3000,10 +2981,8 @@ nsDocument::InitCSP(nsIChannel* aChannel)
rv = csp->PermitsAncestry(docShell, &safeAncestry);
if (NS_FAILED(rv) || !safeAncestry) {
#ifdef PR_LOGGING
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
("CSP doesn't like frame's ancestry, not loading."));
#endif
// stop! ERROR page!
aChannel->Cancel(NS_ERROR_CSP_FRAME_ANCESTOR_VIOLATION);
}
@@ -3022,13 +3001,11 @@ nsDocument::InitCSP(nsIChannel* aChannel)
mReferrerPolicySet = true;
} else if (mReferrerPolicy != referrerPolicy) {
mReferrerPolicy = mozilla::net::RP_No_Referrer;
#ifdef PR_LOGGING
{
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("%s %s",
"CSP wants to set referrer, but nsDocument"
"already has it set. No referrers will be sent"));
}
#endif
}
// Referrer Policy is set separately for the speculative parser in
@@ -3038,10 +3015,8 @@ nsDocument::InitCSP(nsIChannel* aChannel)
rv = principal->SetCsp(csp);
NS_ENSURE_SUCCESS(rv, rv);
#ifdef PR_LOGGING
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
("Inserted CSP into principal %p", principal));
#endif
return NS_OK;
}
+4 -29
View File
@@ -69,38 +69,27 @@ using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::widget;
#ifdef PR_LOGGING
// Two types of focus pr logging are available:
// 'Focus' for normal focus manager calls
// 'FocusNavigation' for tab and document navigation
PRLogModuleInfo* gFocusLog;
PRLogModuleInfo* gFocusNavigationLog;
#define LOGFOCUS(args) PR_LOG(gFocusLog, 4, args)
#define LOGFOCUSNAVIGATION(args) PR_LOG(gFocusNavigationLog, 4, args)
#define LOGFOCUS(args) PR_LOG(gFocusLog, PR_LOG_DEBUG, args)
#define LOGFOCUSNAVIGATION(args) PR_LOG(gFocusNavigationLog, PR_LOG_DEBUG, args)
#define LOGTAG(log, format, content) \
{ \
if (PR_LOG_TEST(log, PR_LOG_DEBUG)) { \
nsAutoCString tag(NS_LITERAL_CSTRING("(none)")); \
if (content) { \
content->NodeInfo()->NameAtom()->ToUTF8String(tag); \
} \
PR_LOG(log, 4, (format, tag.get())); \
PR_LOG(log, PR_LOG_DEBUG, (format, tag.get())); \
}
#define LOGCONTENT(format, content) LOGTAG(gFocusLog, format, content)
#define LOGCONTENTNAVIGATION(format, content) LOGTAG(gFocusNavigationLog, format, content)
#else
#define LOGFOCUS(args)
#define LOGFOCUSNAVIGATION(args)
#define LOGCONTENT(format, content)
#define LOGCONTENTNAVIGATION(format, content)
#endif
struct nsDelayedBlurOrFocusEvent
{
nsDelayedBlurOrFocusEvent(uint32_t aType,
@@ -196,10 +185,8 @@ nsFocusManager::Init()
NS_ADDREF(fm);
sInstance = fm;
#ifdef PR_LOGGING
gFocusLog = PR_NewLogModule("Focus");
gFocusNavigationLog = PR_NewLogModule("FocusNavigation");
#endif
nsIContent::sTabFocusModelAppliesToXUL =
Preferences::GetBool("accessibility.tabfocus_applies_to_xul",
@@ -491,7 +478,6 @@ nsFocusManager::MoveFocus(nsIDOMWindow* aWindow, nsIDOMElement* aStartElement,
{
*aElement = nullptr;
#ifdef PR_LOGGING
LOGFOCUS(("<<MoveFocus begin Type: %d Flags: %x>>", aType, aFlags));
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG) && mFocusedWindow) {
@@ -504,7 +490,6 @@ nsFocusManager::MoveFocus(nsIDOMWindow* aWindow, nsIDOMElement* aStartElement,
}
LOGCONTENT(" Current Focus: %s", mFocusedContent.get());
#endif
// use FLAG_BYMOVEFOCUS when switching focus with MoveFocus unless one of
// the other focus methods is already set, or we're just moving to the root
@@ -651,7 +636,6 @@ nsFocusManager::WindowRaised(nsIDOMWindow* aWindow)
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aWindow);
NS_ENSURE_TRUE(window && window->IsOuterWindow(), NS_ERROR_INVALID_ARG);
#ifdef PR_LOGGING
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
LOGFOCUS(("Window %p Raised [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get()));
nsAutoCString spec;
@@ -668,7 +652,6 @@ nsFocusManager::WindowRaised(nsIDOMWindow* aWindow)
}
}
}
#endif
if (mActiveWindow == window) {
// The window is already active, so there is no need to focus anything,
@@ -749,7 +732,6 @@ nsFocusManager::WindowLowered(nsIDOMWindow* aWindow)
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aWindow);
NS_ENSURE_TRUE(window && window->IsOuterWindow(), NS_ERROR_INVALID_ARG);
#ifdef PR_LOGGING
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
LOGFOCUS(("Window %p Lowered [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get()));
nsAutoCString spec;
@@ -766,7 +748,6 @@ nsFocusManager::WindowLowered(nsIDOMWindow* aWindow)
}
}
}
#endif
if (mActiveWindow != window)
return NS_OK;
@@ -869,7 +850,6 @@ nsFocusManager::WindowShown(nsIDOMWindow* aWindow, bool aNeedsFocus)
window = window->GetOuterWindow();
#ifdef PR_LOGGING
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
LOGFOCUS(("Window %p Shown [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get()));
nsAutoCString spec;
@@ -887,7 +867,6 @@ nsFocusManager::WindowShown(nsIDOMWindow* aWindow, bool aNeedsFocus)
}
}
}
#endif
if (nsCOMPtr<nsITabChild> child = do_GetInterface(window->GetDocShell())) {
bool active = static_cast<TabChild*>(child.get())->ParentIsActive();
@@ -926,7 +905,6 @@ nsFocusManager::WindowHidden(nsIDOMWindow* aWindow)
window = window->GetOuterWindow();
#ifdef PR_LOGGING
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
LOGFOCUS(("Window %p Hidden [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get()));
nsAutoCString spec;
@@ -952,7 +930,6 @@ nsFocusManager::WindowHidden(nsIDOMWindow* aWindow)
}
}
}
#endif
if (!IsSameOrAncestor(window, mFocusedWindow))
return NS_OK;
@@ -1792,7 +1769,6 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow,
clearFirstFocusEvent = true;
}
#ifdef PR_LOGGING
LOGCONTENT("Element %s has been focused", aContent);
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
@@ -1803,7 +1779,6 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow,
LOGFOCUS((" [Newdoc: %d FocusChanged: %d Raised: %d Flags: %x]",
aIsNewDocument, aFocusChanged, aWindowRaised, aFlags));
}
#endif
if (aIsNewDocument) {
// if this is a new document, update the parent chain of frames so that
-18
View File
@@ -245,9 +245,7 @@ class nsIScriptTimeoutHandler;
#include <android/log.h>
#endif
#ifdef PR_LOGGING
static PRLogModuleInfo* gDOMLeakPRLog;
#endif
#ifdef XP_WIN
#include <process.h>
@@ -1208,11 +1206,9 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow)
}
#endif
#ifdef PR_LOGGING
if (gDOMLeakPRLog)
PR_LOG(gDOMLeakPRLog, PR_LOG_DEBUG,
("DOMWINDOW %p created outer=%p", this, aOuterWindow));
#endif
NS_ASSERTION(sWindowsById, "Windows hash table must be created!");
NS_ASSERTION(!sWindowsById->Get(mWindowID),
@@ -1244,10 +1240,8 @@ nsGlobalWindow::Init()
NS_ASSERTION(gEntropyCollector,
"gEntropyCollector should have been initialized!");
#ifdef PR_LOGGING
gDOMLeakPRLog = PR_NewLogModule("DOMLeak");
NS_ASSERTION(gDOMLeakPRLog, "gDOMLeakPRLog should have been initialized!");
#endif
sWindowsById = new WindowByIdTable();
}
@@ -1302,11 +1296,9 @@ nsGlobalWindow::~nsGlobalWindow()
}
#endif
#ifdef PR_LOGGING
if (gDOMLeakPRLog)
PR_LOG(gDOMLeakPRLog, PR_LOG_DEBUG,
("DOMWINDOW %p destroyed", this));
#endif
if (IsOuterWindow()) {
JSObject *proxy = GetWrapperPreserveColor();
@@ -2824,7 +2816,6 @@ nsGlobalWindow::InnerSetNewDocument(JSContext* aCx, nsIDocument* aDocument)
NS_PRECONDITION(IsInnerWindow(), "Must only be called on inner windows");
MOZ_ASSERT(aDocument);
#ifdef PR_LOGGING
if (gDOMLeakPRLog && PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
nsIURI *uri = aDocument->GetDocumentURI();
nsAutoCString spec;
@@ -2832,7 +2823,6 @@ nsGlobalWindow::InnerSetNewDocument(JSContext* aCx, nsIDocument* aDocument)
uri->GetSpec(spec);
PR_LogPrint("DOMWINDOW %p SetNewDocument %s", this, spec.get());
}
#endif
mDoc = aDocument;
ClearDocumentDependentSlots(aCx);
@@ -10616,11 +10606,9 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
}
if (mSessionStorage) {
#ifdef PR_LOGGING
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
PR_LogPrint("nsGlobalWindow %p has %p sessionStorage", this, mSessionStorage.get());
}
#endif
bool canAccess = mSessionStorage->CanAccess(principal);
NS_ASSERTION(canAccess,
"This window owned sessionStorage "
@@ -10669,11 +10657,9 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
mSessionStorage = static_cast<DOMStorage*>(storage.get());
MOZ_ASSERT(mSessionStorage);
#ifdef PR_LOGGING
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
PR_LogPrint("nsGlobalWindow %p tried to get a new sessionStorage %p", this, mSessionStorage.get());
}
#endif
if (!mSessionStorage) {
aError.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
@@ -10681,11 +10667,9 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
}
}
#ifdef PR_LOGGING
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
PR_LogPrint("nsGlobalWindow %p returns %p sessionStorage", this, mSessionStorage.get());
}
#endif
return mSessionStorage;
}
@@ -11601,12 +11585,10 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic,
return NS_OK;
}
#ifdef PR_LOGGING
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
PR_LogPrint("nsGlobalWindow %p with sessionStorage %p passing event from %p",
this, mSessionStorage.get(), changingStorage.get());
}
#endif
fireMozStorageChanged = mSessionStorage == changingStorage;
break;
-8
View File
@@ -35,9 +35,7 @@ using mozilla::dom::NodeInfo;
#include "prlog.h"
#ifdef PR_LOGGING
static PRLogModuleInfo* gNodeInfoManagerLeakPRLog;
#endif
PLHashNumber
nsNodeInfoManager::GetNodeInfoInnerHashValue(const void *key)
@@ -116,14 +114,12 @@ nsNodeInfoManager::nsNodeInfoManager()
{
nsLayoutStatics::AddRef();
#ifdef PR_LOGGING
if (!gNodeInfoManagerLeakPRLog)
gNodeInfoManagerLeakPRLog = PR_NewLogModule("NodeInfoManagerLeak");
if (gNodeInfoManagerLeakPRLog)
PR_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
("NODEINFOMANAGER %p created", this));
#endif
mNodeInfoHash = PL_NewHashTable(32, GetNodeInfoInnerHashValue,
NodeInfoInnerKeyCompare,
@@ -141,11 +137,9 @@ nsNodeInfoManager::~nsNodeInfoManager()
mBindingManager = nullptr;
#ifdef PR_LOGGING
if (gNodeInfoManagerLeakPRLog)
PR_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
("NODEINFOMANAGER %p destroyed", this));
#endif
nsLayoutStatics::Release();
}
@@ -200,11 +194,9 @@ nsNodeInfoManager::Init(nsIDocument *aDocument)
mDocument = aDocument;
#ifdef PR_LOGGING
if (gNodeInfoManagerLeakPRLog)
PR_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
("NODEINFOMANAGER %p Init document=%p", this, aDocument));
#endif
return NS_OK;
}
-2
View File
@@ -107,7 +107,6 @@ static const char *kPrefYoutubeRewrite = "plugins.rewrite_youtube_embeds";
using namespace mozilla;
using namespace mozilla::dom;
#ifdef PR_LOGGING
static PRLogModuleInfo*
GetObjectLog()
{
@@ -116,7 +115,6 @@ GetObjectLog()
sLog = PR_NewLogModule("objlc");
return sLog;
}
#endif
#define LOG(args) PR_LOG(GetObjectLog(), PR_LOG_DEBUG, args)
#define LOG_ENABLED() PR_LOG_TEST(GetObjectLog(), PR_LOG_DEBUG)
-4
View File
@@ -55,9 +55,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/unused.h"
#ifdef PR_LOGGING
static PRLogModuleInfo* gCspPRLog;
#endif
using namespace mozilla;
using namespace mozilla::dom;
@@ -139,10 +137,8 @@ nsScriptLoader::nsScriptLoader(nsIDocument *aDocument)
mBlockingDOMContentLoaded(false)
{
// enable logging for CSP
#ifdef PR_LOGGING
if (!gCspPRLog)
gCspPRLog = PR_NewLogModule("CSP");
#endif
}
nsScriptLoader::~nsScriptLoader()
-8
View File
@@ -17,12 +17,8 @@
#include "prlog.h"
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetCameraLog();
#define DOM_CAMERA_LOG( type, ... ) PR_LOG(GetCameraLog(), (PRLogModuleLevel)type, ( __VA_ARGS__ ))
#else
#define DOM_CAMERA_LOG( type, ... )
#endif
#define DOM_CAMERA_LOGA( ... ) DOM_CAMERA_LOG( 0, __VA_ARGS__ )
@@ -42,16 +38,12 @@ enum {
* DOM_CAMERA_LOGR() can be called before 'gCameraLog' is set, so
* we need to handle this one a little differently.
*/
#ifdef PR_LOGGING
#define DOM_CAMERA_LOGR( ... ) \
do { \
if (GetCameraLog()) { \
DOM_CAMERA_LOG( DOM_CAMERA_LOG_REFERENCES, __VA_ARGS__ ); \
} \
} while (0)
#else
#define DOM_CAMERA_LOGR( ... )
#endif
#define DOM_CAMERA_LOGT( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_TRACE, __VA_ARGS__ )
#define DOM_CAMERA_LOGI( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_INFO, __VA_ARGS__ )
#define DOM_CAMERA_LOGW( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_WARNING, __VA_ARGS__ )
-8
View File
@@ -79,7 +79,6 @@ CameraControlImpl::OnHardwareStateChange(CameraControlListener::HardwareState aN
return;
}
#ifdef PR_LOGGING
const char* state[] = { "uninitialized", "closed", "open", "failed" };
MOZ_ASSERT(aNewState >= 0);
if (static_cast<unsigned int>(aNewState) < sizeof(state) / sizeof(state[0])) {
@@ -88,7 +87,6 @@ CameraControlImpl::OnHardwareStateChange(CameraControlListener::HardwareState aN
} else {
DOM_CAMERA_LOGE("OnHardwareStateChange: got invalid HardwareState value %d\n", aNewState);
}
#endif
mHardwareState = aNewState;
mHardwareStateChangeReason = aReason;
@@ -208,7 +206,6 @@ CameraControlImpl::OnPreviewStateChange(CameraControlListener::PreviewState aNew
return;
}
#ifdef PR_LOGGING
const char* state[] = { "stopped", "paused", "started" };
MOZ_ASSERT(aNewState >= 0);
if (static_cast<unsigned int>(aNewState) < sizeof(state) / sizeof(state[0])) {
@@ -216,7 +213,6 @@ CameraControlImpl::OnPreviewStateChange(CameraControlListener::PreviewState aNew
} else {
DOM_CAMERA_LOGE("OnPreviewStateChange: got unknown PreviewState value %d\n", aNewState);
}
#endif
mPreviewState = aNewState;
@@ -267,7 +263,6 @@ CameraControlImpl::OnUserError(CameraControlListener::UserContext aContext,
// the Camera Thread.
RwLockAutoEnterRead lock(mListenerLock);
#ifdef PR_LOGGING
const char* context[] = {
"StartCamera",
"StopCamera",
@@ -292,7 +287,6 @@ CameraControlImpl::OnUserError(CameraControlListener::UserContext aContext,
DOM_CAMERA_LOGE("CameraControlImpl::OnUserError : aContext=%d, aError=0x%x\n",
aContext, aError);
}
#endif
for (uint32_t i = 0; i < mListeners.Length(); ++i) {
CameraControlListener* l = mListeners[i];
@@ -308,7 +302,6 @@ CameraControlImpl::OnSystemError(CameraControlListener::SystemContext aContext,
// the Camera Thread.
RwLockAutoEnterRead lock(mListenerLock);
#ifdef PR_LOGGING
const char* context[] = {
"Camera Service"
};
@@ -319,7 +312,6 @@ CameraControlImpl::OnSystemError(CameraControlListener::SystemContext aContext,
DOM_CAMERA_LOGE("CameraControlImpl::OnSystemError : aContext=%d, aError=0x%x\n",
aContext, aError);
}
#endif
for (uint32_t i = 0; i < mListeners.Length(); ++i) {
CameraControlListener* l = mListeners[i];
-5
View File
@@ -2143,12 +2143,7 @@ OnSystemError(nsGonkCameraControl* gc,
CameraControlListener::SystemContext aWhere,
int32_t aArg1, int32_t aArg2)
{
#ifdef PR_LOGGING
DOM_CAMERA_LOGE("OnSystemError : aWhere=%d, aArg1=%d, aArg2=%d\n", aWhere, aArg1, aArg2);
#else
unused << aArg1;
unused << aArg2;
#endif
gc->OnSystemError(aWhere, NS_ERROR_FAILURE);
}
+9 -15
View File
@@ -41,7 +41,6 @@ namespace mozilla {
using namespace dom;
using namespace widget;
#ifdef PR_LOGGING
/**
* 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
@@ -175,7 +174,6 @@ GetNotifyIMEMessageName(IMEMessage aMessage)
return "unacceptable IME notification message";
}
}
#endif // #ifdef PR_LOGGING
nsIContent* IMEStateManager::sContent = nullptr;
nsPresContext* IMEStateManager::sPresContext = nullptr;
@@ -192,11 +190,9 @@ TextCompositionArray* IMEStateManager::sTextCompositions = nullptr;
void
IMEStateManager::Init()
{
#ifdef PR_LOGGING
if (!sISMLog) {
sISMLog = PR_NewLogModule("IMEStateManager");
}
#endif
}
// static
@@ -230,7 +226,6 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
// there should be only one composition per presContext object.
sTextCompositions->ElementAt(i)->Destroy();
sTextCompositions->RemoveElementAt(i);
#if defined DEBUG || PR_LOGGING
if (sTextCompositions->IndexOf(aPresContext) !=
TextCompositionArray::NoIndex) {
PR_LOG(sISMLog, PR_LOG_ERROR,
@@ -238,7 +233,6 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
"TextComposition instance from the array"));
MOZ_CRASH("Failed to remove TextComposition instance from the array");
}
#endif // #if defined DEBUG || PR_LOGGING
}
}
@@ -511,15 +505,15 @@ IMEStateManager::OnMouseButtonEventInEditor(nsPresContext* aPresContext,
bool consumed =
sActiveIMEContentObserver->OnMouseButtonEvent(aPresContext, internalEvent);
#ifdef PR_LOGGING
nsAutoString eventType;
aMouseEvent->GetType(eventType);
PR_LOG(sISMLog, PR_LOG_ALWAYS,
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
"mouse event (type=%s, button=%d) is %s",
NS_ConvertUTF16toUTF8(eventType).get(), internalEvent->button,
consumed ? "consumed" : "not consumed"));
#endif
if (PR_LOG_TEST(sISMLog, PR_LOG_ALWAYS)) {
nsAutoString eventType;
aMouseEvent->GetType(eventType);
PR_LOG(sISMLog, PR_LOG_ALWAYS,
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
"mouse event (type=%s, button=%d) is %s",
NS_ConvertUTF16toUTF8(eventType).get(), internalEvent->button,
consumed ? "consumed" : "not consumed"));
}
return consumed;
}
-11
View File
@@ -90,15 +90,10 @@
#include "nsRange.h"
#include <algorithm>
#ifdef PR_LOGGING
static PRLogModuleInfo* gMediaElementLog;
static PRLogModuleInfo* gMediaElementEventsLog;
#define LOG(type, msg) PR_LOG(gMediaElementLog, type, msg)
#define LOG_EVENT(type, msg) PR_LOG(gMediaElementEventsLog, type, msg)
#else
#define LOG(type, msg)
#define LOG_EVENT(type, msg)
#endif
#include "nsIContentSecurityPolicy.h"
@@ -2085,14 +2080,12 @@ HTMLMediaElement::HTMLMediaElement(already_AddRefed<mozilla::dom::NodeInfo>& aNo
mHasUserInteraction(false),
mDefaultPlaybackStartPosition(0.0)
{
#ifdef PR_LOGGING
if (!gMediaElementLog) {
gMediaElementLog = PR_NewLogModule("nsMediaElement");
}
if (!gMediaElementEventsLog) {
gMediaElementEventsLog = PR_NewLogModule("nsMediaElementEvents");
}
#endif
ErrorResult rv;
double defaultVolume = Preferences::GetFloat("media.default_volume", 1.0);
@@ -3621,7 +3614,6 @@ HTMLMediaElement::UpdateReadyStateInternal()
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_FUTURE_DATA);
}
#ifdef PR_LOGGING
static const char* const gReadyStateToString[] = {
"HAVE_NOTHING",
"HAVE_METADATA",
@@ -3629,7 +3621,6 @@ static const char* const gReadyStateToString[] = {
"HAVE_FUTURE_DATA",
"HAVE_ENOUGH_DATA"
};
#endif
void HTMLMediaElement::ChangeReadyState(nsMediaReadyState aState)
{
@@ -3681,14 +3672,12 @@ void HTMLMediaElement::ChangeReadyState(nsMediaReadyState aState)
}
}
#ifdef PR_LOGGING
static const char* const gNetworkStateToString[] = {
"EMPTY",
"IDLE",
"LOADING",
"NO_SOURCE"
};
#endif
void HTMLMediaElement::ChangeNetworkState(nsMediaNetworkState aState)
{
-6
View File
@@ -39,12 +39,8 @@
#include "nsThreadUtils.h"
#include "nsVideoFrame.h"
#ifdef PR_LOGGING
static PRLogModuleInfo* gTrackElementLog;
#define LOG(type, msg) PR_LOG(gTrackElementLog, type, msg)
#else
#define LOG(type, msg)
#endif
// Replace the usual NS_IMPL_NS_NEW_HTML_ELEMENT(Track) so
// we can return an UnknownElement instead when pref'd off.
@@ -79,11 +75,9 @@ static MOZ_CONSTEXPR const char* kKindTableDefaultString = kKindTable->tag;
HTMLTrackElement::HTMLTrackElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
#ifdef PR_LOGGING
if (!gTrackElementLog) {
gTrackElementLog = PR_NewLogModule("nsTrackElement");
}
#endif
}
HTMLTrackElement::~HTMLTrackElement()
@@ -46,10 +46,10 @@
== dir_auto-pre-N-EN.html dir_auto-pre-N-EN-ref.html
== dir_auto-R.html dir_auto-R-ref.html
== dir_auto-textarea-mixed.html dir_auto-textarea-mixed-ref.html
fails-if(B2G) == dir_auto-textarea-N-between-Rs.html dir_auto-textarea-N-between-Rs-ref.html # B2G scrollbar on opposite side
fails-if(B2G||Mulet) == dir_auto-textarea-N-between-Rs.html dir_auto-textarea-N-between-Rs-ref.html # B2G scrollbar on opposite side
== dir_auto-textarea-N-EN.html dir_auto-textarea-N-EN-ref.html
== dir_auto-textarea-script-mixed.html dir_auto-textarea-script-mixed-ref.html
fails-if(B2G) == dir_auto-textarea-script-N-between-Rs.html dir_auto-textarea-script-N-between-Rs-ref.html # B2G scrollbar on reference only
fails-if(B2G||Mulet) == dir_auto-textarea-script-N-between-Rs.html dir_auto-textarea-script-N-between-Rs-ref.html # B2G scrollbar on reference only
== dir_auto-textarea-script-N-EN.html dir_auto-textarea-script-N-EN-ref.html
== lang-xyzzy.html lang-xyzzy-ref.html
== lang-xmllang-01.html lang-xmllang-01-ref.html
+30 -15
View File
@@ -550,6 +550,26 @@ InitOnContentProcessCreated()
mozilla::dom::time::InitializeDateCacheCleaner();
}
#ifdef MOZ_NUWA_PROCESS
static void
ResetTransports(void* aUnused)
{
ContentChild* child = ContentChild::GetSingleton();
mozilla::ipc::Transport* transport = child->GetTransport();
int fd = transport->GetFileDescriptor();
transport->ResetFileDescriptor(fd);
nsTArray<IToplevelProtocol*> actors;
child->GetOpenedActors(actors);
for (size_t i = 0; i < actors.Length(); i++) {
IToplevelProtocol* toplevel = actors[i];
transport = toplevel->GetTransport();
fd = transport->GetFileDescriptor();
transport->ResetFileDescriptor(fd);
}
}
#endif
#if defined(MOZ_TASK_TRACER) && defined(MOZ_NUWA_PROCESS)
static void
ReinitTaskTracer(void* /*aUnused*/)
@@ -650,6 +670,12 @@ ContentChild::Init(MessageLoop* aIOLoop,
}
#endif
#ifdef MOZ_NUWA_PROCESS
if (IsNuwaProcess()) {
NuwaAddConstructor(ResetTransports, nullptr);
}
#endif
return true;
}
@@ -2427,18 +2453,6 @@ public:
// In the new process.
ContentChild* child = ContentChild::GetSingleton();
child->SetProcessName(NS_LITERAL_STRING("(Preallocated app)"), false);
mozilla::ipc::Transport* transport = child->GetTransport();
int fd = transport->GetFileDescriptor();
transport->ResetFileDescriptor(fd);
IToplevelProtocol* toplevel = child->GetFirstOpenedActors();
while (toplevel != nullptr) {
transport = toplevel->GetTransport();
fd = transport->GetFileDescriptor();
transport->ResetFileDescriptor(fd);
toplevel = toplevel->getNext();
}
// Perform other after-fork initializations.
InitOnContentProcessCreated();
@@ -2830,9 +2844,10 @@ GetProtoFdInfos(NuwaProtoFdInfo* aInfoList,
content->GetTransport()->GetFileDescriptor();
i++;
for (IToplevelProtocol* actor = content->GetFirstOpenedActors();
actor != nullptr;
actor = actor->getNext()) {
IToplevelProtocol* actors[NUWA_TOPLEVEL_MAX];
size_t count = content->GetOpenedActorsUnsafe(actors, ArrayLength(actors));
for (size_t j = 0; j < count; j++) {
IToplevelProtocol* actor = actors[j];
if (i >= aInfoListSize) {
NS_RUNTIMEABORT("Too many top level protocols!");
}
+1 -1
View File
@@ -2413,7 +2413,7 @@ bool
ContentParent::RecvReadFontList(InfallibleTArray<FontListEntry>* retValue)
{
#ifdef ANDROID
gfxAndroidPlatform::GetPlatform()->GetFontList(retValue);
gfxAndroidPlatform::GetPlatform()->GetSystemFontList(retValue);
#endif
return true;
}
+1 -5
View File
@@ -67,8 +67,7 @@
fmt "\n", \
NameWithComma().get(), \
static_cast<uint64_t>(ChildID()), Pid(), ##__VA_ARGS__)
#elif defined(PR_LOGGING)
#else
static PRLogModuleInfo*
GetPPMLog()
{
@@ -85,9 +84,6 @@
("ProcessPriorityManager[%schild-id=%" PRIu64 ", pid=%d] - " fmt, \
NameWithComma().get(), \
static_cast<uint64_t>(ChildID()), Pid(), ##__VA_ARGS__))
#else
#define LOG(fmt, ...)
#define LOGP(fmt, ...)
#endif
using namespace mozilla;
-5
View File
@@ -10,16 +10,11 @@
namespace mozilla {
#ifdef PR_LOGGING
extern PRLogModuleInfo* gMediaDecoderLog;
#define SINK_LOG(msg, ...) \
PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("AudioSink=%p " msg, this, ##__VA_ARGS__))
#define SINK_LOG_V(msg, ...) \
PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG+1, ("AudioSink=%p " msg, this, ##__VA_ARGS__))
#else
#define SINK_LOG(msg, ...)
#define SINK_LOG_V(msg, ...)
#endif
AudioSink::OnAudioEndTimeUpdateTask::OnAudioEndTimeUpdateTask(
MediaDecoderStateMachine* aStateMachine)
-8
View File
@@ -27,13 +27,9 @@ namespace mozilla {
#undef LOG
#endif
#ifdef PR_LOGGING
PRLogModuleInfo* gAudioStreamLog = nullptr;
// For simple logs
#define LOG(x) PR_LOG(gAudioStreamLog, PR_LOG_DEBUG, x)
#else
#define LOG(x)
#endif
/**
* When MOZ_DUMP_AUDIO is set in the environment (to anything),
@@ -1068,11 +1064,8 @@ AudioStream::DataCallback(void* aBuffer, long aFrames)
// we start getting callbacks.
// Simple version - contract on first callback only.
if (mLatencyRequest == LowLatency) {
#ifdef PR_LOGGING
uint32_t old_len = mBuffer.Length();
#endif
available = mBuffer.ContractTo(FramesToBytes(aFrames));
#ifdef PR_LOGGING
TimeStamp now = TimeStamp::Now();
if (!mStartTime.IsNull()) {
int64_t timeMs = (now - mStartTime).ToMilliseconds();
@@ -1090,7 +1083,6 @@ AudioStream::DataCallback(void* aBuffer, long aFrames)
mReadPoint, BytesToFrames(old_len - available), mOutRate));
mReadPoint += BytesToFrames(old_len - available);
}
#endif
}
mState = RUNNING;
}
-2
View File
@@ -126,9 +126,7 @@ bool CubebLatencyPrefSet()
void InitLibrary()
{
#ifdef PR_LOGGING
gAudioStreamLog = PR_NewLogModule("AudioStream");
#endif
PrefChanged(PREF_VOLUME_SCALE, nullptr);
Preferences::RegisterCallback(PrefChanged, PREF_VOLUME_SCALE);
PrefChanged(PREF_CUBEB_LATENCY, nullptr);
-4
View File
@@ -10,12 +10,8 @@
#include <sys/sysctl.h>
#endif
#ifdef PR_LOGGING
extern PRLogModuleInfo* gMediaStreamGraphLog;
#define STREAM_LOG(type, msg) PR_LOG(gMediaStreamGraphLog, type, msg)
#else
#define STREAM_LOG(type, msg)
#endif
// We don't use NSPR log here because we want this interleaved with adb logcat
// on Android/B2G
-6
View File
@@ -24,12 +24,8 @@
namespace mozilla {
#ifdef PR_LOGGING
PRLogModuleInfo* gMediaCacheLog;
#define CACHE_LOG(type, msg) PR_LOG(gMediaCacheLog, type, msg)
#else
#define CACHE_LOG(type, msg)
#endif
// Readahead blocks for non-seekable streams will be limited to this
// fraction of the cache space. We don't normally evict such blocks
@@ -587,11 +583,9 @@ MediaCache::Init()
rv = mFileCache->Open(fileDesc);
NS_ENSURE_SUCCESS(rv,rv);
#ifdef PR_LOGGING
if (!gMediaCacheLog) {
gMediaCacheLog = PR_NewLogModule("MediaCache");
}
#endif
MediaCacheFlusher::Init();
-4
View File
@@ -58,13 +58,9 @@ static const uint64_t ESTIMATED_DURATION_FUZZ_FACTOR_USECS = USECS_PER_S / 2;
// avoid redefined macro in unified build
#undef DECODER_LOG
#ifdef PR_LOGGING
PRLogModuleInfo* gMediaDecoderLog;
#define DECODER_LOG(x, ...) \
PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("Decoder=%p " x, this, ##__VA_ARGS__))
#else
#define DECODER_LOG(x, ...)
#endif
static const char* const gPlayStateStr[] = {
"START",
-4
View File
@@ -20,13 +20,9 @@ namespace mozilla {
// Un-comment to enable logging of seek bisections.
//#define SEEK_LOGGING
#ifdef PR_LOGGING
extern PRLogModuleInfo* gMediaDecoderLog;
#define DECODER_LOG(x, ...) \
PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("Decoder=%p " x, mDecoder, ##__VA_ARGS__))
#else
#define DECODER_LOG(x, ...)
#endif
// Same workaround as MediaDecoderStateMachine.cpp.
#define DECODER_WARN_HELPER(a, b) NS_WARNING b
-12
View File
@@ -56,7 +56,6 @@ using namespace mozilla::media;
#undef DECODER_LOG
#undef VERBOSE_LOG
#ifdef PR_LOGGING
extern PRLogModuleInfo* gMediaDecoderLog;
extern PRLogModuleInfo* gMediaSampleLog;
#define LOG(m, l, x, ...) \
@@ -67,11 +66,6 @@ extern PRLogModuleInfo* gMediaSampleLog;
LOG(gMediaDecoderLog, PR_LOG_DEBUG+1, x, ##__VA_ARGS__)
#define SAMPLE_LOG(x, ...) \
LOG(gMediaSampleLog, PR_LOG_DEBUG, x, ##__VA_ARGS__)
#else
#define DECODER_LOG(x, ...)
#define VERBOSE_LOG(x, ...)
#define SAMPLE_LOG(x, ...)
#endif
// Somehow MSVC doesn't correctly delete the comma before ##__VA_ARGS__
// when __VA_ARGS__ expands to nothing. This is a workaround for it.
@@ -2955,17 +2949,13 @@ void MediaDecoderStateMachine::AdvanceFrame()
nsRefPtr<VideoData> currentFrame;
if (VideoQueue().GetSize() > 0) {
VideoData* frame = VideoQueue().PeekFront();
#ifdef PR_LOGGING
int32_t droppedFrames = 0;
#endif
while (IsRealTime() || clock_time >= frame->mTime) {
mVideoFrameEndTime = frame->GetEndTime();
if (currentFrame) {
mDecoder->NotifyDecodedFrames(0, 0, 1);
#ifdef PR_LOGGING
VERBOSE_LOG("discarding video frame mTime=%lld clock_time=%lld (%d so far)",
currentFrame->mTime, clock_time, ++droppedFrames);
#endif
}
currentFrame = frame;
nsRefPtr<VideoData> releaseMe = PopVideo();
@@ -3310,12 +3300,10 @@ void MediaDecoderStateMachine::StartBuffering()
SetState(DECODER_STATE_BUFFERING);
DECODER_LOG("Changed state from DECODING to BUFFERING, decoded for %.3lfs",
decodeDuration.ToSeconds());
#ifdef PR_LOGGING
MediaDecoder::Statistics stats = mDecoder->GetStatistics();
DECODER_LOG("Playback rate: %.1lfKB/s%s download rate: %.1lfKB/s%s",
stats.mPlaybackRate/1024, stats.mPlaybackRateReliable ? "" : " (unreliable)",
stats.mDownloadRate/1024, stats.mDownloadRateReliable ? "" : " (unreliable)");
#endif
}
void MediaDecoderStateMachine::SetPlayStartTime(const TimeStamp& aTimeStamp)
-4
View File
@@ -100,7 +100,6 @@ namespace mozilla {
#undef LOG
#endif
#ifdef PR_LOGGING
PRLogModuleInfo*
GetMediaManagerLog()
{
@@ -110,9 +109,6 @@ GetMediaManagerLog()
return sLog;
}
#define LOG(msg) PR_LOG(GetMediaManagerLog(), PR_LOG_DEBUG, msg)
#else
#define LOG(msg)
#endif
using dom::MediaStreamConstraints;
using dom::MediaTrackConstraintSet;
-4
View File
@@ -50,12 +50,8 @@ class NavigatorUserMediaErrorCallback;
struct MediaTrackConstraintSet;
} // namespace dom
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetMediaManagerLog();
#define MM_LOG(msg) PR_LOG(GetMediaManagerLog(), PR_LOG_DEBUG, msg)
#else
#define MM_LOG(msg)
#endif
/**
* This class is an implementation of MediaStreamListener. This is used
-8
View File
@@ -31,12 +31,8 @@
#undef LOG
#endif
#ifdef PR_LOGGING
PRLogModuleInfo* gMediaRecorderLog;
#define LOG(type, msg) PR_LOG(gMediaRecorderLog, type, msg)
#else
#define LOG(type, msg)
#endif
namespace mozilla {
@@ -752,11 +748,9 @@ MediaRecorder::MediaRecorder(DOMMediaStream& aSourceMediaStream,
MOZ_ASSERT(aOwnerWindow);
MOZ_ASSERT(aOwnerWindow->IsInnerWindow());
mDOMStream = &aSourceMediaStream;
#ifdef PR_LOGGING
if (!gMediaRecorderLog) {
gMediaRecorderLog = PR_NewLogModule("MediaRecorder");
}
#endif
RegisterActivityObserver();
}
@@ -785,11 +779,9 @@ MediaRecorder::MediaRecorder(AudioNode& aSrcAudioNode,
aSrcOutput);
}
mAudioNode = &aSrcAudioNode;
#ifdef PR_LOGGING
if (!gMediaRecorderLog) {
gMediaRecorderLog = PR_NewLogModule("MediaRecorder");
}
#endif
RegisterActivityObserver();
}
-7
View File
@@ -35,17 +35,12 @@
using mozilla::media::TimeUnit;
#ifdef PR_LOGGING
PRLogModuleInfo* gMediaResourceLog;
#define RESOURCE_LOG(msg, ...) PR_LOG(gMediaResourceLog, PR_LOG_DEBUG, \
(msg, ##__VA_ARGS__))
// Debug logging macro with object pointer and class name.
#define CMLOG(msg, ...) \
RESOURCE_LOG("%p [ChannelMediaResource]: " msg, this, ##__VA_ARGS__)
#else
#define RESOURCE_LOG(msg, ...)
#define CMLOG(msg, ...)
#endif
static const uint32_t HTTP_OK_CODE = 200;
static const uint32_t HTTP_PARTIAL_RESPONSE_CODE = 206;
@@ -81,11 +76,9 @@ ChannelMediaResource::ChannelMediaResource(MediaDecoder* aDecoder,
mIgnoreResume(false),
mIsTransportSeekable(true)
{
#ifdef PR_LOGGING
if (!gMediaResourceLog) {
gMediaResourceLog = PR_NewLogModule("MediaResource");
}
#endif
}
ChannelMediaResource::~ChannelMediaResource()
-4
View File
@@ -13,12 +13,8 @@
namespace mozilla {
#ifdef PR_LOGGING
extern PRLogModuleInfo* gMediaDecoderLog;
#define DECODER_LOG(type, msg) PR_LOG(gMediaDecoderLog, type, msg)
#else
#define DECODER_LOG(type, msg)
#endif
NS_IMPL_ISUPPORTS(MediaShutdownManager, nsIObserver)
-6
View File
@@ -41,12 +41,8 @@ using namespace mozilla::gfx;
namespace mozilla {
#ifdef PR_LOGGING
PRLogModuleInfo* gMediaStreamGraphLog;
#define STREAM_LOG(type, msg) PR_LOG(gMediaStreamGraphLog, type, msg)
#else
#define STREAM_LOG(type, msg)
#endif
// #define ENABLE_LIFECYCLE_LOG
@@ -2936,11 +2932,9 @@ MediaStreamGraphImpl::MediaStreamGraphImpl(bool aRealtime,
#endif
, mAudioChannel(static_cast<uint32_t>(aChannel))
{
#ifdef PR_LOGGING
if (!gMediaStreamGraphLog) {
gMediaStreamGraphLog = PR_NewLogModule("MediaStreamGraph");
}
#endif
if (mRealtime) {
if (aStartWithAudioDriver) {
-2
View File
@@ -35,9 +35,7 @@ class nsAutoRefTraits<SpeexResamplerState> : public nsPointerRefTraits<SpeexResa
namespace mozilla {
#ifdef PR_LOGGING
extern PRLogModuleInfo* gMediaStreamGraphLog;
#endif
/*
* MediaStreamGraph is a framework for synchronized audio/video processing
-7
View File
@@ -21,17 +21,12 @@
using namespace mozilla::net;
using namespace mozilla::media;
#ifdef PR_LOGGING
PRLogModuleInfo* gRtspMediaResourceLog;
#define RTSP_LOG(msg, ...) PR_LOG(gRtspMediaResourceLog, PR_LOG_DEBUG, \
(msg, ##__VA_ARGS__))
// Debug logging macro with object pointer and class name.
#define RTSPMLOG(msg, ...) \
RTSP_LOG("%p [RtspMediaResource]: " msg, this, ##__VA_ARGS__)
#else
#define RTSP_LOG(msg, ...)
#define RTSPMLOG(msg, ...)
#endif
namespace mozilla {
@@ -505,12 +500,10 @@ RtspMediaResource::RtspMediaResource(MediaDecoder* aDecoder,
MOZ_ASSERT(mMediaStreamController);
mListener = new Listener(this);
mMediaStreamController->AsyncOpen(mListener);
#ifdef PR_LOGGING
if (!gRtspMediaResourceLog) {
gRtspMediaResourceLog = PR_NewLogModule("RtspMediaResource");
}
#endif
#endif
}
RtspMediaResource::~RtspMediaResource()
-4
View File
@@ -9,12 +9,8 @@
namespace mozilla {
#ifdef PR_LOGGING
extern PRLogModuleInfo* gMediaStreamGraphLog;
#define STREAM_LOG(type, msg) PR_LOG(gMediaStreamGraphLog, type, msg)
#else
#define STREAM_LOG(type, msg)
#endif
#ifdef DEBUG
void
-6
View File
@@ -42,21 +42,15 @@ namespace mozilla {
#undef STREAM_LOG
#endif
#ifdef PR_LOGGING
PRLogModuleInfo* gTrackUnionStreamLog;
#define STREAM_LOG(type, msg) PR_LOG(gTrackUnionStreamLog, type, msg)
#else
#define STREAM_LOG(type, msg)
#endif
TrackUnionStream::TrackUnionStream(DOMMediaStream* aWrapper) :
ProcessedMediaStream(aWrapper)
{
#ifdef PR_LOGGING
if (!gTrackUnionStreamLog) {
gTrackUnionStreamLog = PR_NewLogModule("TrackUnionStream");
}
#endif
}
void TrackUnionStream::RemoveInput(MediaInputPort* aPort)
-6
View File
@@ -28,22 +28,16 @@ NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(WebVTTListener)
NS_IMPL_CYCLE_COLLECTING_RELEASE(WebVTTListener)
#ifdef PR_LOGGING
PRLogModuleInfo* gTextTrackLog;
# define VTT_LOG(...) PR_LOG(gTextTrackLog, PR_LOG_DEBUG, (__VA_ARGS__))
#else
# define VTT_LOG(msg)
#endif
WebVTTListener::WebVTTListener(HTMLTrackElement* aElement)
: mElement(aElement)
{
MOZ_ASSERT(mElement, "Must pass an element to the callback");
#ifdef PR_LOGGING
if (!gTextTrackLog) {
gTextTrackLog = PR_NewLogModule("TextTrack");
}
#endif
VTT_LOG("WebVTTListener created.");
}
-6
View File
@@ -23,16 +23,10 @@ using namespace mozilla::media;
namespace mozilla {
#ifdef PR_LOGGING
extern PRLogModuleInfo* gMediaDecoderLog;
#define LOGE(...) PR_LOG(gMediaDecoderLog, PR_LOG_ERROR, (__VA_ARGS__))
#define LOGW(...) PR_LOG(gMediaDecoderLog, PR_LOG_WARNING, (__VA_ARGS__))
#define LOGD(...) PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG, (__VA_ARGS__))
#else
#define LOGE(...)
#define LOGW(...)
#define LOGD(...)
#endif
#define PROPERTY_ID_FORMAT "%c%c%c%c"
#define PROPERTY_ID_PRINT(x) ((x) >> 24), \
-4
View File
@@ -23,12 +23,8 @@ using namespace mozilla::media;
namespace mozilla {
#ifdef PR_LOGGING
PRLogModuleInfo* GetDirectShowLog();
#define LOG(...) PR_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#else
#define LOG(...)
#endif
AudioSinkFilter::AudioSinkFilter(const wchar_t* aObjectName, HRESULT* aOutResult)
: BaseFilter(aObjectName, CLSID_MozAudioSinkFilter),
@@ -15,12 +15,8 @@ using namespace mozilla::media;
namespace mozilla {
#ifdef PR_LOGGING
PRLogModuleInfo* GetDirectShowLog();
#define LOG(...) PR_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#else
#define LOG(...)
#endif
AudioSinkInputPin::AudioSinkInputPin(wchar_t* aObjectName,
AudioSinkFilter* aFilter,
@@ -19,8 +19,6 @@ using namespace mozilla::media;
namespace mozilla {
#ifdef PR_LOGGING
PRLogModuleInfo*
GetDirectShowLog() {
static PRLogModuleInfo* log = nullptr;
@@ -32,10 +30,6 @@ GetDirectShowLog() {
#define LOG(...) PR_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#else
#define LOG(...)
#endif
DirectShowReader::DirectShowReader(AbstractMediaDecoder* aDecoder)
: MediaDecoderReader(aDecoder),
mMP3FrameParser(aDecoder->GetResource()->GetLength()),
-3
View File
@@ -16,8 +16,6 @@
namespace mozilla {
#if defined(PR_LOGGING)
// Create a table which maps GUIDs to a string representation of the GUID.
// This is useful for debugging purposes, for logging the GUIDs of media types.
// This is only available when logging is enabled, i.e. not in release builds.
@@ -48,7 +46,6 @@ GetDirectShowGuidName(const GUID& aGuid)
}
return "Unknown";
}
#endif // PR_LOGGING
void
RemoveGraphFromRunningObjectTable(DWORD aRotRegister)
-3
View File
@@ -112,11 +112,8 @@ RefTimeToSeconds(const REFERENCE_TIME aRefTime)
return double(aRefTime) / 10000000;
}
#if defined(PR_LOGGING)
const char*
GetDirectShowGuidName(const GUID& aGuid);
#endif
} // namespace mozilla
+14 -18
View File
@@ -14,12 +14,8 @@ using namespace mozilla::media;
namespace mozilla {
#ifdef PR_LOGGING
PRLogModuleInfo* GetDirectShowLog();
#define LOG(...) PR_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#else
#define LOG(...)
#endif
SampleSink::SampleSink()
: mMonitor("SampleSink"),
@@ -69,13 +65,13 @@ SampleSink::Receive(IMediaSample* aSample)
mon.Wait();
}
#ifdef PR_LOGGING
REFERENCE_TIME start = 0, end = 0;
HRESULT hr = aSample->GetMediaTime(&start, &end);
LOG("SampleSink::Receive() [%4.2lf-%4.2lf]",
(double)RefTimeToUsecs(start) / USECS_PER_S,
(double)RefTimeToUsecs(end) / USECS_PER_S);
#endif
if (PR_LOG_TEST(GetDirectShowLog(), PR_LOG_DEBUG)) {
REFERENCE_TIME start = 0, end = 0;
HRESULT hr = aSample->GetMediaTime(&start, &end);
LOG("SampleSink::Receive() [%4.2lf-%4.2lf]",
(double)RefTimeToUsecs(start) / USECS_PER_S,
(double)RefTimeToUsecs(end) / USECS_PER_S);
}
mSample = aSample;
// Notify the signal, to awaken the consumer thread in WaitForSample()
@@ -106,13 +102,13 @@ SampleSink::Extract(RefPtr<IMediaSample>& aOutSample)
}
aOutSample = mSample;
#ifdef PR_LOGGING
int64_t start = 0, end = 0;
mSample->GetMediaTime(&start, &end);
LOG("SampleSink::Extract() [%4.2lf-%4.2lf]",
(double)RefTimeToUsecs(start) / USECS_PER_S,
(double)RefTimeToUsecs(end) / USECS_PER_S);
#endif
if (PR_LOG_TEST(GetDirectShowLog(), PR_LOG_DEBUG)) {
int64_t start = 0, end = 0;
mSample->GetMediaTime(&start, &end);
LOG("SampleSink::Extract() [%4.2lf-%4.2lf]",
(double)RefTimeToUsecs(start) / USECS_PER_S,
(double)RefTimeToUsecs(end) / USECS_PER_S);
}
mSample = nullptr;
// Notify the signal, to awaken the producer thread in Receive()
+1 -1
View File
@@ -19,7 +19,7 @@ namespace mozilla {
// Define to trace what's on...
//#define DEBUG_SOURCE_TRACE 1
#if defined(PR_LOGGING) && defined (DEBUG_SOURCE_TRACE)
#if defined (DEBUG_SOURCE_TRACE)
PRLogModuleInfo* GetDirectShowLog();
#define DIRECTSHOW_LOG(...) PR_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#else
-6
View File
@@ -31,12 +31,8 @@
#undef LOG
#endif
#ifdef PR_LOGGING
PRLogModuleInfo* gMediaEncoderLog;
#define LOG(type, msg) PR_LOG(gMediaEncoderLog, type, msg)
#else
#define LOG(type, msg)
#endif
namespace mozilla {
@@ -81,11 +77,9 @@ MediaEncoder::CreateEncoder(const nsAString& aMIMEType, uint32_t aAudioBitrate,
uint32_t aVideoBitrate, uint32_t aBitrate,
uint8_t aTrackTypes)
{
#ifdef PR_LOGGING
if (!gMediaEncoderLog) {
gMediaEncoderLog = PR_NewLogModule("MediaEncoder");
}
#endif
PROFILER_LABEL("MediaEncoder", "CreateEncoder",
js::ProfileEntry::Category::OTHER);
-12
View File
@@ -18,12 +18,8 @@
namespace mozilla {
#ifdef PR_LOGGING
PRLogModuleInfo* gTrackEncoderLog;
#define TRACK_LOG(type, msg) PR_LOG(gTrackEncoderLog, type, msg)
#else
#define TRACK_LOG(type, msg)
#endif
static const int DEFAULT_CHANNELS = 1;
static const int DEFAULT_SAMPLING_RATE = 16000;
@@ -38,16 +34,12 @@ TrackEncoder::TrackEncoder()
, mInitialized(false)
, mEndOfStream(false)
, mCanceled(false)
#ifdef PR_LOGGING
, mAudioInitCounter(0)
, mVideoInitCounter(0)
#endif
{
#ifdef PR_LOGGING
if (!gTrackEncoderLog) {
gTrackEncoderLog = PR_NewLogModule("TrackEncoder");
}
#endif
}
void
@@ -65,10 +57,8 @@ AudioTrackEncoder::NotifyQueuedTrackChanges(MediaStreamGraph* aGraph,
// Check and initialize parameters for codec encoder.
if (!mInitialized) {
#ifdef PR_LOGGING
mAudioInitCounter++;
TRACK_LOG(PR_LOG_DEBUG, ("Init the audio encoder %d times", mAudioInitCounter));
#endif
AudioSegment::ChunkIterator iter(const_cast<AudioSegment&>(audio));
while (!iter.IsEnded()) {
AudioChunk chunk = *iter;
@@ -193,10 +183,8 @@ VideoTrackEncoder::NotifyQueuedTrackChanges(MediaStreamGraph* aGraph,
// Check and initialize parameters for codec encoder.
if (!mInitialized) {
#ifdef PR_LOGGING
mVideoInitCounter++;
TRACK_LOG(PR_LOG_DEBUG, ("Init the video encoder %d times", mVideoInitCounter));
#endif
VideoSegment::ChunkIterator iter(const_cast<VideoSegment&>(video));
while (!iter.IsEnded()) {
VideoChunk chunk = *iter;
-2
View File
@@ -131,11 +131,9 @@ protected:
*/
bool mCanceled;
#ifdef PR_LOGGING
// How many times we have tried to initialize the encoder.
uint32_t mAudioInitCounter;
uint32_t mVideoInitCounter;
#endif
};
class AudioTrackEncoder : public TrackEncoder
-6
View File
@@ -15,14 +15,10 @@
namespace mozilla {
#ifdef PR_LOGGING
PRLogModuleInfo* gVP8TrackEncoderLog;
#define VP8LOG(msg, ...) PR_LOG(gVP8TrackEncoderLog, PR_LOG_DEBUG, \
(msg, ##__VA_ARGS__))
// Debug logging macro with object pointer and class name.
#else
#define VP8LOG(msg, ...)
#endif
#define DEFAULT_BITRATE_BPS 2500000
#define DEFAULT_ENCODE_FRAMERATE 30
@@ -38,11 +34,9 @@ VP8TrackEncoder::VP8TrackEncoder()
, mVPXImageWrapper(new vpx_image_t())
{
MOZ_COUNT_CTOR(VP8TrackEncoder);
#ifdef PR_LOGGING
if (!gVP8TrackEncoderLog) {
gVP8TrackEncoderLog = PR_NewLogModule("VP8TrackEncoder");
}
#endif
}
VP8TrackEncoder::~VP8TrackEncoder()
-6
View File
@@ -17,23 +17,17 @@ static const float BASE_QUALITY = 0.4f;
namespace mozilla {
#undef LOG
#ifdef PR_LOGGING
PRLogModuleInfo* gVorbisTrackEncoderLog;
#define VORBISLOG(msg, ...) PR_LOG(gVorbisTrackEncoderLog, PR_LOG_DEBUG, \
(msg, ##__VA_ARGS__))
#else
#define VORBISLOG(msg, ...)
#endif
VorbisTrackEncoder::VorbisTrackEncoder()
: AudioTrackEncoder()
{
MOZ_COUNT_CTOR(VorbisTrackEncoder);
#ifdef PR_LOGGING
if (!gVorbisTrackEncoderLog) {
gVorbisTrackEncoderLog = PR_NewLogModule("VorbisTrackEncoder");
}
#endif
}
VorbisTrackEncoder::~VorbisTrackEncoder()
-7
View File
@@ -28,7 +28,6 @@ using mozilla::layers::LayerManager;
using mozilla::layers::LayersBackend;
using mozilla::media::TimeUnit;
#ifdef PR_LOGGING
PRLogModuleInfo* GetDemuxerLog() {
static PRLogModuleInfo* log = nullptr;
if (!log) {
@@ -38,10 +37,6 @@ PRLogModuleInfo* GetDemuxerLog() {
}
#define LOG(arg, ...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, ("MP4Reader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define VLOG(arg, ...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, ("MP4Reader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#else
#define LOG(...)
#define VLOG(...)
#endif
using namespace mp4_demuxer;
@@ -50,7 +45,6 @@ namespace mozilla {
// Uncomment to enable verbose per-sample logging.
//#define LOG_SAMPLE_DECODE 1
#ifdef PR_LOGGING
static const char*
TrackTypeToStr(TrackInfo::TrackType aTrack)
{
@@ -65,7 +59,6 @@ TrackTypeToStr(TrackInfo::TrackType aTrack)
return "Unknown";
}
}
#endif
// MP4Demuxer wants to do various blocking reads, which cause deadlocks while
// mDemuxerMonitor is held. This stuff should really be redesigned, but we don't
-5
View File
@@ -17,15 +17,10 @@ namespace mozilla {
#undef LOG
#endif
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetGMPLog();
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
#else
#define LOGD(msg)
#define LOG(level, msg)
#endif
namespace gmp {
-5
View File
@@ -42,14 +42,9 @@ namespace mozilla {
#undef LOG
#undef LOGD
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetGMPLog();
#define LOG(level, x, ...) PR_LOG(GetGMPLog(), (level), (x, ##__VA_ARGS__))
#define LOGD(x, ...) LOG(PR_LOG_DEBUG, "GMPChild[pid=%d] " x, (int)base::GetCurrentProcId(), ##__VA_ARGS__)
#else
#define LOG(level, x, ...)
#define LOGD(x, ...)
#endif
namespace gmp {
-5
View File
@@ -19,15 +19,10 @@ namespace mozilla {
#undef LOG
#endif
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetGMPLog();
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
#else
#define LOGD(msg)
#define LOG(level, msg)
#endif
#ifdef __CLASS__
#undef __CLASS__
-11
View File
@@ -30,14 +30,9 @@ namespace mozilla {
#undef LOG
#undef LOGD
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetGMPLog();
#define LOG(level, x, ...) PR_LOG(GetGMPLog(), (level), (x, ##__VA_ARGS__))
#define LOGD(x, ...) LOG(PR_LOG_DEBUG, "GMPParent[%p|childPid=%d] " x, this, mChildPid, ##__VA_ARGS__)
#else
#define LOG(level, x, ...)
#define LOGD(x, ...)
#endif
namespace gmp {
@@ -51,9 +46,7 @@ GMPParent::GMPParent()
, mGMPContentChildCount(0)
, mAsyncShutdownRequired(false)
, mAsyncShutdownInProgress(false)
#ifdef PR_LOGGING
, mChildPid(0)
#endif
{
LOGD("GMPParent ctor");
// Use the parent address to identify it.
@@ -63,8 +56,6 @@ GMPParent::GMPParent()
GMPParent::~GMPParent()
{
// Can't Close or Destroy the process here, since destruction is MainThread only
MOZ_ASSERT(NS_IsMainThread());
LOGD("GMPParent dtor");
}
@@ -135,9 +126,7 @@ GMPParent::LoadProcess()
return NS_ERROR_FAILURE;
}
#ifdef PR_LOGGING
mChildPid = base::GetProcId(mProcess->GetChildProcessHandle());
#endif
bool opened = Open(mProcess->GetChannel(),
base::GetProcId(mProcess->GetChildProcessHandle()));
+1 -4
View File
@@ -21,7 +21,6 @@
#include "nsString.h"
#include "nsTArray.h"
#include "nsIFile.h"
#include "ThreadSafeRefcountingWithMainThreadDestruction.h"
class nsILineInputStream;
class nsIThread;
@@ -62,7 +61,7 @@ public:
class GMPParent final : public PGMPParent
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_MAIN_THREAD_DESTRUCTION(GMPParent)
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GMPParent)
GMPParent();
@@ -200,9 +199,7 @@ private:
bool mAsyncShutdownRequired;
bool mAsyncShutdownInProgress;
#ifdef PR_LOGGING
int mChildPid;
#endif
};
} // namespace gmp
-5
View File
@@ -41,7 +41,6 @@ namespace mozilla {
#undef LOG
#endif
#ifdef PR_LOGGING
PRLogModuleInfo*
GetGMPLog()
{
@@ -53,10 +52,6 @@ GetGMPLog()
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
#else
#define LOGD(msg)
#define LOG(leve1, msg)
#endif
#ifdef __CLASS__
#undef __CLASS__
-5
View File
@@ -12,13 +12,8 @@ namespace mozilla {
#undef LOG
#endif
#ifdef PR_LOGGING
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
#else
#define LOGD(msg)
#define LOG(leve1, msg)
#endif
#ifdef __CLASS__
#undef __CLASS__
+23 -50
View File
@@ -40,13 +40,8 @@ namespace mozilla {
#undef LOG
#endif
#ifdef PR_LOGGING
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
#else
#define LOGD(msg)
#define LOG(leve1, msg)
#endif
#ifdef __CLASS__
#undef __CLASS__
@@ -78,7 +73,8 @@ NS_IMPL_ISUPPORTS_INHERITED(GeckoMediaPluginServiceParent,
mozIGeckoMediaPluginChromeService)
static int32_t sMaxAsyncShutdownWaitMs = 0;
static bool sHaveSetTimeoutPrefCache = false;
static bool sAllowInsecureGMP = false;
static bool sHaveSetGMPServiceParentPrefCaches = false;
GeckoMediaPluginServiceParent::GeckoMediaPluginServiceParent()
: mShuttingDown(false)
@@ -86,11 +82,13 @@ GeckoMediaPluginServiceParent::GeckoMediaPluginServiceParent()
, mWaitingForPluginsAsyncShutdown(false)
{
MOZ_ASSERT(NS_IsMainThread());
if (!sHaveSetTimeoutPrefCache) {
sHaveSetTimeoutPrefCache = true;
if (!sHaveSetGMPServiceParentPrefCaches) {
sHaveSetGMPServiceParentPrefCaches = true;
Preferences::AddIntVarCache(&sMaxAsyncShutdownWaitMs,
"media.gmp.async-shutdown-timeout",
GMP_DEFAULT_ASYNC_SHUTDONW_TIMEOUT);
Preferences::AddBoolVarCache(&sAllowInsecureGMP,
"media.gmp.insecure.allow", false);
}
}
@@ -103,7 +101,7 @@ GeckoMediaPluginServiceParent::~GeckoMediaPluginServiceParent()
int32_t
GeckoMediaPluginServiceParent::AsyncShutdownTimeoutMs()
{
MOZ_ASSERT(sHaveSetTimeoutPrefCache);
MOZ_ASSERT(sHaveSetGMPServiceParentPrefCaches);
return sMaxAsyncShutdownWaitMs;
}
@@ -305,10 +303,8 @@ GeckoMediaPluginServiceParent::GetContentParentFrom(const nsACString& aNodeId,
{
nsRefPtr<GMPParent> gmp = SelectPluginForAPI(aNodeId, aAPI, aTags);
#ifdef PR_LOGGING
nsCString api = aTags[0];
LOGD(("%s: %p returning %p for api %s", __FUNCTION__, (void *)this, (void *)gmp, api.get()));
#endif
if (!gmp) {
return false;
@@ -601,45 +597,30 @@ GeckoMediaPluginServiceParent::SelectPluginForAPI(const nsACString& aNodeId,
return nullptr;
}
class CreateGMPParentTask : public nsRunnable {
public:
NS_IMETHOD Run() {
MOZ_ASSERT(NS_IsMainThread());
RefPtr<GMPParent>
CreateGMPParent()
{
#if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
if (!SandboxInfo::Get().CanSandboxMedia()) {
if (!Preferences::GetBool("media.gmp.insecure.allow")) {
NS_WARNING("Denying media plugin load due to lack of sandboxing.");
return NS_ERROR_NOT_AVAILABLE;
}
NS_WARNING("Loading media plugin despite lack of sandboxing.");
if (!SandboxInfo::Get().CanSandboxMedia()) {
if (!sAllowInsecureGMP) {
NS_WARNING("Denying media plugin load due to lack of sandboxing.");
return nullptr;
}
NS_WARNING("Loading media plugin despite lack of sandboxing.");
}
#endif
mParent = new GMPParent();
return NS_OK;
}
already_AddRefed<GMPParent> GetParent() {
return mParent.forget();
}
private:
nsRefPtr<GMPParent> mParent;
};
return new GMPParent();
}
GMPParent*
GeckoMediaPluginServiceParent::ClonePlugin(const GMPParent* aOriginal)
{
MOZ_ASSERT(aOriginal);
// The GMPParent inherits from IToplevelProtocol, which must be created
// on the main thread to be threadsafe. See Bug 1035653.
nsRefPtr<CreateGMPParentTask> task(new CreateGMPParentTask());
if (!NS_IsMainThread()) {
nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
MOZ_ASSERT(mainThread);
mozilla::SyncRunnable::DispatchToThread(mainThread, task);
}
nsRefPtr<GMPParent> gmp = task->GetParent();
nsresult rv = gmp->CloneFrom(aOriginal);
RefPtr<GMPParent> gmp = CreateGMPParent();
nsresult rv = gmp ? gmp->CloneFrom(aOriginal) : NS_ERROR_NOT_AVAILABLE;
if (NS_FAILED(rv)) {
NS_WARNING("Can't Create GMPParent");
@@ -683,13 +664,7 @@ GeckoMediaPluginServiceParent::AddOnGMPThread(const nsAString& aDirectory)
return;
}
// The GMPParent inherits from IToplevelProtocol, which must be created
// on the main thread to be threadsafe. See Bug 1035653.
nsRefPtr<CreateGMPParentTask> task(new CreateGMPParentTask());
nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
MOZ_ASSERT(mainThread);
mozilla::SyncRunnable::DispatchToThread(mainThread, task);
nsRefPtr<GMPParent> gmp = task->GetParent();
RefPtr<GMPParent> gmp = CreateGMPParent();
rv = gmp ? gmp->Init(this, directory) : NS_ERROR_NOT_AVAILABLE;
if (NS_FAILED(rv)) {
NS_WARNING("Can't Create GMPParent");
@@ -1365,10 +1340,8 @@ GMPServiceParent::RecvLoadGMP(const nsCString& aNodeId,
{
nsRefPtr<GMPParent> gmp = mService->SelectPluginForAPI(aNodeId, aAPI, aTags);
#ifdef PR_LOGGING
nsCString api = aTags[0];
LOGD(("%s: %p returning %p for api %s", __FUNCTION__, (void *)this, (void *)gmp, api.get()));
#endif
if (!gmp || !gmp->EnsureProcessLoaded(aId)) {
return false;
-5
View File
@@ -26,15 +26,10 @@ namespace mozilla {
#undef LOG
#endif
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetGMPLog();
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
#else
#define LOGD(msg)
#define LOG(level, msg)
#endif
#ifdef __CLASS__
#undef __CLASS__
-5
View File
@@ -13,15 +13,10 @@ namespace mozilla {
#undef LOG
#endif
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetGMPLog();
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
#else
#define LOGD(msg)
#define LOG(level, msg)
#endif
#ifdef __CLASS__
#undef __CLASS__
-5
View File
@@ -21,15 +21,10 @@ namespace mozilla {
#undef LOG
#endif
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetGMPLog();
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
#else
#define LOGD(msg)
#define LOG(level, msg)
#endif
namespace gmp {
-5
View File
@@ -23,15 +23,10 @@ namespace mozilla {
#undef LOG
#endif
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetGMPLog();
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
#else
#define LOGD(msg)
#define LOG(level, msg)
#endif
#ifdef __CLASS__
#undef __CLASS__
-4
View File
@@ -18,8 +18,6 @@
namespace mozilla {
#ifdef PR_LOGGING
PRLogModuleInfo* GetICLog()
{
static PRLogModuleInfo* log = nullptr;
@@ -29,8 +27,6 @@ PRLogModuleInfo* GetICLog()
return log;
}
#endif
namespace dom {
NS_IMPL_CYCLE_COLLECTION_INHERITED(ImageCapture, DOMEventTargetHelper,
-10
View File
@@ -15,21 +15,11 @@ class nsIDOMBlob;
namespace mozilla {
#ifdef PR_LOGGING
#ifndef IC_LOG
PRLogModuleInfo* GetICLog();
#define IC_LOG(...) PR_LOG(GetICLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#endif
#else
#ifndef IC_LOG
#define IC_LOG(...)
#endif
#endif // PR_LOGGING
namespace dom {
class File;
@@ -18,7 +18,6 @@
#endif
#include "SourceBufferResource.h"
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetMediaSourceLog();
/* Polyfill __func__ on MSVC to pass to the log. */
@@ -30,10 +29,6 @@ extern PRLogModuleInfo* GetMediaSourceLog();
#define TOSTRING(x) STRINGIFY(x)
#define MSE_DEBUG(name, arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, (TOSTRING(name) "(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
#define MSE_DEBUGV(name, arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG + 1, (TOSTRING(name) "(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
#else
#define MSE_DEBUG(...)
#define MSE_DEBUGV(...)
#endif
namespace mozilla {
-5
View File
@@ -31,7 +31,6 @@
struct JSContext;
class JSObject;
#ifdef PR_LOGGING
PRLogModuleInfo* GetMediaSourceLog()
{
static PRLogModuleInfo* sLogModule;
@@ -52,10 +51,6 @@ PRLogModuleInfo* GetMediaSourceAPILog()
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSource(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define MSE_API(arg, ...) PR_LOG(GetMediaSourceAPILog(), PR_LOG_DEBUG, ("MediaSource(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#else
#define MSE_DEBUG(...)
#define MSE_API(...)
#endif
// Arbitrary limit.
static const unsigned int MAX_SOURCE_BUFFERS = 16;
@@ -18,15 +18,10 @@
#include "MediaSourceDemuxer.h"
#include <algorithm>
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetMediaSourceLog();
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSourceDecoder(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define MSE_DEBUGV(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG + 1, ("MediaSourceDecoder(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#else
#define MSE_DEBUG(...)
#define MSE_DEBUGV(...)
#endif
using namespace mozilla::media;
@@ -27,15 +27,10 @@
#include "WebMReader.h"
#endif
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetMediaSourceLog();
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSourceReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define MSE_DEBUGV(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG + 1, ("MediaSourceReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#else
#define MSE_DEBUG(...)
#define MSE_DEBUGV(...)
#endif
// 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
@@ -11,13 +11,9 @@
#include "mozilla/Monitor.h"
#include "prlog.h"
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetMediaSourceLog();
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSourceResource(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
#else
#define MSE_DEBUG(...)
#endif
#define UNIMPLEMENTED() MSE_DEBUG("UNIMPLEMENTED FUNCTION at %s:%d", __FILE__, __LINE__)
-5
View File
@@ -8,7 +8,6 @@
#include "MediaData.h"
#include "prlog.h"
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetSourceBufferResourceLog();
/* Polyfill __func__ on MSVC to pass to the log. */
@@ -18,10 +17,6 @@ extern PRLogModuleInfo* GetSourceBufferResourceLog();
#define SBR_DEBUG(arg, ...) PR_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG, ("ResourceQueue(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define SBR_DEBUGV(arg, ...) PR_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG+1, ("ResourceQueue(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#else
#define SBR_DEBUG(...)
#define SBR_DEBUGV(...)
#endif
namespace mozilla {
-6
View File
@@ -26,18 +26,12 @@
struct JSContext;
class JSObject;
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetMediaSourceLog();
extern PRLogModuleInfo* GetMediaSourceAPILog();
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
#define MSE_DEBUGV(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG + 1, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
#define MSE_API(arg, ...) PR_LOG(GetMediaSourceAPILog(), PR_LOG_DEBUG, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
#else
#define MSE_DEBUG(...)
#define MSE_DEBUGV(...)
#define MSE_API(...)
#endif
namespace mozilla {
@@ -10,7 +10,6 @@
#include "AbstractMediaDecoder.h"
#include "MediaDecoderReader.h"
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetMediaSourceLog();
/* Polyfill __func__ on MSVC to pass to the log. */
#ifdef _MSC_VER
@@ -18,9 +17,6 @@ extern PRLogModuleInfo* GetMediaSourceLog();
#endif
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("SourceBufferDecoder(%p:%s)::%s: " arg, this, mResource->GetContentType().get(), __func__, ##__VA_ARGS__))
#else
#define MSE_DEBUG(...)
#endif
namespace mozilla {
@@ -16,16 +16,11 @@
#include "nsThreadUtils.h"
#include "prlog.h"
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetMediaSourceLog();
extern PRLogModuleInfo* GetMediaSourceAPILog();
#define MSE_API(arg, ...) PR_LOG(GetMediaSourceAPILog(), PR_LOG_DEBUG, ("SourceBufferList(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("SourceBufferList(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
#else
#define MSE_API(...)
#define MSE_DEBUG(...)
#endif
struct JSContext;
class JSObject;
@@ -13,7 +13,6 @@
#include "prlog.h"
#include "MediaData.h"
#ifdef PR_LOGGING
PRLogModuleInfo* GetSourceBufferResourceLog()
{
static PRLogModuleInfo* sLogModule;
@@ -25,10 +24,6 @@ PRLogModuleInfo* GetSourceBufferResourceLog()
#define SBR_DEBUG(arg, ...) PR_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG, ("SourceBufferResource(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
#define SBR_DEBUGV(arg, ...) PR_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG + 1, ("SourceBufferResource(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
#else
#define SBR_DEBUG(...)
#define SBR_DEBUGV(...)
#endif
namespace mozilla {
-4
View File
@@ -22,13 +22,9 @@
#include "nsThreadUtils.h"
#include "prlog.h"
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetMediaSourceLog();
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("TrackBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
#else
#define MSE_DEBUG(...)
#endif
// Time in seconds to substract from the current time when deciding the
// time point to evict data before in a decoder. This is used to help
-4
View File
@@ -32,12 +32,8 @@
namespace mozilla {
#ifdef PR_LOGGING
extern PRLogModuleInfo* gMediaDecoderLog;
#define LOG(type, msg) PR_LOG(gMediaDecoderLog, type, msg)
#else
#define LOG(type, msg)
#endif
/** Decoder base class for Ogg-encapsulated streams. */
OggCodecState*
-5
View File
@@ -37,7 +37,6 @@ namespace mozilla {
// Un-comment to enable logging of seek bisections.
//#define SEEK_LOGGING
#ifdef PR_LOGGING
extern PRLogModuleInfo* gMediaDecoderLog;
#define LOG(type, msg) PR_LOG(gMediaDecoderLog, type, msg)
#ifdef SEEK_LOGGING
@@ -45,10 +44,6 @@ extern PRLogModuleInfo* gMediaDecoderLog;
#else
#define SEEK_LOG(type, msg)
#endif
#else
#define LOG(type, msg)
#define SEEK_LOG(type, msg)
#endif
// The number of microseconds of "fuzz" we use in a bisection search over
// HTTP. When we're seeking with fuzz, we'll stop the search if a bisection
-4
View File
@@ -24,12 +24,8 @@ extern "C" {
namespace mozilla {
#ifdef PR_LOGGING
extern PRLogModuleInfo* gMediaDecoderLog;
#define OPUS_LOG(type, msg) PR_LOG(gMediaDecoderLog, type, msg)
#else
#define OPUS_LOG(type, msg)
#endif
OpusParser::OpusParser():
mRate(0),
-6
View File
@@ -42,13 +42,9 @@ using namespace android;
namespace mozilla {
#ifdef PR_LOGGING
PRLogModuleInfo* gAudioOffloadPlayerLog;
#define AUDIO_OFFLOAD_LOG(type, msg) \
PR_LOG(gAudioOffloadPlayerLog, type, msg)
#else
#define AUDIO_OFFLOAD_LOG(type, msg)
#endif
// maximum time in paused state when offloading audio decompression.
// When elapsed, the GonkAudioSink is destroyed to allow the audio DSP to power down.
@@ -67,11 +63,9 @@ AudioOffloadPlayer::AudioOffloadPlayer(MediaOmxCommonDecoder* aObserver) :
{
MOZ_ASSERT(NS_IsMainThread());
#ifdef PR_LOGGING
if (!gAudioOffloadPlayerLog) {
gAudioOffloadPlayerLog = PR_NewLogModule("AudioOffloadPlayer");
}
#endif
CHECK(aObserver);
#if ANDROID_VERSION >= 21
+2 -6
View File
@@ -20,15 +20,13 @@
#include <stagefright/foundation/ADebug.h>
#include "AudioOutput.h"
#include "prlog.h"
namespace mozilla {
#ifdef PR_LOGGING
extern PRLogModuleInfo* gAudioOffloadPlayerLog;
#define AUDIO_OFFLOAD_LOG(type, msg) \
PR_LOG(gAudioOffloadPlayerLog, type, msg)
#else
#define AUDIO_OFFLOAD_LOG(type, msg)
#endif
using namespace android;
@@ -39,11 +37,9 @@ AudioOutput::AudioOutput(int aSessionId, int aUid) :
mUid(aUid),
mSessionId(aSessionId)
{
#ifdef PR_LOGGING
if (!gAudioOffloadPlayerLog) {
gAudioOffloadPlayerLog = PR_NewLogModule("AudioOffloadPlayer");
}
#endif
}
AudioOutput::~AudioOutput()
@@ -10,12 +10,8 @@
#include "prlog.h"
#ifdef PR_LOGGING
PRLogModuleInfo *gI420ColorConverterHelperLog;
#define LOG(msg...) PR_LOG(gI420ColorConverterHelperLog, PR_LOG_WARNING, (msg))
#else
#define LOG(x...)
#endif
namespace android {
@@ -23,11 +19,9 @@ I420ColorConverterHelper::I420ColorConverterHelper()
: mHandle(nullptr)
, mConverter({nullptr, nullptr, nullptr, nullptr, nullptr})
{
#ifdef PR_LOGGING
if (!gI420ColorConverterHelperLog) {
gI420ColorConverterHelperLog = PR_NewLogModule("I420ColorConverterHelper");
}
#endif
}
I420ColorConverterHelper::~I420ColorConverterHelper()
-6
View File
@@ -20,12 +20,8 @@ using namespace android;
namespace mozilla {
#ifdef PR_LOGGING
extern PRLogModuleInfo* gMediaDecoderLog;
#define DECODER_LOG(type, msg) PR_LOG(gMediaDecoderLog, type, msg)
#else
#define DECODER_LOG(type, msg)
#endif
MediaOmxCommonDecoder::MediaOmxCommonDecoder()
: MediaDecoder()
@@ -33,11 +29,9 @@ MediaOmxCommonDecoder::MediaOmxCommonDecoder()
, mCanOffloadAudio(false)
, mFallbackToStateMachine(false)
{
#ifdef PR_LOGGING
if (!gMediaDecoderLog) {
gMediaDecoderLog = PR_NewLogModule("MediaDecoder");
}
#endif
}
MediaOmxCommonDecoder::~MediaOmxCommonDecoder() {}
-6
View File
@@ -22,21 +22,15 @@ using namespace android;
namespace mozilla {
#ifdef PR_LOGGING
extern PRLogModuleInfo* gMediaDecoderLog;
#define DECODER_LOG(type, msg) PR_LOG(gMediaDecoderLog, type, msg)
#else
#define DECODER_LOG(type, msg)
#endif
MediaOmxCommonReader::MediaOmxCommonReader(AbstractMediaDecoder *aDecoder)
: MediaDecoderReader(aDecoder)
{
#ifdef PR_LOGGING
if (!gMediaDecoderLog) {
gMediaDecoderLog = PR_NewLogModule("MediaDecoder");
}
#endif
mAudioChannel = dom::AudioChannelService::GetDefaultAudioChannel();
}
-6
View File
@@ -28,12 +28,8 @@ using namespace android;
namespace mozilla {
#ifdef PR_LOGGING
extern PRLogModuleInfo* gMediaDecoderLog;
#define DECODER_LOG(type, msg) PR_LOG(gMediaDecoderLog, type, msg)
#else
#define DECODER_LOG(type, msg)
#endif
class OmxReaderProcessCachedDataTask : public Task
{
@@ -149,11 +145,9 @@ MediaOmxReader::MediaOmxReader(AbstractMediaDecoder *aDecoder)
, mMP3FrameParser(-1)
, mIsWaitingResources(false)
{
#ifdef PR_LOGGING
if (!gMediaDecoderLog) {
gMediaDecoderLog = PR_NewLogModule("MediaDecoder");
}
#endif
mAudioChannel = dom::AudioChannelService::GetDefaultAudioChannel();
}
-6
View File
@@ -37,12 +37,8 @@
#define OD_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "OmxDecoder", __VA_ARGS__)
#undef LOG
#ifdef PR_LOGGING
PRLogModuleInfo *gOmxDecoderLog;
#define LOG(type, msg...) PR_LOG(gOmxDecoderLog, type, (msg))
#else
#define LOG(x...)
#endif
using namespace MPAPI;
using namespace mozilla;
@@ -113,11 +109,9 @@ static sp<IOMX> GetOMX()
}
bool OmxDecoder::Init(sp<MediaExtractor>& extractor) {
#ifdef PR_LOGGING
if (!gOmxDecoderLog) {
gOmxDecoderLog = PR_NewLogModule("OmxDecoder");
}
#endif
sp<MetaData> meta = extractor->getMetaData();
@@ -12,12 +12,8 @@
#include "AppleATDecoder.h"
#include "prlog.h"
#ifdef PR_LOGGING
PRLogModuleInfo* GetAppleMediaLog();
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#else
#define LOG(...)
#endif
#define FourCC2Str(n) ((char[5]){(char)(n >> 24), (char)(n >> 16), (char)(n >> 8), (char)(n), 0})
namespace mozilla {
@@ -12,12 +12,8 @@
#include "nsCocoaFeatures.h"
#include "nsDebug.h"
#ifdef PR_LOGGING
PRLogModuleInfo* GetAppleMediaLog();
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#else
#define LOG(...)
#endif
namespace mozilla {
@@ -15,7 +15,6 @@
#include "mozilla/DebugOnly.h"
#include "prlog.h"
#ifdef PR_LOGGING
PRLogModuleInfo* GetAppleMediaLog() {
static PRLogModuleInfo* log = nullptr;
if (!log) {
@@ -23,7 +22,6 @@ PRLogModuleInfo* GetAppleMediaLog() {
}
return log;
}
#endif
namespace mozilla {
@@ -22,13 +22,9 @@
#include "VideoUtils.h"
#include <algorithm>
#ifdef PR_LOGGING
PRLogModuleInfo* GetAppleMediaLog();
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
//#define LOG_MEDIA_SHA1
#else
#define LOG(...)
#endif
namespace mozilla {
@@ -10,12 +10,8 @@
#include "MainThreadUtils.h"
#include "nsDebug.h"
#ifdef PR_LOGGING
PRLogModuleInfo* GetAppleMediaLog();
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#else
#define LOG(...)
#endif
namespace mozilla {
@@ -19,13 +19,9 @@
#include "prlog.h"
#include "VideoUtils.h"
#ifdef PR_LOGGING
PRLogModuleInfo* GetAppleMediaLog();
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
//#define LOG_MEDIA_SHA1
#else
#define LOG(...)
#endif
#ifdef LOG_MEDIA_SHA1
#include "mozilla/SHA1.h"
@@ -11,12 +11,8 @@
#include "mozilla/ArrayUtils.h"
#include "nsDebug.h"
#ifdef PR_LOGGING
PRLogModuleInfo* GetAppleMediaLog();
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#else
#define LOG(...)
#endif
namespace mozilla {
-4
View File
@@ -7,11 +7,7 @@
#ifndef __FFmpegLog_h__
#define __FFmpegLog_h__
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetFFmpegDecoderLog();
#define FFMPEG_LOG(...) PR_LOG(GetFFmpegDecoderLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#else
#define FFMPEG_LOG(...)
#endif
#endif // __FFmpegLog_h__
@@ -25,12 +25,8 @@
#include <android/log.h>
#define GADM_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "GonkAudioDecoderManager", __VA_ARGS__)
#ifdef PR_LOGGING
PRLogModuleInfo* GetDemuxerLog();
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#else
#define LOG(...)
#endif
#define READ_OUTPUT_BUFFER_TIMEOUT_US 3000
using namespace android;
@@ -13,12 +13,8 @@
#include <android/log.h>
#define GMDD_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "GonkMediaDataDecoder", __VA_ARGS__)
#ifdef PR_LOGGING
PRLogModuleInfo* GetDemuxerLog();
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#else
#define LOG(...)
#endif
using namespace android;
@@ -31,12 +31,8 @@
#include <android/log.h>
#define GVDM_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "GonkVideoDecoderManager", __VA_ARGS__)
#ifdef PR_LOGGING
PRLogModuleInfo* GetDemuxerLog();
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#else
#define LOG(...)
#endif
using namespace mozilla::layers;
using namespace android;
typedef android::MediaCodecProxy MediaCodecProxy;
-5
View File
@@ -9,13 +9,8 @@
#include "WMFUtils.h"
#include "prlog.h"
#ifdef PR_LOGGING
PRLogModuleInfo* GetDemuxerLog();
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
#else
#define LOG(...)
#endif
namespace mozilla {

Some files were not shown because too many files have changed in this diff Show More