Public Member Functions | |
CountingUrlAsyncFetcher (UrlAsyncFetcher *fetcher) | |
void | set_fetcher (UrlAsyncFetcher *fetcher) |
virtual bool | SupportsHttps () const |
virtual bool | StreamingFetch (const GoogleString &url, const RequestHeaders &request_headers, ResponseHeaders *response_headers, Writer *fetched_content_writer, MessageHandler *message_handler, Callback *callback) |
int | fetch_count () const |
int | byte_count () const |
int | failure_count () const |
void | Clear () |
Friends | |
class | Fetch |
virtual bool net_instaweb::CountingUrlAsyncFetcher::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.
Default implementation uses Fetch. So derivative classes only need to define one of these functions.
Reimplemented from net_instaweb::UrlAsyncFetcher.
virtual bool net_instaweb::CountingUrlAsyncFetcher::SupportsHttps | ( | ) | const [inline, virtual] |
Determine if the fetcher supports fetching using HTTPS. By default we assume a fetcher can.
Reimplemented from net_instaweb::UrlAsyncFetcher.