Page Speed Optimization Libraries
1.13.35.1
|
Public Member Functions | |
RewriteFilter (RewriteDriver *driver) | |
virtual const char * | id () const =0 |
virtual void | DetermineEnabled (GoogleString *disabled_reason) |
virtual bool | CanModifyUrls () |
virtual const UrlSegmentEncoder * | encoder () const |
virtual bool | ComputeOnTheFly () const |
virtual RewriteContext * | MakeRewriteContext () |
virtual RewriteContext * | MakeNestedRewriteContext (RewriteContext *parent, const ResourceSlotPtr &slot) |
virtual void | EncodeUserAgentIntoResourceContext (ResourceContext *context) const |
virtual const RewriteOptions::Filter * | RelatedFilters (int *num_filters) const |
virtual const StringPieceVector * | RelatedOptions () 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 |
RewriteDriver * | driver () 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, RewriteDriver::InputRole role, bool *is_authorized) |
ResourcePtr | CreateInputResourceOrInsertDebugComment (StringPiece input_url, RewriteDriver::InputRole role, HtmlElement *element) |
void | ResolveUrl (StringPiece input_url, GoogleUrl *out_url) |
bool | IsRelativeUrlLoadPermittedByCsp (StringPiece url, CspDirective role) |
bool | BaseUrlIsValid () const |
bool | DebugMode () const |
bool | CanAddPagespeedOnloadToImage (const HtmlElement &) |
virtual void | LogFilterModifiedContent () |
virtual RewriteDriver::InlineAuthorizationPolicy | AllowUnauthorizedDomain () const |
virtual bool | IntendedForInlining () const |
void | AddJsToElement (StringPiece js, HtmlElement *script) |
Public Member Functions inherited from net_instaweb::EmptyHtmlFilter | |
virtual void | EndDocument () |
virtual void | Cdata (HtmlCdataNode *cdata) |
Called for CDATA blocks (e.g. <![CDATA[foobar]]>) | |
virtual void | Comment (HtmlCommentNode *comment) |
Called for HTML comments that aren't IE directives (e.g. ). | |
virtual void | IEDirective (HtmlIEDirectiveNode *directive) |
virtual void | Directive (HtmlDirectiveNode *directive) |
Called for HTML directives (e.g. <!doctype foobar>). | |
virtual void | Flush () |
ScriptUsage | GetScriptUsage () const override |
Public Member Functions inherited from net_instaweb::HtmlFilter | |
virtual void | RenderDone () |
bool | is_enabled () const |
void | set_is_enabled (bool is_enabled) |
virtual const char * | Name () const =0 |
The name of this filter – used for logging and debugging. | |
Static Public Member Functions | |
static StringPiece | GetCharsetForScript (const Resource *script, const StringPiece attribute_charset, const StringPiece enclosing_charset) |
static GoogleString | GetCharsetForStylesheet (const Resource *stylesheet, const StringPiece attribute_charset, const StringPiece enclosing_charset) |
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) |
Protected Member Functions | |
virtual const char * | LoggingId () |
This class logs using id(). | |
Protected Member Functions inherited from net_instaweb::CommonFilter | |
ServerContext * | server_context () const |
const RewriteOptions * | rewrite_options () |
virtual void | StartDocumentImpl ()=0 |
virtual void | StartElementImpl (HtmlElement *element)=0 |
virtual void | EndElementImpl (HtmlElement *element)=0 |
Additional Inherited Members | |
Public Types inherited from net_instaweb::HtmlFilter | |
enum | ScriptUsage { kWillInjectScripts, kMayInjectScripts, kNeverInjectsScripts } |
Describes a filter's relationship with scripts. More... | |
Static Public Attributes inherited from net_instaweb::CommonFilter | |
static const char | kCreateResourceFailedDebugMsg [] |
Debug message to be inserted when resource creation fails. | |
|
inlinevirtual |
Returns whether this filter can modify urls. Because most filters do modify urls this defaults returning true, and filters that commit to never modifying urls should override it to return false.
Reimplemented from net_instaweb::EmptyHtmlFilter.
|
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::CombiningFilter, net_instaweb::FakeFilter, net_instaweb::SimpleTextFilter, and net_instaweb::CacheExtender.
|
virtual |
Override DetermineEnabled so that filters that use the DOM cohort of the property cache can enable writing of it in the RewriterDriver. Filters inheriting from RewriteDriver that use the DOM cohort should override UsePropertyCacheDomCohort to return true.
Reimplemented from net_instaweb::EmptyHtmlFilter.
Reimplemented in net_instaweb::CriticalSelectorFilter, net_instaweb::CriticalCssBeaconFilter, and net_instaweb::CssCombineFilter.
|
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::CombiningFilter, net_instaweb::ImageRewriteFilter, net_instaweb::CssFilter, net_instaweb::JsCombineFilter, net_instaweb::ImageCombineFilter, and net_instaweb::CssCombineFilter.
|
inlinevirtual |
Encodes user agent information needed by the filter into ResourceContext. See additional header document for RewriteContext::EncodeUserAgentIntoResourceContext.
Reimplemented in net_instaweb::ImageRewriteFilter, net_instaweb::FakeFilter, and net_instaweb::CssFilter.
|
static |
Determine the charset of a script. Logic taken from: http://www.whatwg.org/specs/web-apps/current-work/multipage/ scripting-1.html#establish-script-block-source
|
static |
Determine the charset of a stylesheet. Logic taken from: http://www.opentag.com/xfaq_enc.htm#enc_howspecifyforcss with the BOM rule below added somewhat arbitrarily. In essence, we take the -last- charset we see, if you pretend that headers come last.
|
virtual |
Generates a nested RewriteContext appropriate for this filter. Default implementation returns NULL. This is used to implement ajax rewriting.
Reimplemented in net_instaweb::ImageRewriteFilter, net_instaweb::CssFilter, net_instaweb::SimpleTextFilter, net_instaweb::FakeFilter, and net_instaweb::JavascriptFilter.
|
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::CombiningFilter, net_instaweb::NestedFilter, net_instaweb::ImageRewriteFilter, net_instaweb::CssSummarizerBase, net_instaweb::CssFilter, net_instaweb::SimpleTextFilter, net_instaweb::JsCombineFilter, net_instaweb::FakeFilter, net_instaweb::CacheExtender, net_instaweb::JavascriptFilter, and net_instaweb::CssCombineFilter.
|
virtual |
Determines which filters are related to this RewriteFilter. Note, for example, that the ImageRewriteFilter class implements lots of different RewriteOptions::Filters.
This is used for embedding the relevant enabled filter IDs. See the doc for RewriteOptions::add_options_to_urls_. We want to support that without bloating URLs excessively adding unrelated filter settings.
The vector is returned in numerically increasing order so binary_search is possible.
*num_filters is set to the size of this array.
Ownership of the filter-vector is not transferred to the caller; it is expected to return a pointer to a static vector.
Reimplemented in net_instaweb::ImageRewriteFilter, and net_instaweb::CssFilter.
|
inlinevirtual |
Return the names of options related to this RewriteFilter in case-insensitive alphabetical order. NULL means there are none. Ownership of the vector is not transferred to the caller.
Reimplemented in net_instaweb::ImageRewriteFilter, and net_instaweb::CssFilter.