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

List of all members.

Public Types

enum  Status { kSuccess, kInvalid, kNoneFound }

Public Member Functions

Status Scan (bool allow_related_options, RewriteDriverFactory *factory, ServerContext *server_context, GoogleUrl *request_url, RequestHeaders *request_headers, ResponseHeaders *response_headers, MessageHandler *handler)
const QueryParams & query_params () const
const QueryParams & pagespeed_query_params () const
const RewriteOptionsoptions () const
RewriteOptionsReleaseOptions ()

Static Public Member Functions

template<class HeaderT >
static Status ScanHeader (HeaderT *headers, RequestProperties *request_properties, RewriteOptions *options, MessageHandler *handler)
static GoogleString GenerateResourceOption (StringPiece filter_id, RewriteDriver *driver)
static bool MightBeCustomOption (StringPiece name)
static bool IsOK (Status status)

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 bool net_instaweb::RewriteQuery::IsOK ( Status  status) [inline, static]

Determines whether the status code is one that is acceptable for processing requests.

static bool net_instaweb::RewriteQuery::MightBeCustomOption ( StringPiece  name) [static]

Indicates whether the specified name is likely to identify a custom header or query param.

Status net_instaweb::RewriteQuery::Scan ( bool  allow_related_options,
RewriteDriverFactory factory,
ServerContext server_context,
GoogleUrl *  request_url,
RequestHeaders *  request_headers,
ResponseHeaders *  response_headers,
MessageHandler *  handler 
)

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 and populates pagespeed_query_params() with the removed query parameters.

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