#include "url_namer.h"
Classes | |
class | Callback |
Public Member Functions | |
virtual GoogleString | Encode (const RewriteOptions *rewrite_options, const OutputResource &output_resource) const |
virtual bool | Decode (const GoogleUrl &request_url, GoogleUrl *owner_domain, GoogleString *decoded) const |
virtual bool | IsAuthorized (const GoogleUrl &request_url, const RewriteOptions &options) const |
virtual void | DecodeOptions (const GoogleUrl &request_url, const RequestHeaders &request_headers, Callback *callback, MessageHandler *handler) const |
Given the request url and request headers, generate the rewrite options. | |
virtual void | PrepareRequest (const RewriteOptions *rewrite_options, GoogleString *url, RequestHeaders *request_headers, bool *success, Function *func, MessageHandler *handler) |
Modifies the request prior to dispatch to the underlying fetcher. | |
virtual bool | ProxyMode () const |
virtual bool | IsProxyEncoded (const GoogleUrl &url) const |
const GoogleString & | get_proxy_domain () |
void | set_proxy_domain (const GoogleString proxy_domain) |
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>'
virtual bool net_instaweb::UrlNamer::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 in net_instaweb::TestUrlNamer.
virtual GoogleString net_instaweb::UrlNamer::Encode | ( | const RewriteOptions * | rewrite_options, | |
const OutputResource & | output_resource | |||
) | const [virtual] |
Given an output resource and an optional set of options, generate the URL that will be embedded in the rewritten page.
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 [virtual] |
Determines whether the provided request URL is authorized given the RewriteOptions.
The default implementation uses the domain lawyer in the options.
virtual bool net_instaweb::UrlNamer::IsProxyEncoded | ( | const GoogleUrl & | url | ) | const [inline, virtual] |
Determines whether the specified URL has been mapped to that central proxy domain.
Reimplemented in net_instaweb::TestUrlNamer.
virtual bool net_instaweb::UrlNamer::ProxyMode | ( | ) | const [inline, virtual] |
Determines whether the naming policy incorporates proxying resources using a central proxy domain.
Reimplemented in net_instaweb::TestUrlNamer.