Page Speed Optimization Libraries  1.4.26.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions
net_instaweb::CriticalCssBeaconFilter Class Reference

#include "critical_css_beacon_filter.h"

Inheritance diagram for net_instaweb::CriticalCssBeaconFilter:
net_instaweb::CssSummarizerBase net_instaweb::RewriteFilter net_instaweb::CommonFilter net_instaweb::EmptyHtmlFilter net_instaweb::HtmlFilter

List of all members.

Public Member Functions

 CriticalCssBeaconFilter (RewriteDriver *driver)
virtual const char * Name () const
 The name of this filter -- used for logging and debugging.
virtual const char * id () const

Static Public Member Functions

static void InitStats (Statistics *statistics)

Static Public Attributes

static const char kCriticalCssBeaconAddedCount []
 Statistics:
static const char kCriticalCssNoBeaconDueToMissingData []
static const char kCriticalCssSkippedDueToCharset []

Protected Member Functions

virtual void Summarize (Css::Stylesheet *stylesheet, GoogleString *out) const
virtual void SummariesDone ()

Detailed Description

Figure out the set of CSS selectors referenced from a page, saving those selectors in an OutputResource for each CSS <style> or <link> on the page. Based on that set of candidate critical selectors, inject javascript for detecting critical above the fold css selectors after the page has loaded. Assumes CSS have been flattened first.


Member Function Documentation

virtual void net_instaweb::CriticalCssBeaconFilter::SummariesDone ( ) [protected, virtual]

This is called at the end of the document when all outstanding summary computations have completed, regardless of whether successful or not. It will not be called at all if they are still ongoing, however.

It's called from a context which allows HTML parser state access. You can insert things at end of document by constructing an HtmlNode* using the factories in HtmlParse and calling InjectSummaryData(element).

Implements net_instaweb::CssSummarizerBase.

virtual void net_instaweb::CriticalCssBeaconFilter::Summarize ( Css::Stylesheet *  stylesheet,
GoogleString out 
) const [protected, virtual]

This should be overridden to compute a per-resource summary. The method should not modify the object state, and only put the result into *out as it may not be invoked in case of a cache hit. The subclass may mutate *stylesheet if it so wishes.

Note: this is called on a rewrite thread, so it should not access HTML parser state.

Implements net_instaweb::CssSummarizerBase.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines