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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPacker.java

Issue 2037213002: Switch OfflinePages UMA to use currentTimeMillis, persist task (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/offlinepages/TaskExtrasPacker.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPacker.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPacker.java
new file mode 100644
index 0000000000000000000000000000000000000000..88ed872eb6630060b452fbb7e7bce0124dab93cd
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPacker.java
@@ -0,0 +1,25 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.offlinepages;
+
+import android.os.Bundle;
+
+/**
+ * Class to put our custom task information into the task bundle.
+ */
+public class TaskExtrasPacker {
+ /** Bundle key for the timestamp in milliseconds when the request started. */
+ public static final String DATE_TAG = "Date";
dewittj 2016/06/03 22:02:46 maybe use more descriptive names here, such as TAS
dougarnett 2016/06/03 22:45:50 +1 - think I suggested just SCHEDULED_TIME_TAG or
Pete Williamson 2016/06/03 23:42:11 Oops, I thought I deleted this file from the chang
+
+ /** Puts current time into the input bundle. */
+ public static void packTimeInBundle(Bundle bundle) {
+ bundle.putLong(DATE_TAG, System.currentTimeMillis());
+ }
+
+ /** Extracts the time we put into the bundle. */
+ public static long unpackTimeFromBundle(Bundle bundle) {
+ return bundle.getLong(DATE_TAG);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698