summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/html/parser/html_parser_scheduler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/core/html/parser/html_parser_scheduler.cc')
-rw-r--r--chromium/third_party/blink/renderer/core/html/parser/html_parser_scheduler.cc34
1 files changed, 2 insertions, 32 deletions
diff --git a/chromium/third_party/blink/renderer/core/html/parser/html_parser_scheduler.cc b/chromium/third_party/blink/renderer/core/html/parser/html_parser_scheduler.cc
index 601f0eb325c..1559a1624ba 100644
--- a/chromium/third_party/blink/renderer/core/html/parser/html_parser_scheduler.cc
+++ b/chromium/third_party/blink/renderer/core/html/parser/html_parser_scheduler.cc
@@ -40,10 +40,6 @@ SpeculationsPumpSession::SpeculationsPumpSession(unsigned& nesting_level)
SpeculationsPumpSession::~SpeculationsPumpSession() = default;
-inline base::TimeDelta SpeculationsPumpSession::ElapsedTime() const {
- return start_time_.Elapsed();
-}
-
void SpeculationsPumpSession::AddedElementTokens(size_t count) {
processed_element_tokens_ += count;
}
@@ -51,9 +47,7 @@ void SpeculationsPumpSession::AddedElementTokens(size_t count) {
HTMLParserScheduler::HTMLParserScheduler(
HTMLDocumentParser* parser,
scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner)
- : parser_(parser),
- loading_task_runner_(std::move(loading_task_runner)),
- is_paused_with_active_timer_(false) {}
+ : parser_(parser), loading_task_runner_(std::move(loading_task_runner)) {}
HTMLParserScheduler::~HTMLParserScheduler() = default;
@@ -62,37 +56,18 @@ void HTMLParserScheduler::Trace(Visitor* visitor) {
}
bool HTMLParserScheduler::IsScheduledForUnpause() const {
- return is_paused_with_active_timer_ ||
- cancellable_continue_parse_task_handle_.IsActive();
+ return cancellable_continue_parse_task_handle_.IsActive();
}
void HTMLParserScheduler::ScheduleForUnpause() {
- DCHECK(!is_paused_with_active_timer_);
cancellable_continue_parse_task_handle_ =
PostCancellableTask(*loading_task_runner_, FROM_HERE,
WTF::Bind(&HTMLParserScheduler::ContinueParsing,
WrapWeakPersistent(this)));
}
-void HTMLParserScheduler::Pause() {
- DCHECK(!is_paused_with_active_timer_);
- if (!cancellable_continue_parse_task_handle_.IsActive())
- return;
- is_paused_with_active_timer_ = true;
- cancellable_continue_parse_task_handle_.Cancel();
-}
-
-void HTMLParserScheduler::Unpause() {
- DCHECK(!cancellable_continue_parse_task_handle_.IsActive());
- if (!is_paused_with_active_timer_)
- return;
- is_paused_with_active_timer_ = false;
- ScheduleForUnpause();
-}
-
void HTMLParserScheduler::Detach() {
cancellable_continue_parse_task_handle_.Cancel();
- is_paused_with_active_timer_ = false;
}
inline bool HTMLParserScheduler::ShouldYield(
@@ -131,11 +106,6 @@ bool HTMLParserScheduler::YieldIfNeeded(const SpeculationsPumpSession& session,
return false;
}
-void HTMLParserScheduler::ForceUnpauseAfterYield() {
- DCHECK(!cancellable_continue_parse_task_handle_.IsActive());
- is_paused_with_active_timer_ = true;
-}
-
void HTMLParserScheduler::ContinueParsing() {
parser_->ResumeParsingAfterYield();
}