Commit 4c591461 authored by Yuta Kitamura's avatar Yuta Kitamura Committed by Commit Bot

WebViewImpl: Clear WebViewScheduler on Close().

We plan to have WebViewScheduler owned by Page, which will delay the
execution of WebViewScheduler's destructor because Page is garbage
collected.

This patch moves the execution of the destructor to WebViewImpl::
Close() to ensure nothing will break even if we clear the
WebViewScheduler object early.

Bug: 812986
Change-Id: I5de6b7ad3f3598922a408b2a26cec4718a132f6f
Reviewed-on: https://chromium-review.googlesource.com/923246Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Commit-Queue: Yuta Kitamura <yutak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537269}
parent ed1ca7b7
......@@ -1607,6 +1607,8 @@ void WebViewImpl::Close() {
page_.Clear();
}
scheduler_.reset();
// Reset the delegate to prevent notifications being sent as we're being
// deleted.
client_ = nullptr;
......
......@@ -676,7 +676,7 @@ class CORE_EXPORT WebViewImpl final
WebPageImportanceSignals page_importance_signals_;
const std::unique_ptr<WebViewScheduler> scheduler_;
std::unique_ptr<WebViewScheduler> scheduler_;
// TODO(lfg): This is used in order to disable compositor visibility while
// the page is still visible. This is needed until the WebView and WebWidget
......
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