net_instaweb::RewriteFilter Class Reference

Inheritance diagram for net_instaweb::RewriteFilter:
net_instaweb::CommonFilter net_instaweb::EmptyHtmlFilter net_instaweb::HtmlFilter net_instaweb::CacheExtender net_instaweb::CssCombineFilter net_instaweb::CssFilter net_instaweb::ImageCombineFilter net_instaweb::ImageRewriteFilter net_instaweb::JavascriptFilter net_instaweb::JsCombineFilter net_instaweb::LocalStorageCacheFilter net_instaweb::SimpleTextFilter

List of all members.

Public Member Functions

 RewriteFilter (RewriteDriver *driver)
virtual const char * id () const =0
ResourcePtr CreateInputResourceFromOutputResource (OutputResource *output_resource)
virtual const UrlSegmentEncoderencoder () const
virtual bool ComputeOnTheFly () const
virtual RewriteContextMakeRewriteContext ()
virtual RewriteContextMakeNestedRewriteContext (RewriteContext *parent, const ResourceSlotPtr &slot)

Static Public Member Functions

static StringPiece GetCharsetForScript (const Resource *script, const StringPiece attribute_charset, const StringPiece enclosing_charset)

Member Function Documentation

virtual bool net_instaweb::RewriteFilter::ComputeOnTheFly (  )  const [virtual]

If this method returns true, the data output of this filter will not be cached, and will instead be recomputed on the fly every time it is needed. (However, the transformed URL and similar metadata in CachedResult will be kept in cache).

The default implementation returns false.

Reimplemented in net_instaweb::CacheExtender, and net_instaweb::SimpleTextFilter.

ResourcePtr net_instaweb::RewriteFilter::CreateInputResourceFromOutputResource ( OutputResource output_resource  ) 

Create an input resource by decoding output_resource using the filter's. Assures legality by explicitly permission-checking the result.

virtual const UrlSegmentEncoder* net_instaweb::RewriteFilter::encoder (  )  const [virtual]

All RewriteFilters define how they encode URLs and other associated information needed for a rewrite into a URL. The default implementation handles a single URL with no extra data. The filter owns the encoder.

Reimplemented in net_instaweb::CssCombineFilter, net_instaweb::CssFilter, net_instaweb::ImageCombineFilter, net_instaweb::ImageRewriteFilter, and net_instaweb::JsCombineFilter.

static StringPiece net_instaweb::RewriteFilter::GetCharsetForScript ( const Resource script,
const StringPiece  attribute_charset,
const StringPiece  enclosing_charset 
) [static]

Determine the charset of a script. Logic taken from: http://www.whatwg.org/specs/web-apps/current-work/multipage/ scripting-1.htmlestablish-script-block-source 1. If the script has a Content-Type with a charset, use that, else 2. If the script has a charset attribute, use that, else 3. If the script has a BOM, use that, else 4. Use the charset of the enclosing page. If none of these are specified we return StringPiece(NULL). Note that Chrome and Opera do not actually implement this spec - it seems that for them a BOM overrules a charset attribute (swap rules 2 and 3). Note that the return value might point into one of the given arguments so you must ensure that it isn't used past the life of any of the arguments.

virtual RewriteContext* net_instaweb::RewriteFilter::MakeNestedRewriteContext ( RewriteContext parent,
const ResourceSlotPtr slot 
) [virtual]

Generates a nested RewriteContext appropriate for this filter. Default implementation returns NULL. This is used to implement ajax rewriting.

Reimplemented in net_instaweb::CssFilter, net_instaweb::ImageRewriteFilter, net_instaweb::JavascriptFilter, and net_instaweb::SimpleTextFilter.

virtual RewriteContext* net_instaweb::RewriteFilter::MakeRewriteContext (  )  [virtual]

Generates a RewriteContext appropriate for this filter. Default implementation returns NULL. This must be overridden by filters. This is used to implement Fetch.

Reimplemented in net_instaweb::CacheExtender, net_instaweb::CssCombineFilter, net_instaweb::CssFilter, net_instaweb::ImageRewriteFilter, net_instaweb::JavascriptFilter, net_instaweb::JsCombineFilter, and net_instaweb::SimpleTextFilter.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Tue May 29 16:34:05 2012 for Page Speed Optimization Libraries by  doxygen 1.6.3