| Index: third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.h
|
| diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.h b/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.h
|
| index c278799fa45b7f4f83c549e7b3bd6faee0674156..61d76febeb9c1129e42a9f40d448c1c42fa8f440 100644
|
| --- a/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.h
|
| +++ b/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.h
|
| @@ -26,6 +26,7 @@
|
| #ifndef HTMLParserScheduler_h
|
| #define HTMLParserScheduler_h
|
|
|
| +#include "core/dom/ActiveDOMObject.h"
|
| #include "core/html/parser/NestingLevelIncrementer.h"
|
| #include "platform/WebTaskRunner.h"
|
| #include "wtf/Allocator.h"
|
| @@ -34,6 +35,7 @@
|
|
|
| namespace blink {
|
|
|
| +class Document;
|
| class HTMLDocumentParser;
|
| class WebTaskRunner;
|
|
|
| @@ -62,38 +64,30 @@ class SpeculationsPumpSession : public NestingLevelIncrementer {
|
| };
|
|
|
| class HTMLParserScheduler final
|
| - : public GarbageCollectedFinalized<HTMLParserScheduler> {
|
| + : public GarbageCollectedFinalized<HTMLParserScheduler>,
|
| + public ActiveDOMObject {
|
| WTF_MAKE_NONCOPYABLE(HTMLParserScheduler);
|
| + USING_GARBAGE_COLLECTED_MIXIN(HTMLParserScheduler);
|
|
|
| public:
|
| - static HTMLParserScheduler* create(HTMLDocumentParser* parser,
|
| - WebTaskRunner* loadingTaskRunner) {
|
| - return new HTMLParserScheduler(parser, loadingTaskRunner);
|
| - }
|
| + static HTMLParserScheduler* create(Document&,
|
| + HTMLDocumentParser*,
|
| + WebTaskRunner*);
|
| ~HTMLParserScheduler();
|
|
|
| bool isScheduledForResume() const;
|
| void scheduleForResume();
|
| bool yieldIfNeeded(const SpeculationsPumpSession&, bool startingScript);
|
|
|
| - /**
|
| - * Can only be called if this scheduler is suspended. If this is called,
|
| - * then after the scheduler is resumed by calling resume(), this call
|
| - * ensures that HTMLDocumentParser::resumeAfterYield will be called. Used to
|
| - * signal this scheduler that the background html parser sent chunks to
|
| - * HTMLDocumentParser while it was suspended.
|
| - */
|
| - void forceResumeAfterYield();
|
| -
|
| - void suspend();
|
| - void resume();
|
| + void suspend() final;
|
| + void resume() final;
|
|
|
| void detach(); // Clear active tasks if any.
|
|
|
| DECLARE_TRACE();
|
|
|
| private:
|
| - HTMLParserScheduler(HTMLDocumentParser*, WebTaskRunner*);
|
| + HTMLParserScheduler(Document&, HTMLDocumentParser*, WebTaskRunner*);
|
|
|
| bool shouldYield(const SpeculationsPumpSession&, bool startingScript) const;
|
| void continueParsing();
|
|
|