#include "proxy_interface.h"
Public Types | |
typedef std::pair < RewriteOptions *, bool > | OptionsBoolPair |
Public Member Functions | |
ProxyInterface (const StringPiece &hostname, int port, ResourceManager *manager, Statistics *stats) | |
virtual bool | Fetch (const GoogleString &requested_url, MessageHandler *handler, AsyncFetch *async_fetch) |
OptionsBoolPair | GetQueryOptions (GoogleUrl *request_url, RequestHeaders *request_headers, MessageHandler *handler) |
RewriteOptions * | GetCustomOptions (GoogleUrl *request_url, RequestHeaders *request_headers, RewriteOptions *domain_options, RewriteOptions *query_options, MessageHandler *handler) |
void | set_server_version (const StringPiece &server_version) |
void | ProxyRequestCallback (bool is_resource_fetch, GoogleUrl *request_url, AsyncFetch *async_fetch, RewriteOptions *domain_options, RewriteOptions *query_options, MessageHandler *handler) |
Static Public Member Functions | |
static void | Initialize (Statistics *statistics) |
Initializes statistics variables associated with this class. | |
Static Public Attributes | |
static const char | kBlinkRequestCount [] |
static const char | kBlinkCriticalLineRequestCount [] |
Protected Member Functions | |
virtual ProxyFetchPropertyCallbackCollector * | InitiatePropertyCacheLookup (bool is_resource_fetch, const GoogleUrl &request_url, RewriteOptions *options, AsyncFetch *async_fetch) |
Initiates the PropertyCache look up. | |
Friends | |
class | ProxyInterfaceTest |
virtual bool net_instaweb::ProxyInterface::Fetch | ( | const GoogleString & | requested_url, | |
MessageHandler * | handler, | |||
AsyncFetch * | async_fetch | |||
) | [virtual] |
All requests use this interface. We decide internally whether the request is a pagespeed resource, HTML page to be rewritten or another resource to be proxied directly.
Reimplemented from net_instaweb::UrlAsyncFetcher.
RewriteOptions* net_instaweb::ProxyInterface::GetCustomOptions | ( | GoogleUrl * | request_url, | |
RequestHeaders * | request_headers, | |||
RewriteOptions * | domain_options, | |||
RewriteOptions * | query_options, | |||
MessageHandler * | handler | |||
) |
Returns any custom options required for this request, incorporating any domain-specific options from the UrlNamer, options set in query-params, and options set in request headers.
OptionsBoolPair net_instaweb::ProxyInterface::GetQueryOptions | ( | GoogleUrl * | request_url, | |
RequestHeaders * | request_headers, | |||
MessageHandler * | handler | |||
) |
Returns any options set in query-params or in request headers. Possible return-value scenarios for the pair are:
.first==*, .second==false: query-params or req-headers failed in parse. .first==NULL, .second==true: No query-params or req-headers is present. .first!=NULL, .second==true: Use query-params. It also strips off the ModPageSpeed query parameters and headers from the request_url and request_headers respectively.
void net_instaweb::ProxyInterface::ProxyRequestCallback | ( | bool | is_resource_fetch, | |
GoogleUrl * | request_url, | |||
AsyncFetch * | async_fetch, | |||
RewriteOptions * | domain_options, | |||
RewriteOptions * | query_options, | |||
MessageHandler * | handler | |||
) |
Callback function passed to UrlNamer to finish handling requests once we have rewrite_options for requests that are being proxied.