Page Speed Optimization Libraries  1.13.35.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::TestUrlNamer Class Reference

#include "test_url_namer.h"

Inheritance diagram for net_instaweb::TestUrlNamer:
net_instaweb::UrlNamer

Public Member Functions

virtual GoogleString Encode (const RewriteOptions *rewrite_options, const OutputResource &output_resource, EncodeOption encode_option) const
 
bool Decode (const GoogleUrl &request_url, const RewriteOptions *rewrite_options, GoogleString *decoded) const override
 
ProxyExtent ProxyMode () const override
 
virtual bool IsProxyEncoded (const GoogleUrl &url) const
 Determines whether the specified URL has been mapped to our proxy domain.
 
- Public Member Functions inherited from net_instaweb::UrlNamer
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 void PrepForCrossDomain (AsyncFetch *) const
 Prepare Fetch for cross-domain request.
 
const GoogleStringproxy_domain () const
 
void set_proxy_domain (const GoogleString &proxy_domain)
 

Static Public Member Functions

static GoogleString EncodeUrl (const StringPiece &original_base, const StringPiece &unmapped_base, const StringPiece &resolved_path, const ResourceNamer &leaf_details)
 
static void SetProxyMode (ProxyExtent value)
 Set whether a test needs the URL namer to act in proxy mode.
 
static void UseNormalEncoding (bool yes)
 
static bool UseNormalEncoding ()
 

Additional Inherited Members

- Public Types inherited from net_instaweb::UrlNamer
enum  EncodeOption { kSharded, kUnsharded }
 
enum  ProxyExtent { kNone, ProxyExtent::kInputOnly, ProxyExtent::kFull }
 

Detailed Description

Implements a non-standard URL naming scheme that changes the domain and the path, thereby testing various code path flows.

Member Function Documentation

bool net_instaweb::TestUrlNamer::Decode ( const GoogleUrl request_url,
const RewriteOptions rewrite_options,
GoogleString decoded 
) const
overridevirtual

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 from net_instaweb::UrlNamer.

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

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 from net_instaweb::UrlNamer.

ProxyExtent net_instaweb::TestUrlNamer::ProxyMode ( ) const
inlineoverridevirtual

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

Reimplemented from net_instaweb::UrlNamer.

static void net_instaweb::TestUrlNamer::UseNormalEncoding ( bool  yes)
inlinestatic

If a test needs normal encoding, even when TestUrlNamer is wired in, they can set this on and Encode() will redirect to UrlNamer::Encode().


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