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

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: compilefix 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
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..4dbeae6da369ba1a97507cfb70eb90bfd412ef34 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*);
+ ~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&);
Sami 2014/10/16 12:46:25 Looks like this could be a const method?
kouhei (in TOK) 2014/10/16 12:54:19 Done.
+ void scheduleForResume();
void continueNextChunkTimerFired(Timer<HTMLParserScheduler>*);
HTMLDocumentParser* m_parser;

Powered by Google App Engine
This is Rietveld 408576698