OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 13 matching lines...) Expand all Loading... |
24 */ | 24 */ |
25 | 25 |
26 #ifndef HTMLViewSourceParser_h | 26 #ifndef HTMLViewSourceParser_h |
27 #define HTMLViewSourceParser_h | 27 #define HTMLViewSourceParser_h |
28 | 28 |
29 #include "core/dom/DecodedDataDocumentParser.h" | 29 #include "core/dom/DecodedDataDocumentParser.h" |
30 #include "core/html/HTMLViewSourceDocument.h" | 30 #include "core/html/HTMLViewSourceDocument.h" |
31 #include "core/html/parser/HTMLInputStream.h" | 31 #include "core/html/parser/HTMLInputStream.h" |
32 #include "core/html/parser/HTMLSourceTracker.h" | 32 #include "core/html/parser/HTMLSourceTracker.h" |
33 #include "core/html/parser/HTMLTokenizer.h" | 33 #include "core/html/parser/HTMLTokenizer.h" |
| 34 #include "core/html/parser/XSSAuditor.h" |
34 | 35 |
35 namespace WebCore { | 36 namespace WebCore { |
36 | 37 |
37 class HTMLViewSourceParser FINAL : public DecodedDataDocumentParser { | 38 class HTMLViewSourceParser FINAL : public DecodedDataDocumentParser { |
38 public: | 39 public: |
39 static PassRefPtrWillBeRawPtr<HTMLViewSourceParser> create(HTMLViewSourceDoc
ument& document, const String& mimeType) | 40 static PassRefPtrWillBeRawPtr<HTMLViewSourceParser> create(HTMLViewSourceDoc
ument& document, const String& mimeType) |
40 { | 41 { |
41 return adoptRefWillBeNoop(new HTMLViewSourceParser(document, mimeType)); | 42 return adoptRefWillBeNoop(new HTMLViewSourceParser(document, mimeType)); |
42 } | 43 } |
43 virtual ~HTMLViewSourceParser() { } | 44 virtual ~HTMLViewSourceParser() { } |
44 | 45 |
45 private: | 46 private: |
46 HTMLViewSourceParser(HTMLViewSourceDocument&, const String& mimeType); | 47 HTMLViewSourceParser(HTMLViewSourceDocument&, const String& mimeType); |
47 | 48 |
48 // DocumentParser | 49 // DocumentParser |
49 virtual void insert(const SegmentedString&) OVERRIDE { ASSERT_NOT_REACHED();
} | 50 virtual void insert(const SegmentedString&) OVERRIDE { ASSERT_NOT_REACHED();
} |
50 virtual void append(PassRefPtr<StringImpl>) OVERRIDE; | 51 virtual void append(PassRefPtr<StringImpl>) OVERRIDE; |
51 virtual void finish() OVERRIDE; | 52 virtual void finish() OVERRIDE; |
52 | 53 |
53 HTMLViewSourceDocument* document() const { return static_cast<HTMLViewSource
Document*>(DecodedDataDocumentParser::document()); } | 54 HTMLViewSourceDocument* document() const { return static_cast<HTMLViewSource
Document*>(DecodedDataDocumentParser::document()); } |
54 | 55 |
55 void pumpTokenizer(); | 56 void pumpTokenizer(); |
56 void updateTokenizerState(); | 57 void updateTokenizerState(); |
57 | 58 |
58 HTMLInputStream m_input; | 59 HTMLInputStream m_input; |
59 HTMLToken m_token; | 60 HTMLToken m_token; |
60 HTMLSourceTracker m_sourceTracker; | 61 HTMLSourceTracker m_sourceTracker; |
61 OwnPtr<HTMLTokenizer> m_tokenizer; | 62 OwnPtr<HTMLTokenizer> m_tokenizer; |
| 63 XSSAuditor m_xssAuditor; |
62 }; | 64 }; |
63 | 65 |
64 } | 66 } |
65 | 67 |
66 #endif | 68 #endif |
OLD | NEW |