Page Speed Optimization Libraries  1.9.32.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
net_instaweb::InstawebHandler Class Reference

#include "instaweb_handler.h"

Public Member Functions

 InstawebHandler (request_rec *request)
 
const GoogleUrl & stripped_gurl () const
 Any PageSpeed query params are removed.
 
const RequestContextPtr request_context () const
 
bool use_custom_options () const
 
const QueryParams & query_params ()
 
const QueryParams & pagespeed_query_params ()
 
const QueryParams & pagespeed_option_cookies ()
 
void SetupSpdyConnectionIfNeeded ()
 
void RemoveStrippedResponseHeadersFromApacheRequest ()
 
RewriteDriverMakeDriver ()
 
ApacheFetchMakeFetch (const GoogleString &url)
 
ApacheFetchMakeFetch ()
 
bool HandleAsProxy ()
 
bool HandleAsInPlace ()
 
void HandleAsPagespeedResource ()
 
void WaitForFetch ()
 Waits for an outstanding fetch (obtained by MakeFetch) to complete.
 
RequestHeaders * ReleaseRequestHeaders ()
 
const SystemRewriteOptionsoptions ()
 

Static Public Member Functions

static bool is_pagespeed_subrequest (request_rec *request)
 
static apr_status_t instaweb_handler (request_rec *request)
 
static apr_status_t save_url_hook (request_rec *request)
 
static apr_status_t save_url_in_note (request_rec *request, ApacheServerContext *server_context)
 
static apr_status_t instaweb_map_to_storage (request_rec *request)
 
static void AboutToBeDoneWithRecorder (request_rec *request, InPlaceResourceRecorder *recorder)
 

Detailed Description

Context for handling a request, computing options and request headers in the constructor.

Todo:
TODO(jmarantz): There are many static methods in this class. Some of them need to stay that way as they are used as C entry points. Some are helper methods, and we could adopt a policy of requiring the static methods to instantiate the class (possibly making its constructor lighter weight) and then calling them explicitly. For the time being, we'll leave these static methods with the non-compliant lower_case_names_with_underscores naming convention and fix their naming when we update whether they should be static or not.

Member Function Documentation

static void net_instaweb::InstawebHandler::AboutToBeDoneWithRecorder ( request_rec *  request,
InPlaceResourceRecorder recorder 
)
static

This must be called on any InPlaceResourceRecorder allocated by instaweb_handler before calling DoneAndSetHeaders() on it.

bool net_instaweb::InstawebHandler::HandleAsInPlace ( )

Attempts to handle this as an in-place resource. Returns false if the in-place handling didn't occur, and another handler should take over the request.

void net_instaweb::InstawebHandler::HandleAsPagespeedResource ( )

Unconditionally handles a resource that looks like a .pagespeed. resource, whether the result is success or failure.

bool net_instaweb::InstawebHandler::HandleAsProxy ( )

Attempts to handle this as a proxied resource (see MapProxyDomain). Returns false if the proxy handling didn't occur, and another handler should take over the request.

static apr_status_t net_instaweb::InstawebHandler::instaweb_handler ( request_rec *  request)
static

Handle mod_pagespeed-specific requests. Handles both .pagespeed. rewritten resources and /mod_pagespeed_statistics, /mod_pagespeed_beacon, etc.

static apr_status_t net_instaweb::InstawebHandler::instaweb_map_to_storage ( request_rec *  request)
static

By default, apache imposes limitations on URL segments of around 256 characters that appear to correspond to filename limitations. To prevent that, we hook map_to_storage for our own purposes.

static bool net_instaweb::InstawebHandler::is_pagespeed_subrequest ( request_rec *  request)
static

Was this request made by mod_pagespeed itself? If so, we should not try to handle it, just let Apache deal with it like normal.

RewriteDriver* net_instaweb::InstawebHandler::MakeDriver ( )

Makes a driver from the request_context and options. Note that this can only be called once, as it potentially mutates the options as it transfers ownership of custom_options.

ApacheFetch* net_instaweb::InstawebHandler::MakeFetch ( const GoogleString &  url)

Allocates a Fetch object associated with the current request and the specified URL.

ApacheFetch* net_instaweb::InstawebHandler::MakeFetch ( )
inline

Allocates a Fetch object associated with the current request and its URL.

const SystemRewriteOptions* net_instaweb::InstawebHandler::options ( )
inline

Returns the options, whether they were custom-computed due to htaccess file, query params, or headers, or were the default options for the vhost.

static apr_status_t net_instaweb::InstawebHandler::save_url_hook ( request_rec *  request)
static

Save the original URL as a request "note" before mod_rewrite has a chance to corrupt mod_pagespeed's generated URLs, which would prevent instaweb_handler from being able to decode the resource.

static apr_status_t net_instaweb::InstawebHandler::save_url_in_note ( request_rec *  request,
ApacheServerContext server_context 
)
static

Implementation of the Apache 'translate_name' hook. Used by the actual hook 'save_url_hook' and directly when we already have the server context.


The documentation for this class was generated from the following file: