Page Speed Optimization Libraries
1.7.30.3
|
#include "url_left_trim_filter.h"
Public Member Functions | |
UrlLeftTrimFilter (RewriteDriver *rewrite_driver, Statistics *stats) | |
virtual void | StartDocumentImpl () |
virtual void | StartElementImpl (HtmlElement *element) |
virtual void | EndElementImpl (HtmlElement *element) |
virtual const char * | Name () const |
Static Public Member Functions | |
static void | InitStats (Statistics *statistics) |
static bool | Trim (const GoogleUrl &base_url, const StringPiece &url_to_trim, GoogleString *trimmed_url, MessageHandler *handler) |
Friends | |
class | UrlLeftTrimFilterTest |
Filter that trims redundant information from the left end of each url.
For example: if the page's base URL is http://www.example.com/foo/bar.html then the following URLs can be trimmed: http://www.example.com/foo/bar/other.html -> bar/other.html http://www.example.com/another.html -> /another.html http://www.example.org/index.html -> //www.example.org/index.html
virtual void net_instaweb::UrlLeftTrimFilter::StartDocumentImpl | ( | ) | [inline, 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.
static bool net_instaweb::UrlLeftTrimFilter::Trim | ( | const GoogleUrl & | base_url, |
const StringPiece & | url_to_trim, | ||
GoogleString * | trimmed_url, | ||
MessageHandler * | handler | ||
) | [static] |
Trim 'url_to_trim' relative to 'base_url' returning the result in 'trimmed_url'. Returns true if we succeeded at trimming the URL.
This is static and requires the base_url explicitly, so that it can be called from other places (like the CSS filter).