Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
Bug 767388 - Kill NS_DEBUG. r=bz.
Browse files Browse the repository at this point in the history
--HG--
extra : rebase_source : d045208a26345712dbb4628c973c616cd9504f28
  • Loading branch information
jwatt committed Jun 25, 2012
1 parent af739d8 commit 7004c16
Show file tree
Hide file tree
Showing 119 changed files with 245 additions and 246 deletions.
2 changes: 1 addition & 1 deletion accessible/src/generic/Accessible.cpp
Expand Up @@ -67,7 +67,7 @@
#include "nsNetUtil.h"
#include "nsEventStates.h"

#ifdef NS_DEBUG
#ifdef DEBUG
#include "nsIDOMCharacterData.h"
#endif

Expand Down
6 changes: 3 additions & 3 deletions content/base/src/nsContentSink.cpp
Expand Up @@ -120,7 +120,7 @@ nsContentSink::nsContentSink()
NS_ASSERTION(mInNotification == 0, "What?");
NS_ASSERTION(!mDeferredLayoutStart, "What?");

#ifdef NS_DEBUG
#ifdef DEBUG
if (!gContentSinkLogModuleInfo) {
gContentSinkLogModuleInfo = PR_NewLogModule("nscontentsink");
}
Expand Down Expand Up @@ -925,7 +925,7 @@ nsContentSink::SelectDocAppCache(nsIApplicationCache *aLoadApplicationCache,
// The http manifest attribute URI is equal to the manifest URI of
// the cache the document was loaded from - associate the document with
// that cache and invoke the cache update process.
#ifdef NS_DEBUG
#ifdef DEBUG
nsCAutoString docURISpec, clientID;
mDocumentURI->GetAsciiSpec(docURISpec);
aLoadApplicationCache->GetClientID(clientID);
Expand Down Expand Up @@ -979,7 +979,7 @@ nsContentSink::SelectDocAppCacheNoManifest(nsIApplicationCache *aLoadApplication
NS_ASSERTION(applicationCacheDocument,
"mDocument must implement nsIApplicationCacheContainer.");

#ifdef NS_DEBUG
#ifdef DEBUG
nsCAutoString docURISpec, clientID;
mDocumentURI->GetAsciiSpec(docURISpec);
aLoadApplicationCache->GetClientID(clientID);
Expand Down
2 changes: 1 addition & 1 deletion content/base/src/nsContentSink.h
Expand Up @@ -52,7 +52,7 @@ class Loader;
}
}

#ifdef NS_DEBUG
#ifdef DEBUG

extern PRLogModuleInfo* gContentSinkLogModuleInfo;

Expand Down
18 changes: 9 additions & 9 deletions content/html/document/src/nsHTMLContentSink.cpp
Expand Up @@ -85,7 +85,7 @@
using namespace mozilla;
using namespace mozilla::dom;

#ifdef NS_DEBUG
#ifdef DEBUG
static PRLogModuleInfo* gSinkLogModuleInfo;

#define SINK_TRACE_NODE(_bit, _msg, _tag, _sp, _obj) \
Expand Down Expand Up @@ -188,7 +188,7 @@ class HTMLContentSink : public nsContentSink,
already_AddRefed<nsGenericHTMLElement>
CreateContentObject(const nsIParserNode& aNode, nsHTMLTag aNodeType);

#ifdef NS_DEBUG
#ifdef DEBUG
void SinkTraceNode(PRUint32 aBit,
const char* aMsg,
const nsHTMLTag aTag,
Expand Down Expand Up @@ -243,7 +243,7 @@ class HTMLContentSink : public nsContentSink,

bool IsMonolithicContainer(nsHTMLTag aTag);

#ifdef NS_DEBUG
#ifdef DEBUG
void ForceReflow();
#endif
};
Expand Down Expand Up @@ -313,7 +313,7 @@ class SinkContext

//----------------------------------------------------------------------

#ifdef NS_DEBUG
#ifdef DEBUG
void
HTMLContentSink::SinkTraceNode(PRUint32 aBit,
const char* aMsg,
Expand Down Expand Up @@ -582,7 +582,7 @@ SinkContext::DidAddContent(nsIContent* aContent)
mStack[mStackPos - 1].mContent->GetChildCount()) {
nsIContent* parent = mStack[mStackPos - 1].mContent;

#ifdef NS_DEBUG
#ifdef DEBUG
// Tracing code
nsIParserService *parserService = nsContentUtils::GetParserService();
if (parserService) {
Expand Down Expand Up @@ -757,7 +757,7 @@ SinkContext::CloseContainer(const nsHTMLTag aTag)
// notification

if (mStack[mStackPos].mNumFlushed < content->GetChildCount()) {
#ifdef NS_DEBUG
#ifdef DEBUG
{
// Tracing code
SINK_TRACE(gSinkLogModuleInfo, SINK_TRACE_REFLOW,
Expand Down Expand Up @@ -1068,7 +1068,7 @@ SinkContext::FlushTags()
childCount = content->GetChildCount();

if (!flushed && (mStack[stackPos].mNumFlushed < childCount)) {
#ifdef NS_DEBUG
#ifdef DEBUG
{
// Tracing code
SINK_TRACE(gSinkLogModuleInfo, SINK_TRACE_REFLOW,
Expand Down Expand Up @@ -1242,7 +1242,7 @@ HTMLContentSink::HTMLContentSink()
// Note: operator new zeros our memory


#ifdef NS_DEBUG
#ifdef DEBUG
if (!gSinkLogModuleInfo) {
gSinkLogModuleInfo = PR_NewLogModule("htmlcontentsink");
}
Expand Down Expand Up @@ -1426,7 +1426,7 @@ HTMLContentSink::Init(nsIDocument* aDoc,
mCurrentContext->Begin(eHTMLTag_html, mRoot, 0, -1);
mContextStack.AppendElement(mCurrentContext);

#ifdef NS_DEBUG
#ifdef DEBUG
nsCAutoString spec;
(void)aURI->GetSpec(spec);
SINK_TRACE(gSinkLogModuleInfo, SINK_TRACE_CALLS,
Expand Down
2 changes: 1 addition & 1 deletion content/xml/document/src/nsXMLContentSink.cpp
Expand Up @@ -1214,7 +1214,7 @@ nsXMLContentSink::HandleDoctypeDecl(const nsAString & aSubset,
nsRefPtr<nsCSSStyleSheet> sheet;
mCSSLoader->LoadSheetSync(uri, true, true, getter_AddRefs(sheet));

#ifdef NS_DEBUG
#ifdef DEBUG
nsCAutoString uriStr;
uri->GetSpec(uriStr);
printf("Loading catalog stylesheet: %s ... %s\n", uriStr.get(), sheet.get() ? "Done" : "Failed");
Expand Down
8 changes: 4 additions & 4 deletions content/xul/document/src/nsXULCommandDispatcher.cpp
Expand Up @@ -271,7 +271,7 @@ nsXULCommandDispatcher::AddCommandUpdater(nsIDOMElement* aElement,
while (updater) {
if (updater->mElement == aElement) {

#ifdef NS_DEBUG
#ifdef DEBUG
if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) {
nsCAutoString eventsC, targetsC, aeventsC, atargetsC;
eventsC.AssignWithConversion(updater->mEvents);
Expand Down Expand Up @@ -299,7 +299,7 @@ nsXULCommandDispatcher::AddCommandUpdater(nsIDOMElement* aElement,
link = &(updater->mNext);
updater = updater->mNext;
}
#ifdef NS_DEBUG
#ifdef DEBUG
if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) {
nsCAutoString aeventsC, atargetsC;
CopyUTF16toUTF8(aEvents, aeventsC);
Expand Down Expand Up @@ -334,7 +334,7 @@ nsXULCommandDispatcher::RemoveCommandUpdater(nsIDOMElement* aElement)

while (updater) {
if (updater->mElement == aElement) {
#ifdef NS_DEBUG
#ifdef DEBUG
if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) {
nsCAutoString eventsC, targetsC;
eventsC.AssignWithConversion(updater->mEvents);
Expand Down Expand Up @@ -400,7 +400,7 @@ nsXULCommandDispatcher::UpdateCommands(const nsAString& aEventName)
if (! document)
continue;

#ifdef NS_DEBUG
#ifdef DEBUG
if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) {
nsCAutoString aeventnameC;
CopyUTF16toUTF8(aEventName, aeventnameC);
Expand Down
2 changes: 1 addition & 1 deletion docshell/base/nsDocShell.cpp
Expand Up @@ -10575,7 +10575,7 @@ nsDocShell::SetHistoryEntry(nsCOMPtr<nsISHEntry> *aPtr, nsISHEntry *aEntry)
nsDocShell *rootDocShell = static_cast<nsDocShell*>
(rootIDocShell);

#ifdef NS_DEBUG
#ifdef DEBUG
nsresult rv =
#endif
SetChildHistoryEntry(oldRootEntry, rootDocShell,
Expand Down
6 changes: 3 additions & 3 deletions dom/base/nsDOMClassInfo.cpp
Expand Up @@ -613,7 +613,7 @@ static const char kDOMStringBundleURL[] =
(nsIClassInfo::MAIN_THREAD_ONLY | nsIClassInfo::DOM_OBJECT)


#ifdef NS_DEBUG
#ifdef DEBUG
#define NS_DEFINE_CLASSINFO_DATA_DEBUG(_class) \
eDOMClassInfo_##_class##_id,
#else
Expand Down Expand Up @@ -4535,7 +4535,7 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMLockedFile)
DOM_CLASSINFO_MAP_END

#ifdef NS_DEBUG
#ifdef DEBUG
{
PRUint32 i = ArrayLength(sClassInfoData);

Expand Down Expand Up @@ -5876,7 +5876,7 @@ DefineInterfaceConstants(JSContext *cx, JSObject *obj, const nsIID *aIID)
}
default:
{
#ifdef NS_DEBUG
#ifdef DEBUG
NS_ERROR("Non-numeric constant found in interface.");
#endif
continue;
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsDOMClassInfo.h
Expand Up @@ -71,7 +71,7 @@ struct nsDOMClassInfoData
PRUint32 mInterfacesBitmap;
bool mChromeOnly;
bool mDisabled;
#ifdef NS_DEBUG
#ifdef DEBUG
PRUint32 mDebugID;
#endif
};
Expand Down
8 changes: 4 additions & 4 deletions dom/base/nsGlobalWindow.cpp
Expand Up @@ -257,7 +257,7 @@ static TimeStamp gLastRecordedRecentTimeouts;
PRInt32 gTimeoutCnt = 0;
#endif

#if !(defined(NS_DEBUG) || defined(MOZ_ENABLE_JS_DUMP))
#if !(defined(DEBUG) || defined(MOZ_ENABLE_JS_DUMP))
static bool gDOMWindowDumpEnabled = false;
#endif

Expand Down Expand Up @@ -713,7 +713,7 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow)
gRefCnt++;

if (gRefCnt == 1) {
#if !(defined(NS_DEBUG) || defined(MOZ_ENABLE_JS_DUMP))
#if !(defined(DEBUG) || defined(MOZ_ENABLE_JS_DUMP))
Preferences::AddBoolVarCache(&gDOMWindowDumpEnabled,
"browser.dom.window.dump.enabled");
#endif
Expand Down Expand Up @@ -4464,7 +4464,7 @@ nsGlobalWindow::GetFullScreen(bool* aFullScreen)
bool
nsGlobalWindow::DOMWindowDumpEnabled()
{
#if !(defined(NS_DEBUG) || defined(MOZ_ENABLE_JS_DUMP))
#if !(defined(DEBUG) || defined(MOZ_ENABLE_JS_DUMP))
// In optimized builds we check a pref that controls if we should
// enable output from dump() or not, in debug builds it's always
// enabled.
Expand Down Expand Up @@ -8631,7 +8631,7 @@ nsGlobalWindow::OpenInternal(const nsAString& aUrl, const nsAString& aName,
aJSCallerContext, aReturn),
NS_ERROR_NOT_INITIALIZED);

#ifdef NS_DEBUG
#ifdef DEBUG
PRUint32 argc = 0;
if (argv)
argv->GetLength(&argc);
Expand Down
4 changes: 2 additions & 2 deletions dom/base/nsJSEnvironment.cpp
Expand Up @@ -1676,7 +1676,7 @@ nsJSContext::JSObjectFromInterface(nsISupports* aTarget, JSObject* aScope, JSObj
nsresult rv = nsContentUtils::WrapNative(mContext, aScope, aTarget, &v);
NS_ENSURE_SUCCESS(rv, rv);

#ifdef NS_DEBUG
#ifdef DEBUG
nsCOMPtr<nsISupports> targetSupp = do_QueryInterface(aTarget);
nsCOMPtr<nsISupports> native =
nsContentUtils::XPConnect()->GetNativeOfWrapper(mContext,
Expand Down Expand Up @@ -2216,7 +2216,7 @@ nsJSContext::ConvertSupportsTojsvals(nsISupports *aArgs,
if (rv == NS_ERROR_NO_INTERFACE) {
// something else - probably an event object or similar -
// just wrap it.
#ifdef NS_DEBUG
#ifdef DEBUG
// but first, check its not another nsISupportsPrimitive, as
// these are now deprecated for use with script contexts.
nsCOMPtr<nsISupportsPrimitive> prim(do_QueryInterface(arg));
Expand Down
2 changes: 1 addition & 1 deletion dom/plugins/base/nsNPAPIPluginStreamListener.cpp
Expand Up @@ -66,7 +66,7 @@ mOwner(owner)
// construct the URL we'll use later in calls to GetURL()
NS_GetURLSpecFromFile(mTempFile, mFileURL);

#ifdef NS_DEBUG
#ifdef DEBUG
printf("File URL = %s\n", mFileURL.get());
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion dom/plugins/base/nsPluginHost.cpp
Expand Up @@ -1636,7 +1636,7 @@ nsresult nsPluginHost::GetPlugin(const char *aMimeType, nsNPAPIPlugin** aPlugin)
("nsPluginHost::GetPlugin Begin mime=%s, plugin=%s\n",
aMimeType, pluginTag->mFileName.get()));

#ifdef NS_DEBUG
#ifdef DEBUG
if (aMimeType && !pluginTag->mFileName.IsEmpty())
printf("For %s found plugin %s\n", aMimeType, pluginTag->mFileName.get());
#endif
Expand Down
6 changes: 3 additions & 3 deletions dom/plugins/base/nsPluginNativeWindowGtk2.cpp
Expand Up @@ -219,7 +219,7 @@ void nsPluginNativeWindowGtk2::SetAllocation() {
nsresult nsPluginNativeWindowGtk2::CreateXtWindow() {
NS_ASSERTION(!mSocketWidget,"Already created a socket widget!");

#ifdef NS_DEBUG
#ifdef DEBUG
printf("About to create new xtbin of %i X %i from %p...\n",
width, height, (void*)window);
#endif
Expand All @@ -235,11 +235,11 @@ nsresult nsPluginNativeWindowGtk2::CreateXtWindow() {

gtk_widget_set_size_request(mSocketWidget, width, height);

#ifdef NS_DEBUG
#ifdef DEBUG
printf("About to show xtbin(%p)...\n", (void*)mSocketWidget); fflush(NULL);
#endif
gtk_widget_show(mSocketWidget);
#ifdef NS_DEBUG
#ifdef DEBUG
printf("completed gtk_widget_show(%p)\n", (void*)mSocketWidget); fflush(NULL);
#endif

Expand Down
2 changes: 1 addition & 1 deletion dom/plugins/base/nsPluginsDirUnix.cpp
Expand Up @@ -303,7 +303,7 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary **outLibrary)
pLibrary = *outLibrary;
#endif // MOZ_WIDGET_GTK2

#ifdef NS_DEBUG
#ifdef DEBUG
printf("LoadPlugin() %s returned %lx\n",
libSpec.value.pathname, (unsigned long)pLibrary);
#endif
Expand Down
4 changes: 2 additions & 2 deletions dom/src/events/nsJSEventListener.cpp
Expand Up @@ -24,7 +24,7 @@
#include "xpcpublic.h"
#include "nsJSEnvironment.h"
#include "nsDOMJSUtils.h"
#ifdef NS_DEBUG
#ifdef DEBUG

#include "nspr.h" // PR_fprintf

Expand Down Expand Up @@ -174,7 +174,7 @@ nsJSEventListener::HandleEvent(nsIDOMEvent* aEvent)

// mContext is the same context which event listener manager pushes
// to JS context stack.
#ifdef NS_DEBUG
#ifdef DEBUG
JSContext* cx = nsnull;
nsCOMPtr<nsIJSContextStack> stack =
do_GetService("@mozilla.org/js/xpc/ContextStack;1");
Expand Down
10 changes: 5 additions & 5 deletions editor/libeditor/base/CreateElementTxn.cpp
Expand Up @@ -13,7 +13,7 @@

#include "mozilla/dom/Element.h"

#ifdef NS_DEBUG
#ifdef DEBUG
static bool gNoisy = false;
#endif

Expand Down Expand Up @@ -60,7 +60,7 @@ NS_IMETHODIMP CreateElementTxn::Init(nsEditor *aEditor,

NS_IMETHODIMP CreateElementTxn::DoTransaction(void)
{
#ifdef NS_DEBUG
#ifdef DEBUG
if (gNoisy)
{
char* nodename = ToNewCString(mTag);
Expand All @@ -84,7 +84,7 @@ NS_IMETHODIMP CreateElementTxn::DoTransaction(void)
// Try to insert formatting whitespace for the new node:
mEditor->MarkNodeDirty(mNewNode);

#ifdef NS_DEBUG
#ifdef DEBUG
if (gNoisy)
{
printf(" newNode = %p\n", static_cast<void*>(mNewNode.get()));
Expand Down Expand Up @@ -134,7 +134,7 @@ NS_IMETHODIMP CreateElementTxn::DoTransaction(void)

NS_IMETHODIMP CreateElementTxn::UndoTransaction(void)
{
#ifdef NS_DEBUG
#ifdef DEBUG
if (gNoisy)
{
printf("Undo Create Element, mParent = %p, node = %p\n",
Expand All @@ -152,7 +152,7 @@ NS_IMETHODIMP CreateElementTxn::UndoTransaction(void)

NS_IMETHODIMP CreateElementTxn::RedoTransaction(void)
{
#ifdef NS_DEBUG
#ifdef DEBUG
if (gNoisy) { printf("Redo Create Element\n"); }
#endif

Expand Down

0 comments on commit 7004c16

Please sign in to comment.