#include "third_party/blink/renderer/core/html/parser/background_html_scanner.h"
#include "base/task/sequenced_task_runner.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/renderer/core/dom/scriptable_document_parser.h"
#include "third_party/blink/renderer/core/execution_context/agent.h"
#include "third_party/blink/renderer/core/html/parser/html_preload_scanner.h"
#include "third_party/blink/renderer/core/html/parser/html_token.h"
#include "third_party/blink/renderer/core/html/parser/html_tokenizer.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/scheduler/public/worker_pool.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_base.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_std.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
namespace blink {
namespace {
CompileOptions;
enum class CompileStrategy { … };
CompileOptions GetCompileOptions(bool first_script_in_scan) { … }
scoped_refptr<base::SequencedTaskRunner> GetCompileTaskRunner() { … }
wtf_size_t GetMinimumScriptSize() { … }
bool ShouldPrecompileFrame(bool is_main_frame) { … }
}
WTF::SequenceBound<BackgroundHTMLScanner> BackgroundHTMLScanner::Create(
const HTMLParserOptions& options,
ScriptableDocumentParser* parser) { … }
BackgroundHTMLScanner::BackgroundHTMLScanner(
std::unique_ptr<HTMLTokenizer> tokenizer,
std::unique_ptr<ScriptTokenScanner> token_scanner)
: … { … }
BackgroundHTMLScanner::~BackgroundHTMLScanner() = default;
void BackgroundHTMLScanner::Scan(const String& source) { … }
std::unique_ptr<BackgroundHTMLScanner::ScriptTokenScanner>
BackgroundHTMLScanner::ScriptTokenScanner::Create(
ScriptableDocumentParser* parser) { … }
BackgroundHTMLScanner::ScriptTokenScanner::ScriptTokenScanner(
ScriptableDocumentParser* parser,
scoped_refptr<base::SequencedTaskRunner> task_runner,
wtf_size_t min_script_size)
: … { … }
void BackgroundHTMLScanner::ScriptTokenScanner::ScanToken(
const HTMLToken& token) { … }
}