| 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 // This is the list of load states and their values. For the enum values, | 5 // This is the list of load states and their values. For the enum values, |
| 6 // include the file "net/base/load_states.h". | 6 // include the file "net/base/load_states.h". |
| 7 // | 7 // |
| 8 // Here we define the values using a macro LOAD_STATE, so it can be | 8 // Here we define the values using a macro LOAD_STATE, so it can be |
| 9 // expanded differently in some places (for example, to automatically | 9 // expanded differently in some places (for example, to automatically |
| 10 // map a load flag value to its symbolic name). | 10 // map a load flag value to its symbolic name). |
| 11 | 11 |
| 12 // This is the default state. It corresponds to a resource load that has | 12 // This is the default state. It corresponds to a resource load that has |
| 13 // either not yet begun or is idle waiting for the consumer to do something | 13 // either not yet begun or is idle waiting for the consumer to do something |
| 14 // to move things along (e.g., the consumer of an URLRequest may not have | 14 // to move things along (e.g., the consumer of an URLRequest may not have |
| 15 // called Read yet). | 15 // called Read yet). |
| 16 LOAD_STATE(IDLE, 0) | 16 LOAD_STATE(IDLE, 0) |
| 17 | 17 |
| 18 // This state corresponds to a resource load that is throttled by the |
| 19 // network layer waiting for some other resource load or loads to complete. |
| 20 LOAD_STATE(THROTTLED, 1) |
| 21 |
| 18 // When a socket pool group is below the maximum number of sockets allowed per | 22 // When a socket pool group is below the maximum number of sockets allowed per |
| 19 // group, but a new socket cannot be created due to the per-pool socket limit, | 23 // group, but a new socket cannot be created due to the per-pool socket limit, |
| 20 // this state is returned by all requests for the group waiting on an idle | 24 // this state is returned by all requests for the group waiting on an idle |
| 21 // connection, except those that may be serviced by a pending new connection. | 25 // connection, except those that may be serviced by a pending new connection. |
| 22 LOAD_STATE(WAITING_FOR_STALLED_SOCKET_POOL, 1) | 26 LOAD_STATE(WAITING_FOR_STALLED_SOCKET_POOL, 2) |
| 23 | 27 |
| 24 // When a socket pool group has reached the maximum number of sockets allowed | 28 // When a socket pool group has reached the maximum number of sockets allowed |
| 25 // per group, this state is returned for all requests that don't have a socket, | 29 // per group, this state is returned for all requests that don't have a socket, |
| 26 // except those that correspond to a pending new connection. | 30 // except those that correspond to a pending new connection. |
| 27 LOAD_STATE(WAITING_FOR_AVAILABLE_SOCKET, 2) | 31 LOAD_STATE(WAITING_FOR_AVAILABLE_SOCKET, 3) |
| 28 | 32 |
| 29 // This state indicates that the URLRequest delegate has chosen to block this | 33 // This state indicates that the URLRequest delegate has chosen to block this |
| 30 // request before it was sent over the network. When in this state, the | 34 // request before it was sent over the network. When in this state, the |
| 31 // delegate should set a load state parameter on the URLRequest describing | 35 // delegate should set a load state parameter on the URLRequest describing |
| 32 // the nature of the delay (i.e. "Waiting for <description given by | 36 // the nature of the delay (i.e. "Waiting for <description given by |
| 33 // delegate>"). | 37 // delegate>"). |
| 34 LOAD_STATE(WAITING_FOR_DELEGATE, 3) | 38 LOAD_STATE(WAITING_FOR_DELEGATE, 4) |
| 35 | 39 |
| 36 // This state corresponds to a resource load that is blocked waiting for | 40 // This state corresponds to a resource load that is blocked waiting for |
| 37 // access to a resource in the cache. If multiple requests are made for the | 41 // access to a resource in the cache. If multiple requests are made for the |
| 38 // same resource, the first request will be responsible for writing (or | 42 // same resource, the first request will be responsible for writing (or |
| 39 // updating) the cache entry and the second request will be deferred until | 43 // updating) the cache entry and the second request will be deferred until |
| 40 // the first completes. This may be done to optimize for cache reuse. | 44 // the first completes. This may be done to optimize for cache reuse. |
| 41 LOAD_STATE(WAITING_FOR_CACHE, 4) | 45 LOAD_STATE(WAITING_FOR_CACHE, 5) |
| 42 | 46 |
| 43 // This state corresponds to a resource load that is blocked waiting for | 47 // This state corresponds to a resource load that is blocked waiting for |
| 44 // access to a resource in the AppCache. | 48 // access to a resource in the AppCache. |
| 45 // Note: This is a layering violation, but being the only one it's not that | 49 // Note: This is a layering violation, but being the only one it's not that |
| 46 // bad. TODO(rvargas): Reconsider what to do if we need to add more. | 50 // bad. TODO(rvargas): Reconsider what to do if we need to add more. |
| 47 LOAD_STATE(WAITING_FOR_APPCACHE, 5) | 51 LOAD_STATE(WAITING_FOR_APPCACHE, 6) |
| 48 | 52 |
| 49 // This state corresponds to a resource being blocked waiting for the | 53 // This state corresponds to a resource being blocked waiting for the |
| 50 // PAC script to be downloaded. | 54 // PAC script to be downloaded. |
| 51 LOAD_STATE(DOWNLOADING_PROXY_SCRIPT, 6) | 55 LOAD_STATE(DOWNLOADING_PROXY_SCRIPT, 7) |
| 52 | 56 |
| 53 // This state corresponds to a resource load that is blocked waiting for a | 57 // This state corresponds to a resource load that is blocked waiting for a |
| 54 // proxy autoconfig script to return a proxy server to use. | 58 // proxy autoconfig script to return a proxy server to use. |
| 55 LOAD_STATE(RESOLVING_PROXY_FOR_URL, 7) | 59 LOAD_STATE(RESOLVING_PROXY_FOR_URL, 8) |
| 56 | 60 |
| 57 // This state corresponds to a resource load that is blocked waiting for a | 61 // This state corresponds to a resource load that is blocked waiting for a |
| 58 // proxy autoconfig script to return a proxy server to use, but that proxy | 62 // proxy autoconfig script to return a proxy server to use, but that proxy |
| 59 // script is busy resolving the IP address of a host. | 63 // script is busy resolving the IP address of a host. |
| 60 LOAD_STATE(RESOLVING_HOST_IN_PROXY_SCRIPT, 8) | 64 LOAD_STATE(RESOLVING_HOST_IN_PROXY_SCRIPT, 9) |
| 61 | 65 |
| 62 // This state indicates that we're in the process of establishing a tunnel | 66 // This state indicates that we're in the process of establishing a tunnel |
| 63 // through the proxy server. | 67 // through the proxy server. |
| 64 LOAD_STATE(ESTABLISHING_PROXY_TUNNEL, 9) | 68 LOAD_STATE(ESTABLISHING_PROXY_TUNNEL, 10) |
| 65 | 69 |
| 66 // This state corresponds to a resource load that is blocked waiting for a | 70 // This state corresponds to a resource load that is blocked waiting for a |
| 67 // host name to be resolved. This could either indicate resolution of the | 71 // host name to be resolved. This could either indicate resolution of the |
| 68 // origin server corresponding to the resource or to the host name of a proxy | 72 // origin server corresponding to the resource or to the host name of a proxy |
| 69 // server used to fetch the resource. | 73 // server used to fetch the resource. |
| 70 LOAD_STATE(RESOLVING_HOST, 10) | 74 LOAD_STATE(RESOLVING_HOST, 11) |
| 71 | 75 |
| 72 // This state corresponds to a resource load that is blocked waiting for a | 76 // This state corresponds to a resource load that is blocked waiting for a |
| 73 // TCP connection (or other network connection) to be established. HTTP | 77 // TCP connection (or other network connection) to be established. HTTP |
| 74 // requests that reuse a keep-alive connection skip this state. | 78 // requests that reuse a keep-alive connection skip this state. |
| 75 LOAD_STATE(CONNECTING, 11) | 79 LOAD_STATE(CONNECTING, 12) |
| 76 | 80 |
| 77 // This state corresponds to a resource load that is blocked waiting for the | 81 // This state corresponds to a resource load that is blocked waiting for the |
| 78 // SSL handshake to complete. | 82 // SSL handshake to complete. |
| 79 LOAD_STATE(SSL_HANDSHAKE, 12) | 83 LOAD_STATE(SSL_HANDSHAKE, 13) |
| 80 | 84 |
| 81 // This state corresponds to a resource load that is blocked waiting to | 85 // This state corresponds to a resource load that is blocked waiting to |
| 82 // completely upload a request to a server. In the case of a HTTP POST | 86 // completely upload a request to a server. In the case of a HTTP POST |
| 83 // request, this state includes the period of time during which the message | 87 // request, this state includes the period of time during which the message |
| 84 // body is being uploaded. | 88 // body is being uploaded. |
| 85 LOAD_STATE(SENDING_REQUEST, 13) | 89 LOAD_STATE(SENDING_REQUEST, 14) |
| 86 | 90 |
| 87 // This state corresponds to a resource load that is blocked waiting for the | 91 // This state corresponds to a resource load that is blocked waiting for the |
| 88 // response to a network request. In the case of a HTTP transaction, this | 92 // response to a network request. In the case of a HTTP transaction, this |
| 89 // corresponds to the period after the request is sent and before all of the | 93 // corresponds to the period after the request is sent and before all of the |
| 90 // response headers have been received. | 94 // response headers have been received. |
| 91 LOAD_STATE(WAITING_FOR_RESPONSE, 14) | 95 LOAD_STATE(WAITING_FOR_RESPONSE, 15) |
| 92 | 96 |
| 93 // This state corresponds to a resource load that is blocked waiting for a | 97 // This state corresponds to a resource load that is blocked waiting for a |
| 94 // read to complete. In the case of a HTTP transaction, this corresponds to | 98 // read to complete. In the case of a HTTP transaction, this corresponds to |
| 95 // the period after the response headers have been received and before all of | 99 // the period after the response headers have been received and before all of |
| 96 // the response body has been downloaded. (NOTE: This state only applies for | 100 // the response body has been downloaded. (NOTE: This state only applies for |
| 97 // an URLRequest while there is an outstanding Read operation.) | 101 // an URLRequest while there is an outstanding Read operation.) |
| 98 LOAD_STATE(READING_RESPONSE, 15) | 102 LOAD_STATE(READING_RESPONSE, 16) |
| OLD | NEW |