Commit 4613db96 authored by Richard Townsend's avatar Richard Townsend Committed by Commit Bot

refactor: extract PumpSession

A future CL will introduce a HTML parser which doesn't use the
HTMLParserScheduler. This CL moves PumpScheduler outside so it can be
re-used by this new parser. No behaviour changes are expected.

Bug: 901056
Change-Id: I096e379f1c4adcd9ce221c241c322415995298a0
Reviewed-on: https://chromium-review.googlesource.com/c/1456013Reviewed-by: default avatarFergal Daly <fergal@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Commit-Queue: Richard Townsend <richard.townsend@arm.com>
Cr-Commit-Position: refs/heads/master@{#635170}
parent 3e900197
...@@ -65,6 +65,8 @@ blink_core_sources("parser") { ...@@ -65,6 +65,8 @@ blink_core_sources("parser") {
"parser_synchronization_policy.h", "parser_synchronization_policy.h",
"preload_request.cc", "preload_request.cc",
"preload_request.h", "preload_request.h",
"pump_session.cc",
"pump_session.h",
"resource_preloader.cc", "resource_preloader.cc",
"resource_preloader.h", "resource_preloader.h",
"text_document_parser.cc", "text_document_parser.cc",
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "third_party/blink/renderer/core/html/parser/html_parser_scheduler.h" #include "third_party/blink/renderer/core/html/parser/html_parser_scheduler.h"
#include "third_party/blink/renderer/core/html/parser/html_resource_preloader.h" #include "third_party/blink/renderer/core/html/parser/html_resource_preloader.h"
#include "third_party/blink/renderer/core/html/parser/html_tree_builder.h" #include "third_party/blink/renderer/core/html/parser/html_tree_builder.h"
#include "third_party/blink/renderer/core/html/parser/pump_session.h"
#include "third_party/blink/renderer/core/html_names.h" #include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/inspector/inspector_trace_events.h" #include "third_party/blink/renderer/core/inspector/inspector_trace_events.h"
#include "third_party/blink/renderer/core/loader/document_loader.h" #include "third_party/blink/renderer/core/loader/document_loader.h"
......
...@@ -35,11 +35,6 @@ ...@@ -35,11 +35,6 @@
namespace blink { namespace blink {
PumpSession::PumpSession(unsigned& nesting_level)
: NestingLevelIncrementer(nesting_level) {}
PumpSession::~PumpSession() = default;
SpeculationsPumpSession::SpeculationsPumpSession(unsigned& nesting_level) SpeculationsPumpSession::SpeculationsPumpSession(unsigned& nesting_level)
: NestingLevelIncrementer(nesting_level), : NestingLevelIncrementer(nesting_level),
start_time_(CurrentTime()), start_time_(CurrentTime()),
......
...@@ -39,14 +39,6 @@ namespace blink { ...@@ -39,14 +39,6 @@ namespace blink {
class HTMLDocumentParser; class HTMLDocumentParser;
class PumpSession : public NestingLevelIncrementer {
STACK_ALLOCATED();
public:
PumpSession(unsigned& nesting_level);
~PumpSession();
};
class SpeculationsPumpSession : public NestingLevelIncrementer { class SpeculationsPumpSession : public NestingLevelIncrementer {
STACK_ALLOCATED(); STACK_ALLOCATED();
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/core/html/parser/pump_session.h"
namespace blink {
PumpSession::PumpSession(unsigned& nesting_level)
: NestingLevelIncrementer(nesting_level) {}
PumpSession::~PumpSession() = default;
} // namespace blink
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_HTML_PARSER_PUMP_SESSION_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_HTML_PARSER_PUMP_SESSION_H_
#include "third_party/blink/renderer/core/html/parser/nesting_level_incrementer.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
namespace blink {
class PumpSession : public NestingLevelIncrementer {
STACK_ALLOCATED();
public:
PumpSession(unsigned& nesting_level);
~PumpSession();
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_HTML_PARSER_PUMP_SESSION_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment