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

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

Issue 2134323002: Remove threading primitives from ParseHTMLOnMainThread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on 405128 Created 4 years, 5 months 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 private: 91 private:
92 BackgroundHTMLParser(PassRefPtr<WeakReference<BackgroundHTMLParser>>, std::u nique_ptr<Configuration>, const KURL& documentURL, std::unique_ptr<CachedDocumen tParameters>, const MediaValuesCached::MediaValuesCachedData&, std::unique_ptr<W ebTaskRunner>); 92 BackgroundHTMLParser(PassRefPtr<WeakReference<BackgroundHTMLParser>>, std::u nique_ptr<Configuration>, const KURL& documentURL, std::unique_ptr<CachedDocumen tParameters>, const MediaValuesCached::MediaValuesCachedData&, std::unique_ptr<W ebTaskRunner>);
93 ~BackgroundHTMLParser(); 93 ~BackgroundHTMLParser();
94 94
95 void appendDecodedBytes(const String&); 95 void appendDecodedBytes(const String&);
96 void markEndOfFile(); 96 void markEndOfFile();
97 void pumpTokenizer(); 97 void pumpTokenizer();
98 void sendTokensToMainThread(); 98 void sendTokensToMainThread();
99 void updateDocument(const String& decodedData); 99 void updateDocument(const String& decodedData);
100 100
101 void runOnMainThread(std::unique_ptr<CrossThreadClosure>); 101 template <typename FunctionType, typename... Ps>
102 void runOnMainThread(FunctionType, Ps&&...);
102 103
103 WeakPtrFactory<BackgroundHTMLParser> m_weakFactory; 104 WeakPtrFactory<BackgroundHTMLParser> m_weakFactory;
104 BackgroundHTMLInputStream m_input; 105 BackgroundHTMLInputStream m_input;
105 HTMLSourceTracker m_sourceTracker; 106 HTMLSourceTracker m_sourceTracker;
106 std::unique_ptr<HTMLToken> m_token; 107 std::unique_ptr<HTMLToken> m_token;
107 std::unique_ptr<HTMLTokenizer> m_tokenizer; 108 std::unique_ptr<HTMLTokenizer> m_tokenizer;
108 HTMLTreeBuilderSimulator m_treeBuilderSimulator; 109 HTMLTreeBuilderSimulator m_treeBuilderSimulator;
109 HTMLParserOptions m_options; 110 HTMLParserOptions m_options;
110 const size_t m_outstandingTokenLimit; 111 const size_t m_outstandingTokenLimit;
111 WeakPtr<HTMLDocumentParser> m_parser; 112 WeakPtr<HTMLDocumentParser> m_parser;
(...skipping 13 matching lines...) Expand all
125 std::unique_ptr<WebTaskRunner> m_loadingTaskRunner; 126 std::unique_ptr<WebTaskRunner> m_loadingTaskRunner;
126 RefPtr<ParsedChunkQueue> m_parsedChunkQueue; 127 RefPtr<ParsedChunkQueue> m_parsedChunkQueue;
127 128
128 bool m_startingScript; 129 bool m_startingScript;
129 double m_lastBytesReceivedTime; 130 double m_lastBytesReceivedTime;
130 }; 131 };
131 132
132 } // namespace blink 133 } // namespace blink
133 134
134 #endif 135 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698