Commit 17f0f733 authored by David Maunder's avatar David Maunder Committed by Commit Bot

Return INVALID_TIMESTMP on PseudoTab#getTimestamp for uninitialized Tab

If a Tab is uninitialized we should not try to access its timestamp
(as we don't allow tab attributes to be acquired on an uninitialized
Tab). Instead we should return invalid timestamp.

Bug: 1117396
Change-Id: I0f81ec8705ec2867ce7d610f19df85ef559493db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2411148
Commit-Queue: David Maunder <davidjm@chromium.org>
Reviewed-by: default avatarYusuf Ozuysal <yusufo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808717}
parent 149ae9af
......@@ -213,6 +213,9 @@ public class PseudoTab {
public long getTimestampMillis() {
assert mTab != null
&& mTab.get() != null : "getTimestampMillis can only be used with real tabs";
if (!mTab.get().isInitialized()) {
return CriticalPersistedTabData.INVALID_TIMESTAMP;
}
return CriticalPersistedTabData.from(mTab.get()).getTimestampMillis();
}
......
......@@ -37,7 +37,7 @@ public class CriticalPersistedTabData extends PersistedTabData {
CriticalPersistedTabData.class;
private static final int UNSPECIFIED_THEME_COLOR = Color.TRANSPARENT;
private static final long INVALID_TIMESTAMP = -1;
public static final long INVALID_TIMESTAMP = -1;
/**
* Title of the ContentViews webpage.
......
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