| 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 15 matching lines...) Expand all Loading... |
| 26 #ifndef BackgroundHTMLParser_h | 26 #ifndef BackgroundHTMLParser_h |
| 27 #define BackgroundHTMLParser_h | 27 #define BackgroundHTMLParser_h |
| 28 | 28 |
| 29 #include "core/dom/DocumentEncodingData.h" | 29 #include "core/dom/DocumentEncodingData.h" |
| 30 #include "core/html/parser/BackgroundHTMLInputStream.h" | 30 #include "core/html/parser/BackgroundHTMLInputStream.h" |
| 31 #include "core/html/parser/CompactHTMLToken.h" | 31 #include "core/html/parser/CompactHTMLToken.h" |
| 32 #include "core/html/parser/HTMLParserOptions.h" | 32 #include "core/html/parser/HTMLParserOptions.h" |
| 33 #include "core/html/parser/HTMLPreloadScanner.h" | 33 #include "core/html/parser/HTMLPreloadScanner.h" |
| 34 #include "core/html/parser/HTMLSourceTracker.h" | 34 #include "core/html/parser/HTMLSourceTracker.h" |
| 35 #include "core/html/parser/HTMLTreeBuilderSimulator.h" | 35 #include "core/html/parser/HTMLTreeBuilderSimulator.h" |
| 36 #include "core/html/parser/ParsedChunkQueue.h" | |
| 37 #include "core/html/parser/TextResourceDecoder.h" | 36 #include "core/html/parser/TextResourceDecoder.h" |
| 37 #include "core/html/parser/TokenizedChunkQueue.h" |
| 38 #include "core/html/parser/XSSAuditorDelegate.h" | 38 #include "core/html/parser/XSSAuditorDelegate.h" |
| 39 #include "wtf/WeakPtr.h" | 39 #include "wtf/WeakPtr.h" |
| 40 #include <memory> | 40 #include <memory> |
| 41 | 41 |
| 42 namespace blink { | 42 namespace blink { |
| 43 | 43 |
| 44 class HTMLDocumentParser; | 44 class HTMLDocumentParser; |
| 45 class XSSAuditor; | 45 class XSSAuditor; |
| 46 class WebTaskRunner; | 46 class WebTaskRunner; |
| 47 | 47 |
| 48 class BackgroundHTMLParser { | 48 class BackgroundHTMLParser { |
| 49 USING_FAST_MALLOC(BackgroundHTMLParser); | 49 USING_FAST_MALLOC(BackgroundHTMLParser); |
| 50 WTF_MAKE_NONCOPYABLE(BackgroundHTMLParser); | 50 WTF_MAKE_NONCOPYABLE(BackgroundHTMLParser); |
| 51 public: | 51 public: |
| 52 struct Configuration { | 52 struct Configuration { |
| 53 USING_FAST_MALLOC(Configuration); | 53 USING_FAST_MALLOC(Configuration); |
| 54 public: | 54 public: |
| 55 Configuration(); | 55 Configuration(); |
| 56 HTMLParserOptions options; | 56 HTMLParserOptions options; |
| 57 WeakPtr<HTMLDocumentParser> parser; | 57 WeakPtr<HTMLDocumentParser> parser; |
| 58 std::unique_ptr<XSSAuditor> xssAuditor; | 58 std::unique_ptr<XSSAuditor> xssAuditor; |
| 59 std::unique_ptr<TextResourceDecoder> decoder; | 59 std::unique_ptr<TextResourceDecoder> decoder; |
| 60 RefPtr<ParsedChunkQueue> parsedChunkQueue; | 60 RefPtr<TokenizedChunkQueue> tokenizedChunkQueue; |
| 61 // outstandingTokenLimit must be greater than or equal to | 61 // outstandingTokenLimit must be greater than or equal to |
| 62 // pendingTokenLimit | 62 // pendingTokenLimit |
| 63 size_t outstandingTokenLimit; | 63 size_t outstandingTokenLimit; |
| 64 size_t pendingTokenLimit; | 64 size_t pendingTokenLimit; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 static void start(PassRefPtr<WeakReference<BackgroundHTMLParser>>, std::uniq
ue_ptr<Configuration>, const KURL& documentURL, std::unique_ptr<CachedDocumentPa
rameters>, const MediaValuesCached::MediaValuesCachedData&, std::unique_ptr<WebT
askRunner>); | 67 static void start(PassRefPtr<WeakReference<BackgroundHTMLParser>>, std::uniq
ue_ptr<Configuration>, const KURL& documentURL, std::unique_ptr<CachedDocumentPa
rameters>, const MediaValuesCached::MediaValuesCachedData&, std::unique_ptr<WebT
askRunner>); |
| 68 | 68 |
| 69 struct Checkpoint { | 69 struct Checkpoint { |
| 70 USING_FAST_MALLOC(Checkpoint); | 70 USING_FAST_MALLOC(Checkpoint); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // Indices into |m_pendingTokens|. | 117 // Indices into |m_pendingTokens|. |
| 118 Vector<int> m_likelyDocumentWriteScriptIndices; | 118 Vector<int> m_likelyDocumentWriteScriptIndices; |
| 119 ViewportDescriptionWrapper m_viewportDescription; | 119 ViewportDescriptionWrapper m_viewportDescription; |
| 120 XSSInfoStream m_pendingXSSInfos; | 120 XSSInfoStream m_pendingXSSInfos; |
| 121 | 121 |
| 122 std::unique_ptr<XSSAuditor> m_xssAuditor; | 122 std::unique_ptr<XSSAuditor> m_xssAuditor; |
| 123 std::unique_ptr<TokenPreloadScanner> m_preloadScanner; | 123 std::unique_ptr<TokenPreloadScanner> m_preloadScanner; |
| 124 std::unique_ptr<TextResourceDecoder> m_decoder; | 124 std::unique_ptr<TextResourceDecoder> m_decoder; |
| 125 DocumentEncodingData m_lastSeenEncodingData; | 125 DocumentEncodingData m_lastSeenEncodingData; |
| 126 std::unique_ptr<WebTaskRunner> m_loadingTaskRunner; | 126 std::unique_ptr<WebTaskRunner> m_loadingTaskRunner; |
| 127 RefPtr<ParsedChunkQueue> m_parsedChunkQueue; | 127 RefPtr<TokenizedChunkQueue> m_tokenizedChunkQueue; |
| 128 | 128 |
| 129 bool m_startingScript; | 129 bool m_startingScript; |
| 130 double m_lastBytesReceivedTime; | 130 double m_lastBytesReceivedTime; |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 } // namespace blink | 133 } // namespace blink |
| 134 | 134 |
| 135 #endif | 135 #endif |
| OLD | NEW |