Commit 94086bc3 authored by Kouhei Ueno's avatar Kouhei Ueno Committed by Commit Bot

Revert "Remove Document::execute_scripts_waiting_for_resources_task_handle_"

This reverts commit 9a7108cd.

Reason for revert:
Regress Loading.Desktop TTFMP
https://bugs.chromium.org/p/chromium/issues/detail?id=744676

Original change's description:
> Remove Document::execute_scripts_waiting_for_resources_task_handle_
> 
> The task handle is never cancelled, so it can be replaced w/ a simple PostTask.
> The task lifetime is managed by weakPersistent anyways.
> 
> Bug: None
> Change-Id: I191c9cad4982c42ba5d0177d1464d32b31bc2354
> Reviewed-on: https://chromium-review.googlesource.com/571110
> Reviewed-by: Kent Tamura <tkent@chromium.org>
> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
> Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#486726}

TBR=kinuko@chromium.org,haraken@chromium.org,kouhei@chromium.org,tkent@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: None
Change-Id: I9506014338f85a0190539d9ab19927819c0a8372
Reviewed-on: https://chromium-review.googlesource.com/574989Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487402}
parent 9eb642e3
...@@ -3704,10 +3704,12 @@ void Document::DidRemoveAllPendingBodyStylesheets() { ...@@ -3704,10 +3704,12 @@ void Document::DidRemoveAllPendingBodyStylesheets() {
void Document::DidLoadAllScriptBlockingResources() { void Document::DidLoadAllScriptBlockingResources() {
// Use wrapWeakPersistent because the task should not keep this Document alive // Use wrapWeakPersistent because the task should not keep this Document alive
// just for executing scripts. // just for executing scripts.
TaskRunnerHelper::Get(TaskType::kNetworking, this) execute_scripts_waiting_for_resources_task_handle_ =
->PostTask(BLINK_FROM_HERE, TaskRunnerHelper::Get(TaskType::kNetworking, this)
WTF::Bind(&Document::ExecuteScriptsWaitingForResources, ->PostCancellableTask(
WrapWeakPersistent(this))); BLINK_FROM_HERE,
WTF::Bind(&Document::ExecuteScriptsWaitingForResources,
WrapWeakPersistent(this)));
if (IsHTMLDocument() && body()) { if (IsHTMLDocument() && body()) {
// For HTML if we have no more stylesheets to load and we're past the body // For HTML if we have no more stylesheets to load and we're past the body
......
...@@ -1497,6 +1497,8 @@ class CORE_EXPORT Document : public ContainerNode, ...@@ -1497,6 +1497,8 @@ class CORE_EXPORT Document : public ContainerNode,
// This is cheaper than making setCompatibilityMode virtual. // This is cheaper than making setCompatibilityMode virtual.
bool compatibility_mode_locked_; bool compatibility_mode_locked_;
TaskHandle execute_scripts_waiting_for_resources_task_handle_;
bool has_autofocused_; bool has_autofocused_;
TaskRunnerTimer<Document> clear_focused_element_timer_; TaskRunnerTimer<Document> clear_focused_element_timer_;
Member<Element> autofocus_element_; Member<Element> autofocus_element_;
......
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