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

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

Issue 100563004: Redirect HTML resource bytes directly to parser thread (Blink side CL) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@parserthread_decodermove
Patch Set: Missing include Created 7 years 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "core/html/parser/HTMLTreeBuilderSimulator.h" 42 #include "core/html/parser/HTMLTreeBuilderSimulator.h"
43 #include "core/html/parser/TextResourceDecoder.h" 43 #include "core/html/parser/TextResourceDecoder.h"
44 #include "core/html/parser/XSSAuditor.h" 44 #include "core/html/parser/XSSAuditor.h"
45 #include "core/html/parser/XSSAuditorDelegate.h" 45 #include "core/html/parser/XSSAuditorDelegate.h"
46 #include "platform/text/SegmentedString.h" 46 #include "platform/text/SegmentedString.h"
47 #include "wtf/Deque.h" 47 #include "wtf/Deque.h"
48 #include "wtf/OwnPtr.h" 48 #include "wtf/OwnPtr.h"
49 #include "wtf/WeakPtr.h" 49 #include "wtf/WeakPtr.h"
50 #include "wtf/text/TextPosition.h" 50 #include "wtf/text/TextPosition.h"
51 51
52 namespace blink {
53 class WebParserResourceBridge;
54 class WebThread;
55 }
56
52 namespace WebCore { 57 namespace WebCore {
53 58
54 class BackgroundHTMLParser; 59 class BackgroundHTMLParser;
55 class CompactHTMLToken; 60 class CompactHTMLToken;
56 class Document; 61 class Document;
57 class DocumentFragment; 62 class DocumentFragment;
58 class HTMLDocument; 63 class HTMLDocument;
59 class HTMLParserScheduler; 64 class HTMLParserScheduler;
60 class HTMLScriptRunner; 65 class HTMLScriptRunner;
61 class HTMLTreeBuilder; 66 class HTMLTreeBuilder;
62 class HTMLResourcePreloader; 67 class HTMLResourcePreloader;
63 class ScriptController; 68 class ScriptController;
64 class ScriptSourceCode; 69 class ScriptSourceCode;
70 class WebParserResourceBridge;
65 71
66 class PumpSession; 72 class PumpSession;
67 73
68 class HTMLDocumentParser : public ScriptableDocumentParser, HTMLScriptRunnerHos t, ResourceClient { 74 class HTMLDocumentParser : public ScriptableDocumentParser, HTMLScriptRunnerHos t, ResourceClient {
69 WTF_MAKE_FAST_ALLOCATED; 75 WTF_MAKE_FAST_ALLOCATED;
70 public: 76 public:
71 static PassRefPtr<HTMLDocumentParser> create(HTMLDocument* document, bool re portErrors) 77 static PassRefPtr<HTMLDocumentParser> create(HTMLDocument* document, bool re portErrors)
72 { 78 {
73 return adoptRef(new HTMLDocumentParser(document, reportErrors)); 79 return adoptRef(new HTMLDocumentParser(document, reportErrors));
74 } 80 }
(...skipping 16 matching lines...) Expand all
91 OwnPtr<CompactHTMLTokenStream> tokens; 97 OwnPtr<CompactHTMLTokenStream> tokens;
92 PreloadRequestStream preloads; 98 PreloadRequestStream preloads;
93 XSSInfoStream xssInfos; 99 XSSInfoStream xssInfos;
94 HTMLTokenizer::State tokenizerState; 100 HTMLTokenizer::State tokenizerState;
95 HTMLTreeBuilderSimulator::State treeBuilderState; 101 HTMLTreeBuilderSimulator::State treeBuilderState;
96 HTMLInputCheckpoint inputCheckpoint; 102 HTMLInputCheckpoint inputCheckpoint;
97 TokenPreloadScannerCheckpoint preloadScannerCheckpoint; 103 TokenPreloadScannerCheckpoint preloadScannerCheckpoint;
98 }; 104 };
99 void didReceiveParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk>); 105 void didReceiveParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk>);
100 void didReceiveEncodingDataFromBackgroundParser(const DocumentEncodingData&) ; 106 void didReceiveEncodingDataFromBackgroundParser(const DocumentEncodingData&) ;
107 static void destructResourceBridge(PassOwnPtr<blink::WebParserResourceBridge >);
abarth-chromium 2013/12/18 18:28:49 destruct -> destroy
101 108
102 virtual void appendBytes(const char* bytes, size_t length) OVERRIDE; 109 virtual void appendBytes(const char* bytes, size_t length) OVERRIDE;
103 virtual void flush() OVERRIDE; 110 virtual void flush() OVERRIDE;
104 virtual void setDecoder(PassOwnPtr<TextResourceDecoder>) OVERRIDE; 111 virtual void setDecoder(PassOwnPtr<TextResourceDecoder>) OVERRIDE;
112 virtual void parserResourceMessageFilterAdded() OVERRIDE;
105 113
106 UseCounter* useCounter() { return UseCounter::getFrom(contextForParsingSessi on()); } 114 UseCounter* useCounter() { return UseCounter::getFrom(contextForParsingSessi on()); }
107 115
108 protected: 116 protected:
109 virtual void insert(const SegmentedString&) OVERRIDE; 117 virtual void insert(const SegmentedString&) OVERRIDE;
110 virtual void append(PassRefPtr<StringImpl>) OVERRIDE; 118 virtual void append(PassRefPtr<StringImpl>) OVERRIDE;
111 virtual void finish() OVERRIDE; 119 virtual void finish() OVERRIDE;
112 120
113 HTMLDocumentParser(HTMLDocument*, bool reportErrors); 121 HTMLDocumentParser(HTMLDocument*, bool reportErrors);
114 HTMLDocumentParser(DocumentFragment*, Element* contextElement, ParserContent Policy); 122 HTMLDocumentParser(DocumentFragment*, Element* contextElement, ParserContent Policy);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 // FIXME: m_lastChunkBeforeScript, m_tokenizer, m_token, and m_input should be combined into a single state object 206 // FIXME: m_lastChunkBeforeScript, m_tokenizer, m_token, and m_input should be combined into a single state object
199 // so they can be set and cleared together and passed between threads togeth er. 207 // so they can be set and cleared together and passed between threads togeth er.
200 OwnPtr<ParsedChunk> m_lastChunkBeforeScript; 208 OwnPtr<ParsedChunk> m_lastChunkBeforeScript;
201 Deque<OwnPtr<ParsedChunk> > m_speculations; 209 Deque<OwnPtr<ParsedChunk> > m_speculations;
202 WeakPtrFactory<HTMLDocumentParser> m_weakFactory; 210 WeakPtrFactory<HTMLDocumentParser> m_weakFactory;
203 WeakPtr<BackgroundHTMLParser> m_backgroundParser; 211 WeakPtr<BackgroundHTMLParser> m_backgroundParser;
204 OwnPtr<HTMLResourcePreloader> m_preloader; 212 OwnPtr<HTMLResourcePreloader> m_preloader;
205 213
206 bool m_isPinnedToMainThread; 214 bool m_isPinnedToMainThread;
207 bool m_endWasDelayed; 215 bool m_endWasDelayed;
208 bool m_haveBackgroundParser;
209 unsigned m_pumpSessionNestingLevel; 216 unsigned m_pumpSessionNestingLevel;
217 blink::WebThread* m_parserThread;
218 bool m_parserThreadIsStandalone;
210 }; 219 };
211 220
212 } 221 }
213 222
214 #endif 223 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698