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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.h

Issue 2554813002: Make HTMLParserScheduler inherit from ActiveDOMObject
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698