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 18 matching lines...) Expand all Loading... |
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 | 34 |
35 namespace WebCore { | 35 namespace WebCore { |
36 | 36 |
37 class HTMLViewSourceParser FINAL : public DecodedDataDocumentParser { | 37 class HTMLViewSourceParser FINAL : public DecodedDataDocumentParser { |
38 public: | 38 public: |
39 static PassRefPtr<HTMLViewSourceParser> create(HTMLViewSourceDocument* docum
ent, const String& mimeType) | 39 static PassRefPtr<HTMLViewSourceParser> create(HTMLViewSourceDocument& docum
ent, const String& mimeType) |
40 { | 40 { |
41 return adoptRef(new HTMLViewSourceParser(document, mimeType)); | 41 return adoptRef(new HTMLViewSourceParser(document, mimeType)); |
42 } | 42 } |
43 virtual ~HTMLViewSourceParser() { } | 43 virtual ~HTMLViewSourceParser() { } |
44 | 44 |
45 private: | 45 private: |
46 HTMLViewSourceParser(HTMLViewSourceDocument*, const String& mimeType); | 46 HTMLViewSourceParser(HTMLViewSourceDocument&, const String& mimeType); |
47 | 47 |
48 // DocumentParser | 48 // DocumentParser |
49 virtual void insert(const SegmentedString&) OVERRIDE { ASSERT_NOT_REACHED();
} | 49 virtual void insert(const SegmentedString&) OVERRIDE { ASSERT_NOT_REACHED();
} |
50 virtual void append(PassRefPtr<StringImpl>) OVERRIDE; | 50 virtual void append(PassRefPtr<StringImpl>) OVERRIDE; |
51 virtual void finish() OVERRIDE; | 51 virtual void finish() OVERRIDE; |
52 | 52 |
53 HTMLViewSourceDocument* document() const { return static_cast<HTMLViewSource
Document*>(DecodedDataDocumentParser::document()); } | 53 HTMLViewSourceDocument* document() const { return static_cast<HTMLViewSource
Document*>(DecodedDataDocumentParser::document()); } |
54 | 54 |
55 void pumpTokenizer(); | 55 void pumpTokenizer(); |
56 void updateTokenizerState(); | 56 void updateTokenizerState(); |
57 | 57 |
58 HTMLInputStream m_input; | 58 HTMLInputStream m_input; |
59 HTMLToken m_token; | 59 HTMLToken m_token; |
60 HTMLSourceTracker m_sourceTracker; | 60 HTMLSourceTracker m_sourceTracker; |
61 OwnPtr<HTMLTokenizer> m_tokenizer; | 61 OwnPtr<HTMLTokenizer> m_tokenizer; |
62 }; | 62 }; |
63 | 63 |
64 } | 64 } |
65 | 65 |
66 #endif | 66 #endif |
OLD | NEW |