Page Speed Optimization Libraries
1.3.25.1
|
#include "meta_tag_filter.h"
Public Member Functions | |
MetaTagFilter (RewriteDriver *rewrite_driver) | |
virtual void | StartDocumentImpl () |
virtual void | StartElementImpl (HtmlElement *element) |
virtual void | EndElementImpl (HtmlElement *element) |
virtual void | Flush () |
virtual const char * | Name () const |
The name of this filter -- used for logging and debugging. | |
Static Public Member Functions | |
static void | InitStats (Statistics *stats) |
static bool | ExtractAndUpdateMetaTagDetails (HtmlElement *element, ResponseHeaders *response_headers) |
This class is the implementation of convert_meta_tags filter, which removes meta tags from the html and replaces them with a corresponding response header.
virtual void net_instaweb::MetaTagFilter::EndElementImpl | ( | HtmlElement * | element | ) | [virtual] |
Rewrite tags in the following form: <meta http-equiv="Content-Type" content="text/html" > into response headers. In theory we could delete the tag, but since it is somewhat "dangerous" to mutate the html (in case a script is looking for something), we leave the tag in there. As long as the tags and the headers match, there should not be a performance hit.
Implements net_instaweb::CommonFilter.
static bool net_instaweb::MetaTagFilter::ExtractAndUpdateMetaTagDetails | ( | HtmlElement * | element, |
ResponseHeaders * | response_headers | ||
) | [static] |
Utility function to extract the mime type and/or charset from a meta tag and update the response_headers if they are not set already.
virtual void net_instaweb::MetaTagFilter::Flush | ( | ) | [virtual] |
Notifies the Filter that a flush is occurring. A filter that's generating streamed output should flush at this time. A filter that's mutating elements can mutate any element seen since the most recent flush; once an element is flushed it is already on the wire to its destination and it's too late to mutate. Flush is initiated by an application calling HttpParse::Flush().
Flush() is called after all other handlers during a HttpParse::Flush().
Reimplemented from net_instaweb::EmptyHtmlFilter.
virtual void net_instaweb::MetaTagFilter::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.