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

#include "url_namer.h"

Inheritance diagram for net_instaweb::UrlNamer:
net_instaweb::MeasurementProxyUrlNamer net_instaweb::ProxyUrlNamer net_instaweb::TestUrlNamer

Public Types

enum  EncodeOption { kSharded, kUnsharded }
enum  ProxyExtent { kNone, ProxyExtent::kInputOnly, ProxyExtent::kFull }

Public Member Functions

virtual GoogleString Encode (const RewriteOptions *rewrite_options, const OutputResource &output_resource, EncodeOption encode_option) const
virtual bool Decode (const GoogleUrl &request_url, const RewriteOptions *rewrite_options, GoogleString *decoded) const
virtual bool IsAuthorized (const GoogleUrl &request_url, const RewriteOptions &options) const
virtual void ConfigureCustomOptions (const RequestHeaders &request_headers, RewriteOptions *options) const
 Configure custom options. Note that options may be NULL.
virtual ProxyExtent ProxyMode () const
virtual bool IsProxyEncoded (const GoogleUrl &url) const
virtual void PrepForCrossDomain (AsyncFetch *) const
 Prepare Fetch for cross-domain request.
const GoogleStringproxy_domain () const
void set_proxy_domain (const GoogleString &proxy_domain)

Detailed Description

Provides an overridable URL naming interface. This isolation layer allows us to override the rules for converting the original URL of a rewritten resource to something other than the default. The default implementation performs sharding and adds to the leaf name: '.pagespeed.<filter>.<hash>.<extension>'

Member Enumeration Documentation

This encodes whether we do some sort of mapping of resources to a separate proxy domain


We see requests on this domain, but don't produce it ourselves.


All resources are moved.

Member Function Documentation

virtual bool net_instaweb::UrlNamer::Decode ( const GoogleUrl request_url,
const RewriteOptions rewrite_options,
GoogleString decoded 
) const

Given the request_url, generate the original url.

Returns 'false' if request_url was not encoded via this namer.

Note: the default implementation always returns false. Note: rewrite_options may be NULL.

Reimplemented in net_instaweb::ProxyUrlNamer, net_instaweb::TestUrlNamer, and net_instaweb::MeasurementProxyUrlNamer.

virtual GoogleString net_instaweb::UrlNamer::Encode ( const RewriteOptions rewrite_options,
const OutputResource output_resource,
EncodeOption  encode_option 
) const

Given an output resource and an optional set of options, generate the URL that will be embedded in the rewritten page.

encode_options is used to determine whether sharding is applied in this encoding.

Note: the default implementation returns the url of the output resource.

Reimplemented in net_instaweb::TestUrlNamer.

virtual bool net_instaweb::UrlNamer::IsAuthorized ( const GoogleUrl request_url,
const RewriteOptions options 
) const

Determines whether the provided request URL is authorized given the RewriteOptions.

The default implementation uses the domain lawyer in the options.

Reimplemented in net_instaweb::ProxyUrlNamer, and net_instaweb::MeasurementProxyUrlNamer.

virtual bool net_instaweb::UrlNamer::IsProxyEncoded ( const GoogleUrl url) const

Determines whether the specified URL has been mapped to that central proxy domain.

Reimplemented in net_instaweb::MeasurementProxyUrlNamer, and net_instaweb::TestUrlNamer.

virtual ProxyExtent net_instaweb::UrlNamer::ProxyMode ( ) const

Determines whether the naming policy incorporates proxying resources using a central proxy domain.

Reimplemented in net_instaweb::MeasurementProxyUrlNamer, and net_instaweb::TestUrlNamer.

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