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

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

Issue 2030773002: Add unit tests for the Background Scheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR feedback per DougArnett 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";
dougarnett 2016/06/03 21:51:53 We may want to end up naming with more meaningful
Pete Williamson 2016/06/03 23:52:29 Done.
+
+ /** 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