Home | History | Annotate | Download | only in base
      1 // Copyright (c) 2006-2008 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 #ifndef NET_BASE_LOAD_STATES_H__
      6 #define NET_BASE_LOAD_STATES_H__
      7 
      8 namespace net {
      9 
     10 // These states correspond to the lengthy periods of time that a resource load
     11 // may be blocked and unable to make progress.
     12 enum LoadState {
     13   // This is the default state.  It corresponds to a resource load that has
     14   // either not yet begun or is idle waiting for the consumer to do something
     15   // to move things along (e.g., the consumer of an URLRequest may not have
     16   // called Read yet).
     17   LOAD_STATE_IDLE,
     18 
     19   // This state corresponds to a resource load that is blocked waiting for
     20   // access to a resource in the cache.  If multiple requests are made for the
     21   // same resource, the first request will be responsible for writing (or
     22   // updating) the cache entry and the second request will be deferred until
     23   // the first completes.  This may be done to optimize for cache reuse.
     24   LOAD_STATE_WAITING_FOR_CACHE,
     25 
     26   // This state corresponds to a resource load that is blocked waiting for a
     27   // proxy autoconfig script to return a proxy server to use.  This state may
     28   // take a while if the proxy script needs to resolve the IP address of the
     29   // host before deciding what proxy to use.
     30   LOAD_STATE_RESOLVING_PROXY_FOR_URL,
     31 
     32   // This state corresponds to a resource load that is blocked waiting for a
     33   // host name to be resolved.  This could either indicate resolution of the
     34   // origin server corresponding to the resource or to the host name of a proxy
     35   // server used to fetch the resource.
     36   LOAD_STATE_RESOLVING_HOST,
     37 
     38   // This state corresponds to a resource load that is blocked waiting for a
     39   // TCP connection (or other network connection) to be established.  HTTP
     40   // requests that reuse a keep-alive connection skip this state.
     41   LOAD_STATE_CONNECTING,
     42 
     43   // This state corresponds to a resource load that is blocked waiting to
     44   // completely upload a request to a server.  In the case of a HTTP POST
     45   // request, this state includes the period of time during which the message
     46   // body is being uploaded.
     47   LOAD_STATE_SENDING_REQUEST,
     48 
     49   // This state corresponds to a resource load that is blocked waiting for the
     50   // response to a network request.  In the case of a HTTP transaction, this
     51   // corresponds to the period after the request is sent and before all of the
     52   // response headers have been received.
     53   LOAD_STATE_WAITING_FOR_RESPONSE,
     54 
     55   // This state corresponds to a resource load that is blocked waiting for a
     56   // read to complete.  In the case of a HTTP transaction, this corresponds to
     57   // the period after the response headers have been received and before all of
     58   // the response body has been downloaded.  (NOTE: This state only applies for
     59   // an URLRequest while there is an outstanding Read operation.)
     60   LOAD_STATE_READING_RESPONSE,
     61 };
     62 
     63 }  // namespace net
     64 
     65 #endif  // NET_BASE_LOAD_STATES_H__
     66