Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3847)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItem.java

Issue 2935783002: Send microsecond resolution timestamps to Java history page so they can be sent back. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItem.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItem.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItem.java
index 708651fd7b3052bff38497b13ff93b8d9d3a2c2d..f4ad6c8c883496f7a7fc7ae4dc3dcfa86c44d844 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItem.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItem.java
@@ -18,8 +18,9 @@ public class HistoryItem extends TimedItem {
private final String mDomain;
private final String mTitle;
private final boolean mWasBlockedVisit;
- private final long mTimestamp;
- private final long[] mTimestampList;
+ private final long mLastJavaTimestamp;
+ private final long[] mJavaTimestampList;
+ private final long[] mNativeTimestampList;
private Long mStableId;
private HistoryManager mManager;
@@ -28,21 +29,23 @@ public class HistoryItem extends TimedItem {
* @param url The url for this item.
* @param domain The string to display for the item's domain.
* @param title The string to display for the item's title.
- * @param timestamps The list of timestamps for this item.
+ * @param javaTimestamps Java compatible navigation times.
+ * @param nativeTimestamps Microsecond resolution navigation times.
* @param blockedVisit Whether the visit to this item was blocked when it was attempted.
*/
- public HistoryItem(String url, String domain, String title, long[] timestamps,
- boolean blockedVisit) {
+ public HistoryItem(String url, String domain, String title, long[] javaTimestamps,
+ long[] nativeTimestamps, boolean blockedVisit) {
Theresa 2017/06/12 18:23:21 history/StubbedHistoryProvider.java and history/Br
skym 2017/06/12 19:45:12 Whoops, that explains the failing bots! Done.
mUrl = url;
mDomain = domain;
mTitle = blockedVisit ? ContextUtils.getApplicationContext().getString(
R.string.android_history_blocked_site)
: TextUtils.isEmpty(title) ? url : title;
- mTimestampList = Arrays.copyOf(timestamps, timestamps.length);
+ mJavaTimestampList = Arrays.copyOf(javaTimestamps, javaTimestamps.length);
+ mNativeTimestampList = Arrays.copyOf(nativeTimestamps, nativeTimestamps.length);
mWasBlockedVisit = blockedVisit;
// The last timestamp in the list is the most recent visit.
- mTimestamp = mTimestampList[mTimestampList.length - 1];
+ mLastJavaTimestamp = mJavaTimestampList[mJavaTimestampList.length - 1];
Theresa 2017/06/12 18:23:21 I think we can remove mJavaTimestampList and make
skym 2017/06/12 19:45:12 Done.
}
/** @return The url for this item. */
@@ -67,14 +70,15 @@ public class HistoryItem extends TimedItem {
@Override
public long getTimestamp() {
- return mTimestamp;
+ return mLastJavaTimestamp;
}
/**
- * @return An array of timestamps representing visits to this item's url.
+ * @return An array of timestamps representing visits to this item's url that matches the
+ * resolution used in native code.
*/
- public long[] getTimestamps() {
- return Arrays.copyOf(mTimestampList, mTimestampList.length);
+ public long[] getNativeTimestamps() {
+ return Arrays.copyOf(mNativeTimestampList, mNativeTimestampList.length);
}
@Override

Powered by Google App Engine
This is Rietveld 408576698