Page Speed Optimization Libraries  1.12.34.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
net_instaweb::UrlAsyncFetcher Class Referenceabstract

#include "url_async_fetcher.h"

Inheritance diagram for net_instaweb::UrlAsyncFetcher:
net_instaweb::AddHeadersFetcher net_instaweb::BackgroundFetchCheckingUrlAsyncFetcher net_instaweb::CacheUrlAsyncFetcher net_instaweb::CountingUrlAsyncFetcher net_instaweb::ExternalUrlFetcher net_instaweb::HttpDumpUrlAsyncWriter net_instaweb::HttpDumpUrlFetcher net_instaweb::LoopbackRouteFetcher net_instaweb::MockUrlFetcher net_instaweb::ProxyInterface net_instaweb::RateControllingUrlAsyncFetcher net_instaweb::ReflectingTestFetcher net_instaweb::SerfUrlAsyncFetcher net_instaweb::SimulatedDelayFetcher net_instaweb::UrlAsyncFetcherStats net_instaweb::UserAgentSensitiveTestFetcher net_instaweb::WaitUrlAsyncFetcher

Public Member Functions

virtual void Fetch (const GoogleString &url, MessageHandler *message_handler, AsyncFetch *fetch)=0
 
virtual bool SupportsHttps () const
 
virtual int64 timeout_ms ()
 
virtual void ShutDown ()
 
void set_fetch_with_gzip (bool x)
 
bool fetch_with_gzip () const
 
AsyncFetchEnableInflation (AsyncFetch *fetch) const
 

Static Public Attributes

static const int64 kUnspecifiedTimeout
 

Protected Member Functions

 UrlAsyncFetcher ()
 

Detailed Description

UrlAsyncFetcher is an interface for asynchronously fetching URLs. The results of a fetch are asynchronously passed back to the callbacks in the supplied AsyncFetch object.

Constructor & Destructor Documentation

net_instaweb::UrlAsyncFetcher::UrlAsyncFetcher ( )
inlineprotected

Put this in protected to make sure nobody constructs this class except for subclasses.

Member Function Documentation

AsyncFetch* net_instaweb::UrlAsyncFetcher::EnableInflation ( AsyncFetch fetch) const

Returns a new InflatingFetch to handle auto-inflating the response if needed.

virtual void net_instaweb::UrlAsyncFetcher::Fetch ( const GoogleString url,
MessageHandler message_handler,
AsyncFetch fetch 
)
pure virtual

Asynchronously fetch a URL, set the response headers and stream the contents to fetch and call fetch->Done() when the fetch finishes.

There is an unchecked contract that response_headers are set before the response_writer or callback are used. Caution, several implementations do not satisfy this contract (but should).

Todo:

TODO(sligocki): GoogleString -> GoogleUrl or at least StringPiece.

TODO(sligocki): Include the URL in the fetch, like the request headers.

Implemented in net_instaweb::BackgroundFetchCheckingUrlAsyncFetcher, net_instaweb::SerfUrlAsyncFetcher, net_instaweb::CacheUrlAsyncFetcher, net_instaweb::HttpDumpUrlFetcher, net_instaweb::MockUrlFetcher, net_instaweb::SimulatedDelayFetcher, net_instaweb::UrlAsyncFetcherStats, net_instaweb::ProxyInterface, net_instaweb::HttpDumpUrlAsyncWriter, net_instaweb::RateControllingUrlAsyncFetcher, net_instaweb::LoopbackRouteFetcher, net_instaweb::CountingUrlAsyncFetcher, net_instaweb::WaitUrlAsyncFetcher, net_instaweb::ExternalUrlFetcher, net_instaweb::ReflectingTestFetcher, net_instaweb::AddHeadersFetcher, and net_instaweb::UserAgentSensitiveTestFetcher.

void net_instaweb::UrlAsyncFetcher::set_fetch_with_gzip ( bool  x)
inline

Always requests content from servers using gzip. If the request headers do not accept that encoding, then it will be decompressed while streaming.

virtual void net_instaweb::UrlAsyncFetcher::ShutDown ( )
virtual

Stops all active fetches and prevents further fetches from starting, calling back to ->Done(false).

Base-class implementation is empty for forward compatibility.

Reimplemented in net_instaweb::SerfUrlAsyncFetcher, net_instaweb::UrlAsyncFetcherStats, and net_instaweb::RateControllingUrlAsyncFetcher.

virtual bool net_instaweb::UrlAsyncFetcher::SupportsHttps ( ) const
inlinevirtual
virtual int64 net_instaweb::UrlAsyncFetcher::timeout_ms ( )
inlinevirtual

Returns a maximum time that we will allow fetches to take, or kUnspecifiedTimeout (the default) if we don't promise to timeout fetches.

Reimplemented in net_instaweb::SerfUrlAsyncFetcher, and net_instaweb::UrlAsyncFetcherStats.


The documentation for this class was generated from the following file: