Chromium Code Reviews| 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); |
| + } |
| +} |