OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2013 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 WTF_MAKE_FAST_ALLOCATED; | 47 WTF_MAKE_FAST_ALLOCATED; |
48 public: | 48 public: |
49 struct Configuration { | 49 struct Configuration { |
50 HTMLParserOptions options; | 50 HTMLParserOptions options; |
51 WeakPtr<HTMLDocumentParser> parser; | 51 WeakPtr<HTMLDocumentParser> parser; |
52 OwnPtr<XSSAuditor> xssAuditor; | 52 OwnPtr<XSSAuditor> xssAuditor; |
53 OwnPtr<TokenPreloadScanner> preloadScanner; | 53 OwnPtr<TokenPreloadScanner> preloadScanner; |
54 OwnPtr<TextResourceDecoder> decoder; | 54 OwnPtr<TextResourceDecoder> decoder; |
55 }; | 55 }; |
56 | 56 |
57 static void start(PassRefPtr<WeakReference<BackgroundHTMLParser> >, PassOwnP
tr<Configuration>); | 57 static void start(PassRefPtr<WeakReference<BackgroundHTMLParser>>, PassOwnPt
r<Configuration>); |
58 | 58 |
59 struct Checkpoint { | 59 struct Checkpoint { |
60 WeakPtr<HTMLDocumentParser> parser; | 60 WeakPtr<HTMLDocumentParser> parser; |
61 OwnPtr<HTMLToken> token; | 61 OwnPtr<HTMLToken> token; |
62 OwnPtr<HTMLTokenizer> tokenizer; | 62 OwnPtr<HTMLTokenizer> tokenizer; |
63 HTMLTreeBuilderSimulator::State treeBuilderState; | 63 HTMLTreeBuilderSimulator::State treeBuilderState; |
64 HTMLInputCheckpoint inputCheckpoint; | 64 HTMLInputCheckpoint inputCheckpoint; |
65 TokenPreloadScannerCheckpoint preloadScannerCheckpoint; | 65 TokenPreloadScannerCheckpoint preloadScannerCheckpoint; |
66 String unparsedInput; | 66 String unparsedInput; |
67 }; | 67 }; |
68 | 68 |
69 void appendRawBytesFromParserThread(const char* data, int dataLength); | 69 void appendRawBytesFromParserThread(const char* data, int dataLength); |
70 | 70 |
71 void appendRawBytesFromMainThread(PassOwnPtr<Vector<char> >); | 71 void appendRawBytesFromMainThread(PassOwnPtr<Vector<char>>); |
72 void setDecoder(PassOwnPtr<TextResourceDecoder>); | 72 void setDecoder(PassOwnPtr<TextResourceDecoder>); |
73 void flush(); | 73 void flush(); |
74 void resumeFrom(PassOwnPtr<Checkpoint>); | 74 void resumeFrom(PassOwnPtr<Checkpoint>); |
75 void startedChunkWithCheckpoint(HTMLInputCheckpoint); | 75 void startedChunkWithCheckpoint(HTMLInputCheckpoint); |
76 void finish(); | 76 void finish(); |
77 void stop(); | 77 void stop(); |
78 | 78 |
79 void forcePlaintextForTextDocument(); | 79 void forcePlaintextForTextDocument(); |
80 | 80 |
81 private: | 81 private: |
82 BackgroundHTMLParser(PassRefPtr<WeakReference<BackgroundHTMLParser> >, PassO
wnPtr<Configuration>); | 82 BackgroundHTMLParser(PassRefPtr<WeakReference<BackgroundHTMLParser>>, PassOw
nPtr<Configuration>); |
83 ~BackgroundHTMLParser(); | 83 ~BackgroundHTMLParser(); |
84 | 84 |
85 void appendDecodedBytes(const String&); | 85 void appendDecodedBytes(const String&); |
86 void markEndOfFile(); | 86 void markEndOfFile(); |
87 void pumpTokenizer(); | 87 void pumpTokenizer(); |
88 void sendTokensToMainThread(); | 88 void sendTokensToMainThread(); |
89 void updateDocument(const String& decodedData); | 89 void updateDocument(const String& decodedData); |
90 | 90 |
91 WeakPtrFactory<BackgroundHTMLParser> m_weakFactory; | 91 WeakPtrFactory<BackgroundHTMLParser> m_weakFactory; |
92 BackgroundHTMLInputStream m_input; | 92 BackgroundHTMLInputStream m_input; |
(...skipping 10 matching lines...) Expand all Loading... |
103 | 103 |
104 OwnPtr<XSSAuditor> m_xssAuditor; | 104 OwnPtr<XSSAuditor> m_xssAuditor; |
105 OwnPtr<TokenPreloadScanner> m_preloadScanner; | 105 OwnPtr<TokenPreloadScanner> m_preloadScanner; |
106 OwnPtr<TextResourceDecoder> m_decoder; | 106 OwnPtr<TextResourceDecoder> m_decoder; |
107 DocumentEncodingData m_lastSeenEncodingData; | 107 DocumentEncodingData m_lastSeenEncodingData; |
108 }; | 108 }; |
109 | 109 |
110 } | 110 } |
111 | 111 |
112 #endif | 112 #endif |
OLD | NEW |