Page Speed Optimization Libraries
1.6.29.3
|
#include "resource_fetch.h"
Static Public Member Functions | |
static void | Start (const GoogleUrl &url, RewriteOptions *custom_options, bool using_spdy, ServerContext *server_context, AsyncFetch *async_fetch) |
static bool | BlockingFetch (const GoogleUrl &url, ServerContext *server_context, RewriteDriver *driver, SyncFetcherAdapterCallback *async_fetch) |
static RewriteDriver * | GetDriver (const GoogleUrl &url, RewriteOptions *custom_options, ServerContext *server_context, const RequestContextPtr &request_ctx) |
Protected Member Functions | |
virtual void | HandleHeadersComplete () |
Protected interface from AsyncFetch. | |
virtual void | HandleDone (bool success) |
Manages a single fetch of a pagespeed rewritten resource. Fetch is initialized by calling ResourceFetch::Start()
static bool net_instaweb::ResourceFetch::BlockingFetch | ( | const GoogleUrl & | url, |
ServerContext * | server_context, | ||
RewriteDriver * | driver, | ||
SyncFetcherAdapterCallback * | async_fetch | ||
) | [static] |
Fetch a pagespeed resource in a blocking fashion. Response will be streamed back to async_fetch, but this function will not return until fetch has completed.
You'll probably want to use GetDriver to construct the driver passed in to this method, in order to properly apply experiment info encoded into the URL into settings.
Returns true iff the fetch succeeded and thus response headers and contents were sent to async_fetch.
static RewriteDriver* net_instaweb::ResourceFetch::GetDriver | ( | const GoogleUrl & | url, |
RewriteOptions * | custom_options, | ||
ServerContext * | server_context, | ||
const RequestContextPtr & | request_ctx | ||
) | [static] |
Creates a rewrite_driver suitable for passing to BlockingFetch (or StartWithDriver) incorporating any experiment settings. If custom_options it not NULL, takes ownership of it and and can mutate it; otherwise the driver will be made using driver_pool with matching options as the pre-experiment starting point.
Exactly one of custom_options and driver_pool must be non-NULL.
static void net_instaweb::ResourceFetch::Start | ( | const GoogleUrl & | url, |
RewriteOptions * | custom_options, | ||
bool | using_spdy, | ||
ServerContext * | server_context, | ||
AsyncFetch * | async_fetch | ||
) | [static] |
Start an async fetch for pagespeed resource. Response will be streamed to async_fetch.
If custom_options it not NULL, takes ownership of it and and can mutate it.
using_spdy | This is intentionally not set in RewriteOptions because it is not so much an option as request-specific info similar to User-Agent (also not an option). |