Commit 3c7b25df authored by David Maunder's avatar David Maunder Committed by Commit Bot

Acquire URL and Title off the UI Thread in CustomTabObserver

We now enforce URL and Title to be acquired on the
UI thread.

Bug: 1117396
Change-Id: I95790e2c6e7696ccbc4f2a918d9cde6ea9eba80a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2404522Reviewed-by: default avatarTommy Nyquist <nyquist@chromium.org>
Commit-Queue: David Maunder <davidjm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805897}
parent ef592f6a
......@@ -203,13 +203,15 @@ public class CustomTabObserver extends EmptyTabObserver {
if (mCustomTabsConnection == null) return;
if (!mCustomTabsConnection.shouldSendNavigationInfoForSession(mSession)) return;
if (tab.getWebContents() == null) return;
if (TextUtils.isEmpty(tab.getTitle())) return;
String title = tab.getTitle();
if (TextUtils.isEmpty(title)) return;
String urlString = tab.getUrlString();
ShareImageFileUtils.captureScreenshotForContents(tab.getWebContents(), mContentBitmapWidth,
mContentBitmapHeight, (Uri snapshotPath) -> {
if (snapshotPath == null) return;
mCustomTabsConnection.sendNavigationInfo(
mSession, tab.getUrlString(), tab.getTitle(), snapshotPath);
mSession, urlString, title, snapshotPath);
});
}
}
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