Page Speed Optimization Libraries
1.6.29.3
|
#include "test_url_namer.h"
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, GoogleUrl *owner_domain, GoogleString *decoded) const |
virtual bool | ProxyMode () const |
virtual bool | IsProxyEncoded (const GoogleUrl &url) const |
Determines whether the specified URL has been mapped to our 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 (bool value) |
Set whether a test needs the URL namer to act in proxy mode. | |
static void | UseNormalEncoding (bool yes) |
static bool | UseNormalEncoding () |
Implements a non-standard URL naming scheme that changes the domain and the path, thereby testing various code path flows.
virtual bool net_instaweb::TestUrlNamer::Decode | ( | const GoogleUrl & | request_url, |
GoogleUrl * | owner_domain, | ||
GoogleString * | decoded | ||
) | const [virtual] |
Given the request_url, generate the original url. If the URL naming syntax supports an "owner" domain, and 'owner_domain' is non-null, then this method writes the owner domain into that pointer.
Returns 'false' if request_url was not encoded via this namer.
Note: the default implementation always returns false.
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.
virtual bool net_instaweb::TestUrlNamer::ProxyMode | ( | ) | const [inline, virtual] |
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 | ) | [inline, static] |
If a test needs normal encoding, even when TestUrlNamer is wired in, they can set this on and Encode() will redirect to UrlNamer::Encode().