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