Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h

Issue 1422233002: Revert of BackgroundHTMLParser: Introduce ParsedChunkQueue to pass ParsedChunks to main thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 namespace blink { 53 namespace blink {
54 54
55 class BackgroundHTMLParser; 55 class BackgroundHTMLParser;
56 class CompactHTMLToken; 56 class CompactHTMLToken;
57 class Document; 57 class Document;
58 class DocumentEncodingData; 58 class DocumentEncodingData;
59 class DocumentFragment; 59 class DocumentFragment;
60 class Element; 60 class Element;
61 class HTMLDocument; 61 class HTMLDocument;
62 class HTMLParserScheduler; 62 class HTMLParserScheduler;
63 class HTMLResourcePreloader;
64 class HTMLScriptRunner; 63 class HTMLScriptRunner;
65 class HTMLTreeBuilder; 64 class HTMLTreeBuilder;
66 class ParsedChunkQueue; 65 class HTMLResourcePreloader;
66
67 class PumpSession; 67 class PumpSession;
68 68
69 class HTMLDocumentParser : public ScriptableDocumentParser, private HTMLScriptR unnerHost { 69 class HTMLDocumentParser : public ScriptableDocumentParser, private HTMLScriptR unnerHost {
70 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(HTMLDocumentParser); 70 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(HTMLDocumentParser);
71 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLDocumentParser); 71 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLDocumentParser);
72 public: 72 public:
73 static PassRefPtrWillBeRawPtr<HTMLDocumentParser> create(HTMLDocument& docum ent, bool reportErrors, ParserSynchronizationPolicy backgroundParsingPolicy) 73 static PassRefPtrWillBeRawPtr<HTMLDocumentParser> create(HTMLDocument& docum ent, bool reportErrors, ParserSynchronizationPolicy backgroundParsingPolicy)
74 { 74 {
75 return adoptRefWillBeNoop(new HTMLDocumentParser(document, reportErrors, backgroundParsingPolicy)); 75 return adoptRefWillBeNoop(new HTMLDocumentParser(document, reportErrors, backgroundParsingPolicy));
76 } 76 }
(...skipping 19 matching lines...) Expand all
96 public: 96 public:
97 OwnPtr<CompactHTMLTokenStream> tokens; 97 OwnPtr<CompactHTMLTokenStream> tokens;
98 PreloadRequestStream preloads; 98 PreloadRequestStream preloads;
99 XSSInfoStream xssInfos; 99 XSSInfoStream xssInfos;
100 HTMLTokenizer::State tokenizerState; 100 HTMLTokenizer::State tokenizerState;
101 HTMLTreeBuilderSimulator::State treeBuilderState; 101 HTMLTreeBuilderSimulator::State treeBuilderState;
102 HTMLInputCheckpoint inputCheckpoint; 102 HTMLInputCheckpoint inputCheckpoint;
103 TokenPreloadScannerCheckpoint preloadScannerCheckpoint; 103 TokenPreloadScannerCheckpoint preloadScannerCheckpoint;
104 bool startingScript; 104 bool startingScript;
105 }; 105 };
106 void notifyPendingParsedChunks(); 106 void didReceiveParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk>);
107 void didReceiveEncodingDataFromBackgroundParser(const DocumentEncodingData&) ; 107 void didReceiveEncodingDataFromBackgroundParser(const DocumentEncodingData&) ;
108 108
109 void appendBytes(const char* bytes, size_t length) override; 109 void appendBytes(const char* bytes, size_t length) override;
110 void flush() final; 110 void flush() final;
111 void setDecoder(PassOwnPtr<TextResourceDecoder>) final; 111 void setDecoder(PassOwnPtr<TextResourceDecoder>) final;
112 112
113 UseCounter* useCounter() { return UseCounter::getFrom(contextForParsingSessi on()); } 113 UseCounter* useCounter() { return UseCounter::getFrom(contextForParsingSessi on()); }
114 114
115 protected: 115 protected:
116 void insert(const SegmentedString&) final; 116 void insert(const SegmentedString&) final;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 XSSAuditorDelegate m_xssAuditorDelegate; 195 XSSAuditorDelegate m_xssAuditorDelegate;
196 196
197 // FIXME: m_lastChunkBeforeScript, m_tokenizer, m_token, and m_input should be combined into a single state object 197 // FIXME: m_lastChunkBeforeScript, m_tokenizer, m_token, and m_input should be combined into a single state object
198 // so they can be set and cleared together and passed between threads togeth er. 198 // so they can be set and cleared together and passed between threads togeth er.
199 OwnPtr<ParsedChunk> m_lastChunkBeforeScript; 199 OwnPtr<ParsedChunk> m_lastChunkBeforeScript;
200 Deque<OwnPtr<ParsedChunk>> m_speculations; 200 Deque<OwnPtr<ParsedChunk>> m_speculations;
201 WeakPtrFactory<HTMLDocumentParser> m_weakFactory; 201 WeakPtrFactory<HTMLDocumentParser> m_weakFactory;
202 WeakPtr<BackgroundHTMLParser> m_backgroundParser; 202 WeakPtr<BackgroundHTMLParser> m_backgroundParser;
203 OwnPtrWillBeMember<HTMLResourcePreloader> m_preloader; 203 OwnPtrWillBeMember<HTMLResourcePreloader> m_preloader;
204 PreloadRequestStream m_queuedPreloads; 204 PreloadRequestStream m_queuedPreloads;
205 OwnPtr<ParsedChunkQueue> m_parsedChunkQueue;
206 205
207 bool m_shouldUseThreading; 206 bool m_shouldUseThreading;
208 bool m_endWasDelayed; 207 bool m_endWasDelayed;
209 bool m_haveBackgroundParser; 208 bool m_haveBackgroundParser;
210 bool m_tasksWereSuspended; 209 bool m_tasksWereSuspended;
211 unsigned m_pumpSessionNestingLevel; 210 unsigned m_pumpSessionNestingLevel;
212 unsigned m_pumpSpeculationsSessionNestingLevel; 211 unsigned m_pumpSpeculationsSessionNestingLevel;
213 bool m_isParsingAtLineNumber; 212 bool m_isParsingAtLineNumber;
214 }; 213 };
215 214
216 } 215 }
217 216
218 #endif 217 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698