Commit 4260cede authored by Daniel Cheng's avatar Daniel Cheng Committed by Commit Bot

blink::WebViewImpl: Use Unretained instead of WeakPtr for mojo::Remote calls.

mojo::Remote already handles cancellation, so it's not necessary to have
a redundant layer of cancellation with WeakPtr.

Change-Id: Icda83b38d04eb5ba4a914c21933524a669b617ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2490441Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819492}
parent ff35cf96
......@@ -3491,16 +3491,18 @@ void WebViewImpl::UpdateTargetURL(const WebURL& url,
}
void WebViewImpl::SendUpdatedTargetURLToBrowser(const KURL& target_url) {
// Note: WTF::Unretained() usage below is safe, since `this` owns both
// `mojo::Remote` objects.
if (GetPage()->MainFrame()->IsLocalFrame()) {
DCHECK(local_main_frame_host_remote_);
local_main_frame_host_remote_->UpdateTargetURL(
target_url, WTF::Bind(&WebViewImpl::TargetURLUpdatedInBrowser,
weak_ptr_factory_.GetWeakPtr()));
WTF::Unretained(this)));
} else {
DCHECK(remote_main_frame_host_remote_);
remote_main_frame_host_remote_->UpdateTargetURL(
target_url, WTF::Bind(&WebViewImpl::TargetURLUpdatedInBrowser,
weak_ptr_factory_.GetWeakPtr()));
WTF::Unretained(this)));
}
}
......
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