Commit c944b00e authored by Hajime Hoshi's avatar Hajime Hoshi Committed by Commit Bot

Use a per-frame task runner at PrintRenderFrameHelper

This CL switches task runners at several places from per-thread to
per-frame. The purpose of this change is to make it possible to freeze
tasks for bfcache.

We found an actual case that JavaScript is executed:
browser_tests --gtest_filter=PrintBrowserTest.SelectionContainsIframe

Bug: 870606
Change-Id: If7027d9a104513408f2d14507f6938308273bd7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1529501Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Reviewed-by: default avatarWei Li <weili@chromium.org>
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#642359}
parent c2fae4fa
......@@ -945,8 +945,10 @@ void PrepareFrameAndViewForPrint::DidStopLoading() {
DCHECK(!on_ready_.is_null());
// Don't call callback here, because it can delete |this| and WebView that is
// called didStopLoading.
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(&PrepareFrameAndViewForPrint::CallOnReady,
frame()
->GetTaskRunner(blink::TaskType::kInternalDefault)
->PostTask(FROM_HERE,
base::BindOnce(&PrepareFrameAndViewForPrint::CallOnReady,
weak_ptr_factory_.GetWeakPtr()));
}
......
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