Page Speed Optimization Libraries
1.7.30.4
|
Public Member Functions | |
CountingUrlAsyncFetcher (UrlAsyncFetcher *fetcher) | |
void | set_fetcher (UrlAsyncFetcher *fetcher) |
virtual bool | SupportsHttps () const |
virtual void | Fetch (const GoogleString &url, MessageHandler *message_handler, AsyncFetch *fetch) |
int | fetch_count () const |
number of completed fetches. | |
int | fetch_start_count () const |
number of started fetches | |
int | byte_count () const |
int | failure_count () const |
GoogleString | most_recent_fetched_url () const |
void | Clear () |
Friends | |
class | CountingFetch |
net_instaweb::CountingUrlAsyncFetcher::CountingUrlAsyncFetcher | ( | UrlAsyncFetcher * | fetcher | ) | [inline, explicit] |
virtual void net_instaweb::CountingUrlAsyncFetcher::Fetch | ( | const GoogleString & | url, |
MessageHandler * | message_handler, | ||
AsyncFetch * | fetch | ||
) | [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(sligocki): GoogleString -> GoogleUrl or at least StringPiece.
TODO(sligocki): Include the URL in the fetch, like the request headers.
Implements 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.