parser/htmlparser/src/CParserContext.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 /**
michael@0 7 * MODULE NOTES:
michael@0 8 * @update gess 4/1/98
michael@0 9 *
michael@0 10 */
michael@0 11
michael@0 12 #ifndef __CParserContext
michael@0 13 #define __CParserContext
michael@0 14
michael@0 15 #include "nsIParser.h"
michael@0 16 #include "nsIURL.h"
michael@0 17 #include "nsIDTD.h"
michael@0 18 #include "nsIStreamListener.h"
michael@0 19 #include "nsIRequest.h"
michael@0 20 #include "nsScanner.h"
michael@0 21 #include "nsString.h"
michael@0 22 #include "nsCOMPtr.h"
michael@0 23 #include "nsAutoPtr.h"
michael@0 24
michael@0 25 /**
michael@0 26 * Note that the parser is given FULL access to all
michael@0 27 * data in a parsercontext. Hey, that what it's for!
michael@0 28 */
michael@0 29
michael@0 30 class CParserContext {
michael@0 31 public:
michael@0 32 enum eContextType {eCTNone,eCTURL,eCTString,eCTStream};
michael@0 33
michael@0 34 CParserContext(CParserContext* aPrevContext,
michael@0 35 nsScanner* aScanner,
michael@0 36 void* aKey = 0,
michael@0 37 eParserCommands aCommand = eViewNormal,
michael@0 38 nsIRequestObserver* aListener = 0,
michael@0 39 eAutoDetectResult aStatus = eUnknownDetect,
michael@0 40 bool aCopyUnused = false);
michael@0 41
michael@0 42 ~CParserContext();
michael@0 43
michael@0 44 nsresult GetTokenizer(nsIDTD* aDTD,
michael@0 45 nsIContentSink* aSink,
michael@0 46 nsITokenizer*& aTokenizer);
michael@0 47 void SetMimeType(const nsACString& aMimeType);
michael@0 48
michael@0 49 nsCOMPtr<nsIRequest> mRequest; // provided by necko to differnciate different input streams
michael@0 50 // why is mRequest strongly referenced? see bug 102376.
michael@0 51 nsCOMPtr<nsIRequestObserver> mListener;
michael@0 52 void* const mKey;
michael@0 53 nsCOMPtr<nsITokenizer> mTokenizer;
michael@0 54 CParserContext* const mPrevContext;
michael@0 55 nsAutoPtr<nsScanner> mScanner;
michael@0 56
michael@0 57 nsCString mMimeType;
michael@0 58 nsDTDMode mDTDMode;
michael@0 59
michael@0 60 eParserDocType mDocType;
michael@0 61 eStreamState mStreamListenerState;
michael@0 62 eContextType mContextType;
michael@0 63 eAutoDetectResult mAutoDetectStatus;
michael@0 64 eParserCommands mParserCommand;
michael@0 65
michael@0 66 bool mMultipart;
michael@0 67 bool mCopyUnused;
michael@0 68 };
michael@0 69
michael@0 70 #endif

mercurial