| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.precache; | 5 package org.chromium.chrome.browser.precache; |
| 6 | 6 |
| 7 import android.content.BroadcastReceiver; | 7 import android.content.BroadcastReceiver; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.content.Intent; | 9 import android.content.Intent; |
| 10 import android.content.IntentFilter; | 10 import android.content.IntentFilter; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 import org.chromium.base.ContextUtils; | 22 import org.chromium.base.ContextUtils; |
| 23 import org.chromium.base.Log; | 23 import org.chromium.base.Log; |
| 24 import org.chromium.base.VisibleForTesting; | 24 import org.chromium.base.VisibleForTesting; |
| 25 import org.chromium.base.library_loader.LibraryLoader; | 25 import org.chromium.base.library_loader.LibraryLoader; |
| 26 import org.chromium.base.metrics.RecordHistogram; | 26 import org.chromium.base.metrics.RecordHistogram; |
| 27 import org.chromium.base.metrics.RecordUserAction; | 27 import org.chromium.base.metrics.RecordUserAction; |
| 28 import org.chromium.chrome.browser.ChromeBackgroundService; | 28 import org.chromium.chrome.browser.ChromeBackgroundService; |
| 29 import org.chromium.chrome.browser.util.NonThreadSafe; | 29 import org.chromium.chrome.browser.util.NonThreadSafe; |
| 30 import org.chromium.components.precache.DeviceState; | 30 import org.chromium.components.precache.DeviceState; |
| 31 import org.chromium.sync.ModelType; | 31 import org.chromium.components.sync.ModelType; |
| 32 | 32 |
| 33 import java.util.ArrayDeque; | 33 import java.util.ArrayDeque; |
| 34 import java.util.Arrays; | 34 import java.util.Arrays; |
| 35 import java.util.Collections; | 35 import java.util.Collections; |
| 36 import java.util.EnumSet; | 36 import java.util.EnumSet; |
| 37 import java.util.HashSet; | 37 import java.util.HashSet; |
| 38 import java.util.Queue; | 38 import java.util.Queue; |
| 39 import java.util.Set; | 39 import java.util.Set; |
| 40 | 40 |
| 41 /** | 41 /** |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 int interval_mins = | 537 int interval_mins = |
| 538 (int) ((current_start_time_ms - previous_start_time_ms) / (1
000 * 60)); | 538 (int) ((current_start_time_ms - previous_start_time_ms) / (1
000 * 60)); |
| 539 RecordHistogram.recordCustomCountHistogram( | 539 RecordHistogram.recordCustomCountHistogram( |
| 540 "Precache.PeriodicTaskInterval", interval_mins, 1, 10000, 50
); | 540 "Precache.PeriodicTaskInterval", interval_mins, 1, 10000, 50
); |
| 541 } | 541 } |
| 542 prefs.edit() | 542 prefs.edit() |
| 543 .putLong(PREF_PRECACHE_PERIODIC_TASK_START_TIME_MS, current_star
t_time_ms) | 543 .putLong(PREF_PRECACHE_PERIODIC_TASK_START_TIME_MS, current_star
t_time_ms) |
| 544 .apply(); | 544 .apply(); |
| 545 } | 545 } |
| 546 } | 546 } |
| OLD | NEW |