Page Speed Optimization Libraries  1.6.29.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Static Public Member Functions | Static Public Attributes | Friends
net_instaweb::RewriteQuery Class Reference

List of all members.

Public Types

enum  Status { kSuccess, kInvalid, kNoneFound }

Static Public Member Functions

static Status Scan (bool allow_related_options, RewriteDriverFactory *factory, ServerContext *server_context, GoogleUrl *request_url, RequestHeaders *request_headers, ResponseHeaders *response_headers, scoped_ptr< RewriteOptions > *options, MessageHandler *handler)
template<class HeaderT >
static Status ScanHeader (HeaderT *headers, RequestProperties *request_properties, RewriteOptions *options, MessageHandler *handler)
static GoogleString GenerateResourceOption (StringPiece filter_id, RewriteDriver *driver)

Static Public Attributes

static const char kModPagespeed []
 The names of query-params.
static const char kPageSpeed []
static const char kModPagespeedFilters []
static const char kPageSpeedFilters []
static const char kNoscriptValue []

Friends

class RewriteQueryTest

Member Function Documentation

static GoogleString net_instaweb::RewriteQuery::GenerateResourceOption ( StringPiece  filter_id,
RewriteDriver driver 
) [static]

Given a two-letter filter ID string, generates a query-param for any in the driver's options that are related to the filter, and differ from the default. If no settings have been altered the empty string is returned.

static Status net_instaweb::RewriteQuery::Scan ( bool  allow_related_options,
RewriteDriverFactory factory,
ServerContext server_context,
GoogleUrl *  request_url,
RequestHeaders request_headers,
ResponseHeaders response_headers,
scoped_ptr< RewriteOptions > *  options,
MessageHandler *  handler 
) [static]

Scans request_url's query parameters and request_headers for "ModPagespeed" and "PageSpeed" flags, creating and populating *'options' if any were found they were all parsed successfully. If any were parsed unsuccessfully kInvalid is returned. If none found, kNoneFound is returned. It also removes the flags from the query_params of the url and the request_headers.

First queries are processed, then request headers, then response headers. Therefore parameters set by response headers take precedence over request headers over query parameters. The exception is filter disables, which always take precedence over enables, even those processed later.

If NULL is passed for request_headers or response_headers those particular headers will be skipped in the scan.

'allow_related_options' applies only to .pagespeed. resources. It enables the parsing of filters & options by ID, that have been declared in the RelatedOptions() and RelatedFilters() methods of the filter identified in the .pagespeed. URL. See GenerateResourceOption for how they get into URLs in the first place.

template<class HeaderT >
static Status net_instaweb::RewriteQuery::ScanHeader ( HeaderT *  headers,
RequestProperties request_properties,
RewriteOptions options,
MessageHandler *  handler 
) [static]

Performs the request and response header scanning for Scan(). If any "ModPagespeed" or "PageSpeed" options are found in the headers they are stripped. Returns kNoneFound if no options found. Returns kSuccess and populates *'options' if options are found. Returns kInvalid if any headers were parsed unsuccessfully. Note: mod_instaweb::build_context_for_request assumes that headers will be stripped from the headers if options are found and that headers will not grow in this call.


Member Data Documentation

ModPagespeed query-param value for redirect from clients that do not support javascript. Disables all filters that insert new javascript. Enables filter kHandleNoscriptRedirect.


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