bug 908347 - rm nsIDebugDumpContent r=mrbkap

This commit is contained in:
Trevor Saunders 2013-08-17 10:46:38 -04:00
Родитель 15092f8b87
Коммит b2a552be0c
3 изменённых файлов: 0 добавлений и 89 удалений

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

@ -129,9 +129,6 @@ class HTMLContentSink;
* Don't bother adding new stuff in this file. * Don't bother adding new stuff in this file.
*/ */
class HTMLContentSink : public nsContentSink, class HTMLContentSink : public nsContentSink,
#ifdef DEBUG
public nsIDebugDumpContent,
#endif
public nsIHTMLContentSink public nsIHTMLContentSink
{ {
public: public:
@ -165,11 +162,6 @@ public:
NS_IMETHOD OpenContainer(ElementType aNodeType); NS_IMETHOD OpenContainer(ElementType aNodeType);
NS_IMETHOD CloseContainer(ElementType aTag); NS_IMETHOD CloseContainer(ElementType aTag);
#ifdef DEBUG
// nsIDebugDumpContent
NS_IMETHOD DumpContentModel();
#endif
protected: protected:
already_AddRefed<nsGenericHTMLElement> already_AddRefed<nsGenericHTMLElement>
CreateContentObject(nsHTMLTag aNodeType); CreateContentObject(nsHTMLTag aNodeType);
@ -1094,9 +1086,6 @@ NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLContentSink)
NS_INTERFACE_TABLE_BEGIN NS_INTERFACE_TABLE_BEGIN
NS_INTERFACE_TABLE_ENTRY(HTMLContentSink, nsIContentSink) NS_INTERFACE_TABLE_ENTRY(HTMLContentSink, nsIContentSink)
NS_INTERFACE_TABLE_ENTRY(HTMLContentSink, nsIHTMLContentSink) NS_INTERFACE_TABLE_ENTRY(HTMLContentSink, nsIHTMLContentSink)
#if DEBUG
NS_INTERFACE_TABLE_ENTRY(HTMLContentSink, nsIDebugDumpContent)
#endif
NS_INTERFACE_TABLE_END NS_INTERFACE_TABLE_END
NS_INTERFACE_TABLE_TAIL_INHERITING(nsContentSink) NS_INTERFACE_TABLE_TAIL_INHERITING(nsContentSink)
@ -1655,40 +1644,3 @@ HTMLContentSink::IsScriptExecuting()
{ {
return IsScriptExecutingImpl(); return IsScriptExecutingImpl();
} }
#ifdef DEBUG
/**
* This will dump content model into the output file.
*
* @update harishd 05/25/00
* @param
* @return NS_OK all went well, error on failure
*/
NS_IMETHODIMP
HTMLContentSink::DumpContentModel()
{
FILE* out = ::fopen("rtest_html.txt", "a");
if (out) {
if (mDocument) {
Element* root = mDocument->GetRootElement();
if (root) {
if (mDocumentURI) {
nsAutoCString buf;
mDocumentURI->GetSpec(buf);
fputs(buf.get(), out);
}
fputs(";", out);
root->DumpContent(out, 0, false);
fputs(";\n", out);
}
}
fclose(out);
}
return NS_OK;
}
#endif

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

@ -58,23 +58,6 @@ enum eParserDocType {
enum eStreamState {eNone,eOnStart,eOnDataAvail,eOnStop}; enum eStreamState {eNone,eOnStart,eOnDataAvail,eOnStop};
/**
* FOR DEBUG PURPOSE ONLY
*
* Use this interface to query objects that contain content information.
* Ex. Parser can trigger dump content by querying the sink that has
* access to the content.
*
* @update harishd 05/25/00
*/
class nsIDebugDumpContent : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDEBUG_DUMP_CONTENT_IID)
NS_IMETHOD DumpContentModel()=0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDebugDumpContent, NS_IDEBUG_DUMP_CONTENT_IID)
/** /**
* This GECKO-INTERNAL interface is on track to being REMOVED (or refactored * This GECKO-INTERNAL interface is on track to being REMOVED (or refactored
* to the point of being near-unrecognizable). * to the point of being near-unrecognizable).

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

@ -162,10 +162,6 @@ void nsParser::Shutdown()
NS_IF_RELEASE(sCharsetConverterManager); NS_IF_RELEASE(sCharsetConverterManager);
} }
#ifdef DEBUG
static bool gDumpContent=false;
#endif
/** /**
* default constructor * default constructor
*/ */
@ -182,12 +178,6 @@ nsParser::~nsParser()
void void
nsParser::Initialize(bool aConstructor) nsParser::Initialize(bool aConstructor)
{ {
#ifdef DEBUG
if (!gDumpContent) {
gDumpContent = PR_GetEnv("PARSER_DUMP_CONTENT") != nullptr;
}
#endif
if (aConstructor) { if (aConstructor) {
// Raw pointer // Raw pointer
mParserContext = 0; mParserContext = 0;
@ -215,20 +205,6 @@ nsParser::Initialize(bool aConstructor)
void void
nsParser::Cleanup() nsParser::Cleanup()
{ {
#ifdef DEBUG
if (gDumpContent) {
if (mSink) {
// Sink (HTMLContentSink at this time) supports nsIDebugDumpContent
// interface. We can get to the content model through the sink.
nsresult result = NS_OK;
nsCOMPtr<nsIDebugDumpContent> trigger = do_QueryInterface(mSink, &result);
if (NS_SUCCEEDED(result)) {
trigger->DumpContentModel();
}
}
}
#endif
#ifdef DEBUG #ifdef DEBUG
if (mParserContext && mParserContext->mPrevContext) { if (mParserContext && mParserContext->mPrevContext) {
NS_WARNING("Extra parser contexts still on the parser stack"); NS_WARNING("Extra parser contexts still on the parser stack");