OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef NET_BASE_REQUEST_PRIORITY_H_ | 5 #ifndef NET_BASE_REQUEST_PRIORITY_H_ |
6 #define NET_BASE_REQUEST_PRIORITY_H_ | 6 #define NET_BASE_REQUEST_PRIORITY_H_ |
7 | 7 |
8 #include "net/base/net_export.h" | 8 #include "net/base/net_export.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
11 | 11 |
12 // Prioritization used in various parts of the networking code such | 12 // Prioritization used in various parts of the networking code such |
13 // as connection prioritization and resource loading prioritization. | 13 // as connection prioritization and resource loading prioritization. |
14 // A Java counterpart will be generated for this enum. | 14 // A Java counterpart will be generated for this enum. |
15 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net | 15 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net |
16 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: RequestPriority | 16 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: RequestPriority |
17 // GENERATED_JAVA_PREFIX_TO_STRIP: | 17 // GENERATED_JAVA_PREFIX_TO_STRIP: |
18 enum RequestPriority { | 18 enum RequestPriority { |
19 IDLE = 0, | 19 THROTTLED = 0, // Used to signal that resources |
20 MINIMUM_PRIORITY = IDLE, | 20 // should be reserved for following |
| 21 // requests (i.e. that higher priority |
| 22 // following requests are expected). |
| 23 MINIMUM_PRIORITY = THROTTLED, |
| 24 IDLE, // Default "as resources available" level. |
21 LOWEST, | 25 LOWEST, |
22 DEFAULT_PRIORITY = LOWEST, | 26 DEFAULT_PRIORITY = LOWEST, |
23 LOW, | 27 LOW, |
24 MEDIUM, | 28 MEDIUM, |
25 HIGHEST, | 29 HIGHEST, |
26 MAXIMUM_PRIORITY = HIGHEST, | 30 MAXIMUM_PRIORITY = HIGHEST, |
27 }; | 31 }; |
28 | 32 |
29 // For simplicity, one can assume that one can index into array of | 33 // For simplicity, one can assume that one can index into array of |
30 // NUM_PRIORITIES elements with a RequestPriority (i.e., | 34 // NUM_PRIORITIES elements with a RequestPriority (i.e., |
31 // MINIMUM_PRIORITY == 0). | 35 // MINIMUM_PRIORITY == 0). |
32 enum RequestPrioritySize { | 36 enum RequestPrioritySize { |
33 NUM_PRIORITIES = MAXIMUM_PRIORITY + 1, | 37 NUM_PRIORITIES = MAXIMUM_PRIORITY + 1, |
34 }; | 38 }; |
35 | 39 |
36 NET_EXPORT const char* RequestPriorityToString(RequestPriority priority); | 40 NET_EXPORT const char* RequestPriorityToString(RequestPriority priority); |
37 | 41 |
38 } // namespace net | 42 } // namespace net |
39 | 43 |
40 #endif // NET_BASE_REQUEST_PRIORITY_H_ | 44 #endif // NET_BASE_REQUEST_PRIORITY_H_ |
OLD | NEW |