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

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

Issue 652813004: Move speculations pump scheduling logic to HTMLParserScheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: explicit Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/parser/HTMLDocumentParser.cpp ('k') | Source/core/html/parser/HTMLParserScheduler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « Source/core/html/parser/HTMLDocumentParser.cpp ('k') | Source/core/html/parser/HTMLParserScheduler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698