Chromium Code Reviews| 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..94312ff7c237fcb965825c697e51ec45f3a8690c 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: |
| + SpeculationsPumpSession(Document*); |
|
haraken
2014/10/21 02:14:05
Add explicit.
|
| + ~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*); |
| + bool shouldYield(const SpeculationsPumpSession&) const; |
| + void scheduleForResume(); |
| void continueNextChunkTimerFired(Timer<HTMLParserScheduler>*); |
| HTMLDocumentParser* m_parser; |