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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/precache/FailureReason.java

Issue 1751183002: Precache uses GcmNetworkManager for task scheduling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments and fixed tests Created 4 years, 8 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 unified diff | Download patch
OLDNEW
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 java.util.EnumSet; 7 import java.util.EnumSet;
8 8
9 /** A reason why prefetching failed to start. */ 9 /** A reason why prefetching failed to start. */
10 enum FailureReason { 10 enum FailureReason {
(...skipping 10 matching lines...) Expand all
21 NATIVE_SHOULD_RUN_IS_FALSE(3), 21 NATIVE_SHOULD_RUN_IS_FALSE(3),
22 22
23 /** DeviceState#isPowerConnected() returns false. */ 23 /** DeviceState#isPowerConnected() returns false. */
24 NO_POWER(4), 24 NO_POWER(4),
25 25
26 /** DeviceState#isWifiAvailable() returns false. */ 26 /** DeviceState#isWifiAvailable() returns false. */
27 NO_WIFI(5), 27 NO_WIFI(5),
28 28
29 // Deprecated: SCREEN_ON(6). 29 // Deprecated: SCREEN_ON(6).
30 30
31 /** PrecacheServiceLauncher#timeSinceLastPrecacheMs() is too recent. */ 31 // Deprecated: NOT_ENOUGH_TIME_SINCE_LAST_PRECACHE(7),
32 NOT_ENOUGH_TIME_SINCE_LAST_PRECACHE(7),
33 32
34 /** PrecacheService#isPrecaching() returns true. */ 33 /** PrecacheController#isPrecaching() returns true. */
35 CURRENTLY_PRECACHING(8); 34 CURRENTLY_PRECACHING(8);
36 35
37 /** Returns the set of reasons as a bit vector. */ 36 /** Returns the set of reasons as a bit vector. */
38 static int bitValue(EnumSet<FailureReason> reasons) { 37 static int bitValue(EnumSet<FailureReason> reasons) {
39 int value = 0; 38 int value = 0;
40 for (FailureReason reason : reasons) value |= 1 << reason.mPosition; 39 for (FailureReason reason : reasons) value |= 1 << reason.mPosition;
41 return value; 40 return value;
42 } 41 }
43 42
44 FailureReason(int position) { 43 FailureReason(int position) {
45 this.mPosition = position; 44 this.mPosition = position;
46 } 45 }
47 46
48 /** The bit position, to be set when computing the bit vector. */ 47 /** The bit position, to be set when computing the bit vector. */
49 private final int mPosition; 48 private final int mPosition;
50 } 49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698