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 3// found in the LICENSE file. 4 5// This is the list of load states and their values. For the enum values, 6// include the file "net/base/load_states.h". 7// 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 10// map a load flag value to its symbolic name). 11 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 14// to move things along (e.g., the consumer of an URLRequest may not have 15// called Read yet). 16LOAD_STATE(IDLE) 17 18// 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, 20// 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. 22LOAD_STATE(WAITING_FOR_STALLED_SOCKET_POOL) 23 24// 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, 26// except those that correspond to a pending new connection. 27LOAD_STATE(WAITING_FOR_AVAILABLE_SOCKET) 28 29// 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 31// delegate should set a load state parameter on the URLRequest describing 32// the nature of the delay (i.e. "Waiting for <description given by 33// delegate>"). 34LOAD_STATE(WAITING_FOR_DELEGATE) 35 36// 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 38// same resource, the first request will be responsible for writing (or 39// 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. 41LOAD_STATE(WAITING_FOR_CACHE) 42 43// This state corresponds to a resource load that is blocked waiting for 44// access to a resource in the AppCache. 45// 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. 47LOAD_STATE(WAITING_FOR_APPCACHE) 48 49// This state corresponds to a resource being blocked waiting for the 50// PAC script to be downloaded. 51LOAD_STATE(DOWNLOADING_PROXY_SCRIPT) 52 53// This state corresponds to a resource load that is blocked waiting for a 54// proxy autoconfig script to return a proxy server to use. 55LOAD_STATE(RESOLVING_PROXY_FOR_URL) 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, but that proxy 59// script is busy resolving the IP address of a host. 60LOAD_STATE(RESOLVING_HOST_IN_PROXY_SCRIPT) 61 62// This state indicates that we're in the process of establishing a tunnel 63// through the proxy server. 64LOAD_STATE(ESTABLISHING_PROXY_TUNNEL) 65 66// 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 68// origin server corresponding to the resource or to the host name of a proxy 69// server used to fetch the resource. 70LOAD_STATE(RESOLVING_HOST) 71 72// This state corresponds to a resource load that is blocked waiting for a 73// TCP connection (or other network connection) to be established. HTTP 74// requests that reuse a keep-alive connection skip this state. 75LOAD_STATE(CONNECTING) 76 77// This state corresponds to a resource load that is blocked waiting for the 78// SSL handshake to complete. 79LOAD_STATE(SSL_HANDSHAKE) 80 81// 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 83// request, this state includes the period of time during which the message 84// body is being uploaded. 85LOAD_STATE(SENDING_REQUEST) 86 87// 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 89// corresponds to the period after the request is sent and before all of the 90// response headers have been received. 91LOAD_STATE(WAITING_FOR_RESPONSE) 92 93// 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 95// 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 97// an URLRequest while there is an outstanding Read operation.) 98LOAD_STATE(READING_RESPONSE) 99