#include "resource_fetch.h"
|
static void | Start (const GoogleUrl &url, RewriteOptions *custom_options, ServerContext *server_context, AsyncFetch *async_fetch) |
|
static void | StartWithDriver (const GoogleUrl &url, CleanupMode cleanup_mode, ServerContext *server_context, RewriteDriver *driver, 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) |
|
Manages a single fetch of a pagespeed rewritten resource. Fetch is initialized by calling ResourceFetch::Start()
- Todo:
- TODO(sligocki): Rename to PagespeedResourceFetch or something else ...
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.
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.
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.
Same as Start(), but takes the RewriteDriver to use. cleanup_mode determines whether ResourceFetch will call Cleanup() on the driver itself. If it's set to kAutoCleanupDriver, the driver should not be used by the caller after this call. Otherwise, it may be used by the caller, but it's responsible for calling Cleanup() once done with it.
The documentation for this class was generated from the following file: