Commit 9ae5688f authored by David Maunder's avatar David Maunder Committed by Commit Bot

Don't store URL if the Tab is not initialized

In EditUrlSuggestionProcessor and EditUrlSuggestionUnitTest
there is an assumption that the URL can be acquired off an
uninitialized Tab. This is currently not allowed using
the UserData pattern. I recommend if the Tab is not
initialized we pull the url off the web contents and not
store on the UserData object CriticalPersistedTabData.

Bug: 1117396
Change-Id: I0223d481b7a25722f4e6bf85e78cad45060fcbd3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2410346
Commit-Queue: David Maunder <davidjm@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Reviewed-by: default avatarTommy Nyquist <nyquist@chromium.org>
Reviewed-by: default avatarTomasz Wiszkowski <ender@google.com>
Cr-Commit-Position: refs/heads/master@{#809176}
parent 26e0e548
......@@ -338,6 +338,9 @@ public class TabImpl implements Tab, TabObscuringHandler.Observer {
@CalledByNative
@Override
public GURL getUrl() {
if (!isInitialized()) {
return GURL.emptyGURL();
}
GURL url = getWebContents() != null ? getWebContents().getVisibleUrl() : GURL.emptyGURL();
// If we have a ContentView, or a NativePage, or the url is not empty, we have a WebContents
......
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