Page Speed Optimization Libraries  1.3.25.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Static Public Member Functions | Protected Member Functions
net_instaweb::ResourceFetch Class Reference

#include "resource_fetch.h"

Inheritance diagram for net_instaweb::ResourceFetch:
net_instaweb::SharedAsyncFetch net_instaweb::AsyncFetch net_instaweb::Writer

List of all members.

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 RewriteDriverGetDriver (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)

Detailed Description

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

Member Function Documentation

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.

Parameters:
using_spdyThis 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).

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines