Index: Source/core/html/parser/HTMLParserScheduler.h |
diff --git a/Source/core/html/parser/HTMLParserScheduler.h b/Source/core/html/parser/HTMLParserScheduler.h |
index d3414aeef1ffca02deffee6b89722756530771af..5c853a30d111ddc096f2b9a5a582181ce94945e5 100644 |
--- a/Source/core/html/parser/HTMLParserScheduler.h |
+++ b/Source/core/html/parser/HTMLParserScheduler.h |
@@ -28,7 +28,6 @@ |
#include "core/html/parser/NestingLevelIncrementer.h" |
#include "platform/Timer.h" |
-#include "wtf/CurrentTime.h" |
#include "wtf/PassOwnPtr.h" |
#include "wtf/RefPtr.h" |
@@ -54,6 +53,17 @@ public: |
~PumpSession(); |
}; |
+class SpeculationsPumpSession : public ActiveParserSession { |
+public: |
+ explicit SpeculationsPumpSession(Document*); |
+ ~SpeculationsPumpSession(); |
+ |
+ double elapsedTime() const; |
+ |
+private: |
+ double m_startTime; |
+}; |
+ |
class HTMLParserScheduler { |
WTF_MAKE_NONCOPYABLE(HTMLParserScheduler); WTF_MAKE_FAST_ALLOCATED; |
public: |
@@ -63,15 +73,18 @@ public: |
} |
~HTMLParserScheduler(); |
- void scheduleForResume(); |
bool isScheduledForResume() const { return m_isSuspendedWithActiveTimer || m_continueNextChunkTimer.isActive(); } |
+ bool yieldIfNeeded(const SpeculationsPumpSession&); |
+ |
void suspend(); |
void resume(); |
private: |
- HTMLParserScheduler(HTMLDocumentParser*); |
+ explicit HTMLParserScheduler(HTMLDocumentParser*); |
+ bool shouldYield(const SpeculationsPumpSession&) const; |
+ void scheduleForResume(); |
void continueNextChunkTimerFired(Timer<HTMLParserScheduler>*); |
HTMLDocumentParser* m_parser; |