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