Page Speed Optimization Libraries
1.13.35.1
|
#include "resource_fetch.h"
Public Types | |
enum | CleanupMode { kAutoCleanupDriver, kDontAutoCleanupDriver } |
For StartWithDriver(). | |
Static Public Member Functions | |
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) |
Static Public Member Functions inherited from net_instaweb::AsyncFetch | |
static bool | IsGoogleCacheVia (StringPiece via_value) |
Protected Member Functions | |
virtual void | HandleHeadersComplete () |
Protected interface from AsyncFetch. | |
virtual void | HandleDone (bool success) |
Protected Member Functions inherited from net_instaweb::SharedAsyncFetch | |
virtual bool | HandleWrite (const StringPiece &content, MessageHandler *handler) |
virtual bool | HandleFlush (MessageHandler *handler) |
virtual bool | IsCachedResultValid (const ResponseHeaders &headers) |
virtual bool | IsBackgroundFetch () const |
void | PropagateContentLength () |
Propagates any set_content_length from this to the base fetch. | |
Additional Inherited Members | |
Public Member Functions inherited from net_instaweb::SharedAsyncFetch | |
SharedAsyncFetch (AsyncFetch *base_fetch) | |
virtual const RequestContextPtr & | request_context () |
Public Member Functions inherited from net_instaweb::AsyncFetch | |
AsyncFetch (const RequestContextPtr &request_ctx) | |
void | HeadersComplete () |
void | Done (bool success) |
virtual bool | Write (const StringPiece &content, MessageHandler *handler) |
virtual bool | Flush (MessageHandler *handler) |
RequestHeaders * | request_headers () |
void | set_request_headers (RequestHeaders *headers) |
void | SetRequestHeadersTakingOwnership (RequestHeaders *headers) |
Same as above, but takes ownership. | |
const RequestHeaders * | request_headers () const |
ResponseHeaders * | response_headers () |
See doc for request_headers and set_request_headers. | |
void | set_response_headers (ResponseHeaders *headers) |
ResponseHeaders * | extra_response_headers () |
void | set_extra_response_headers (ResponseHeaders *headers) |
virtual void | Reset () |
bool | headers_complete () const |
bool | content_length_known () const |
int64 | content_length () const |
void | set_content_length (int64 x) |
GoogleString | LoggingString () |
virtual AbstractLogRecord * | log_record () |
void | FixCacheControlForGoogleCache () |
Public Member Functions inherited from net_instaweb::Writer | |
virtual bool | Dump (Writer *writer, MessageHandler *message_handler) |
Static Public Attributes inherited from net_instaweb::AsyncFetch | |
static const int | kContentLengthUnknown = -1 |
Manages a single fetch of a pagespeed rewritten resource. Fetch is initialized by calling ResourceFetch::Start()
|
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 |
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 |
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.
|
static |
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.