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

#include "domain_rewrite_filter.h"

Inheritance diagram for net_instaweb::DomainRewriteFilter:
net_instaweb::CommonFilter

Public Types

enum  RewriteResult { kRewroteDomain, kDomainUnchanged, kFail }
 

Public Member Functions

 DomainRewriteFilter (RewriteDriver *rewrite_driver, Statistics *stats)
 
virtual void StartDocumentImpl ()
 
virtual void EndDocument ()
 
virtual void StartElementImpl (HtmlElement *element)
 
virtual void EndElementImpl (HtmlElement *element)
 
virtual const char * Name () const
 
RewriteResult Rewrite (const StringPiece &input_url, const GoogleUrl &base_url, const RewriteDriver *driver, bool apply_sharding, GoogleString *output_url) const
 
void UpdateLocationHeader (const GoogleUrl &base_url, RewriteDriver *driver, ResponseHeaders *headers) const
 
- Public Member Functions inherited from net_instaweb::CommonFilter
 CommonFilter (RewriteDriver *driver)
 
const GoogleUrl & base_url () const
 Getters. More...
 
const GoogleUrl & decoded_base_url () const
 
RewriteDriverdriver () const
 
HtmlElement * noscript_element () const
 
void InsertNodeAtBodyEnd (HtmlNode *data)
 
virtual void StartDocument ()
 Note: Don't overload these methods, overload the implementers instead!
 
virtual void StartElement (HtmlElement *element)
 
virtual void EndElement (HtmlElement *element)
 
virtual void Characters (HtmlCharactersNode *characters)
 
ResourcePtr CreateInputResource (StringPiece input_url, bool *is_authorized)
 
ResourcePtr CreateInputResourceOrInsertDebugComment (StringPiece input_url, HtmlElement *element)
 
void ResolveUrl (StringPiece input_url, GoogleUrl *out_url)
 
bool BaseUrlIsValid () const
 
bool DebugMode () const
 
bool CanAddPagespeedOnloadToImage (const HtmlElement &)
 
virtual void LogFilterModifiedContent ()
 
virtual
RewriteDriver::InlineAuthorizationPolicy 
AllowUnauthorizedDomain () const
 
virtual bool IntendedForInlining () const
 

Static Public Member Functions

static void InitStats (Statistics *statistics)
 
- Static Public Member Functions inherited from net_instaweb::CommonFilter
static bool ExtractMetaTagDetails (const HtmlElement &element, const ResponseHeaders *headers, GoogleString *content, GoogleString *mime_type, GoogleString *charset)
 

Additional Inherited Members

- Static Public Attributes inherited from net_instaweb::CommonFilter
static const char kCreateResourceFailedDebugMsg []
 Debug message to be inserted when resource creation fails.
 
- Protected Member Functions inherited from net_instaweb::CommonFilter
ServerContextserver_context () const
 
const RewriteOptionsrewrite_options ()
 
virtual const char * LoggingId ()
 

Detailed Description

Filter that rewrites URL domains for resources that are not otherwise rewritten. For example, the user may want to domain-shard adding a hash to their URL leaves, or domain shard resources that are not cacheable.

Member Function Documentation

RewriteResult net_instaweb::DomainRewriteFilter::Rewrite ( const StringPiece &  input_url,
const GoogleUrl &  base_url,
const RewriteDriver driver,
bool  apply_sharding,
GoogleString *  output_url 
) const

Rewrites the specified URL (which might be relative to the base tag) into an absolute sharded url.

Absolute URL output_url will be set if kRewroteDomain or kDomainUnchanged returned.

virtual void net_instaweb::DomainRewriteFilter::StartDocumentImpl ( )
virtual

Overload these implementer methods: Intentionally left abstract so that implementers don't forget to change the name from Blah to BlahImpl.

Implements net_instaweb::CommonFilter.

void net_instaweb::DomainRewriteFilter::UpdateLocationHeader ( const GoogleUrl &  base_url,
RewriteDriver driver,
ResponseHeaders *  headers 
) const

Update the url in the location header as per the rewrite rules configured for this domain.


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