net_instaweb::UrlAsyncFetcher Class Reference

Inheritance diagram for net_instaweb::UrlAsyncFetcher:
net_instaweb::CacheUrlAsyncFetcher net_instaweb::CountingUrlAsyncFetcher net_instaweb::FetcherTest::MockAsyncFetcher net_instaweb::HttpDumpUrlAsyncWriter net_instaweb::ProxyInterface net_instaweb::RateControllingUrlAsyncFetcher net_instaweb::UrlPollableAsyncFetcher net_instaweb::WaitUrlAsyncFetcher

List of all members.

Classes

class  Callback

Public Member Functions

virtual bool SupportsHttps () const
virtual bool StreamingFetch (const GoogleString &url, const RequestHeaders &request_headers, ResponseHeaders *response_headers, Writer *response_writer, MessageHandler *message_handler, Callback *callback)
virtual bool Fetch (const GoogleString &url, MessageHandler *message_handler, AsyncFetch *fetch)
virtual bool ConditionalFetch (const GoogleString &url, int64 if_modified_since_ms, const RequestHeaders &request_headers, ResponseHeaders *response_headers, Writer *response_writer, MessageHandler *message_handler, Callback *callback)
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
static const char kStatisticsGroup []
 Default statistics group name.

Protected Member Functions

 UrlAsyncFetcher ()

Constructor & Destructor Documentation

net_instaweb::UrlAsyncFetcher::UrlAsyncFetcher (  )  [inline, protected]

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


Member Function Documentation

virtual bool net_instaweb::UrlAsyncFetcher::ConditionalFetch ( const GoogleString url,
int64  if_modified_since_ms,
const RequestHeaders request_headers,
ResponseHeaders response_headers,
Writer response_writer,
MessageHandler message_handler,
Callback callback 
) [virtual]

Like StreamingFetch, but sends out a conditional GET that will not return the contents if they have not been modified since if_modified_since_ms.

Todo:
TODO(sligocki): GoogleString -> GoogleUrl
AsyncFetch* net_instaweb::UrlAsyncFetcher::EnableInflation ( AsyncFetch fetch  )  const

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

virtual bool net_instaweb::UrlAsyncFetcher::Fetch ( const GoogleString url,
MessageHandler message_handler,
AsyncFetch fetch 
) [virtual]

Fetch with AsyncFetch interface.

Default implementation uses StreamingFetch method and calls HeadersComplete right before the first call to Write, Flush or Done.

Future implementations ought to call HeadersComplete directly.

Return value is the same as StreamingFetch. (Returns true iff callback has already been called by the time Fetch returns.)

Todo:
TODO(sligocki): Stick all other params into AsyncFetch object (url, request_headers, response_headers, message_handler).

Reimplemented in net_instaweb::SerfUrlAsyncFetcher, net_instaweb::ProxyInterface, net_instaweb::CacheUrlAsyncFetcher, and net_instaweb::RateControllingUrlAsyncFetcher.

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.

virtual bool net_instaweb::UrlAsyncFetcher::StreamingFetch ( const GoogleString url,
const RequestHeaders request_headers,
ResponseHeaders response_headers,
Writer response_writer,
MessageHandler message_handler,
Callback callback 
) [virtual]

Fetch a URL, set response_headers and stream the output to response_writer. response_headers and response_writer must be valid until callback->Done().

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).

This function returns true if the request was immediately satisfied. In either case, the callback will be called with the completion status, so it's safe to ignore the return value.

Todo:
TODO(sligocki): GoogleString -> GoogleUrl

Default implementation uses Fetch. So derivative classes only need to define one of these functions.

Reimplemented in net_instaweb::CountingUrlAsyncFetcher, net_instaweb::FakeUrlAsyncFetcher, net_instaweb::FetcherTest::MockAsyncFetcher, net_instaweb::HttpDumpUrlAsyncWriter, and net_instaweb::WaitUrlAsyncFetcher.

virtual bool net_instaweb::UrlAsyncFetcher::SupportsHttps (  )  const [inline, virtual]
virtual int64 net_instaweb::UrlAsyncFetcher::timeout_ms (  )  [inline, virtual]

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.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Tue May 29 16:33:55 2012 for Page Speed Optimization Libraries by  doxygen 1.6.3